MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / reset

Function reset

misc/python/materialize/cli/orchestratord.py:135–186  ·  view source on GitHub ↗
(args: argparse.Namespace)

Source from the content-addressed store, hash-verified

133
134
135def reset(args: argparse.Namespace):
136 environments = (
137 kubectl(
138 "get",
139 "--all-namespaces",
140 "materializes",
141 '-o=jsonpath={range .items[*]}{.metadata.namespace}/{.metadata.name}{"\\n"}{end}',
142 cluster=args.kind_cluster_name,
143 )
144 .decode()
145 .splitlines()
146 )
147 for environment in environments:
148 namespace, environment_name = environment.split("/", 1)
149 env_kubectl = make_env_kubectl(args, namespace)
150
151 mz = json.loads(
152 env_kubectl(
153 "get",
154 "materialize",
155 environment_name,
156 "-o",
157 "json",
158 )
159 )
160 backend_secret_name = mz["spec"]["backendSecretName"]
161 mz_system_password_secret_name = mz["spec"].get("externalLoginSecretMzSystem")
162
163 env_kubectl("delete", "--wait=true", "materialize", environment_name)
164 env_kubectl("delete", "--wait=true", "secret", backend_secret_name)
165 if mz_system_password_secret_name is not None:
166 env_kubectl(
167 "delete", "--wait=true", "secret", mz_system_password_secret_name
168 )
169
170 try:
171 subprocess.check_call(
172 [
173 "helm",
174 "uninstall",
175 "orchestratord",
176 f"--namespace={args.namespace}",
177 ]
178 )
179 kubectl(
180 "delete",
181 "namespace",
182 args.namespace,
183 cluster=args.kind_cluster_name,
184 )
185 except subprocess.CalledProcessError:
186 pass
187
188
189def environment(args: argparse.Namespace):

Callers 6

onSubmitFunction · 0.85
SwitchStackModalContentFunction · 0.85
AppPasswordsInnerFunction · 0.85
performCreateSchemaFunction · 0.85
flagAsflipperFunction · 0.85
handleCloseFunction · 0.85

Calls 6

kubectlFunction · 0.85
make_env_kubectlFunction · 0.85
env_kubectlFunction · 0.85
decodeMethod · 0.45
splitMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected