MCPcopy
hub / github.com/XiaoMi/naftis / handleNamespaces

Function handleNamespaces

src/api/executor/istiocrd.go:183–198  ·  view source on GitHub ↗
(objectNamespace string)

Source from the content-addressed store, hash-verified

181)
182
183func handleNamespaces(objectNamespace string) (string, error) {
184 if objectNamespace != "" && namespace != "" && namespace != objectNamespace {
185 return "", fmt.Errorf(`the namespace from the provided object "%s" does `+
186 `not match the namespace "%s". You must pass '--namespace=%s' to perform `+
187 `this operation`, objectNamespace, namespace, objectNamespace)
188 }
189
190 if namespace != "" {
191 return namespace, nil
192 }
193
194 if objectNamespace != "" {
195 return objectNamespace, nil
196 }
197 return defaultNamespace, nil
198}
199
200func (i *istiocrdExecutor) apply(task Task, t taskDbHandler) (errs error) {
201 task.Status = model.TaskStatusSucc

Callers 3

createMethod · 0.85
replaceMethod · 0.85
deleteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected