|
|
@ -37,14 +37,9 @@ func getNamespace(client internalclientset.Interface, namespace string) (*api.Na
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func ensureNamespace(client internalclientset.Interface, namespace string) error {
|
|
|
|
func ensureNamespace(client internalclientset.Interface, namespace string) error {
|
|
|
|
if _, getError := getNamespace(client, namespace); getError != nil && errors.IsNotFound(getError) {
|
|
|
|
_, err := getNamespace(client, namespace)
|
|
|
|
createError := createNamespace(client, namespace)
|
|
|
|
if err != nil && errors.IsNotFound(err) {
|
|
|
|
if createError != nil {
|
|
|
|
return createNamespace(client, namespace)
|
|
|
|
return createError
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if getError != nil {
|
|
|
|
return err
|
|
|
|
return getError
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|