only do namespace check if not default

This commit is contained in:
Asim Aslam 2020-04-23 19:19:13 +01:00
parent 041d68b1ce
commit c68226e9b0

View File

@ -412,12 +412,15 @@ func (k *kubernetes) Create(s *runtime.Service, opts ...runtime.CreateOption) er
// ensure the namespace exists
namespace := client.SerializeResourceName(options.Namespace)
if exist, err := k.namespaceExists(namespace); err == nil && !exist {
if err := k.createNamespace(namespace); err != nil {
// only do this if the namespace is not default
if namespace != "default" {
if exist, err := k.namespaceExists(namespace); err == nil && !exist {
if err := k.createNamespace(namespace); err != nil {
return err
}
} else if err != nil {
return err
}
} else if err != nil {
return err
}
// determine the image from the source and options