Przeglądaj źródła

Merge branch '0.8.0-pod-events-managment' into dev

merge
Alexander Belanger 4 lat temu
rodzic
commit
90e2dc6def
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      internal/kubernetes/agent.go

+ 2 - 2
internal/kubernetes/agent.go

@@ -250,13 +250,13 @@ func (a *Agent) ListNamespaces() (*v1.NamespaceList, error) {
 // CreateNamespace creates a namespace with the given name.
 // CreateNamespace creates a namespace with the given name.
 func (a *Agent) CreateNamespace(name string) (*v1.Namespace, error) {
 func (a *Agent) CreateNamespace(name string) (*v1.Namespace, error) {
 	// check if namespace exists
 	// check if namespace exists
-	checkNS, _ := a.Clientset.CoreV1().Namespaces().Get(
+	checkNS, err := a.Clientset.CoreV1().Namespaces().Get(
 		context.TODO(),
 		context.TODO(),
 		name,
 		name,
 		metav1.GetOptions{},
 		metav1.GetOptions{},
 	)
 	)
 
 
-	if checkNS != nil {
+	if err == nil && checkNS != nil {
 		return checkNS, nil
 		return checkNS, nil
 	}
 	}