From 7fc1a2ece1f73db7ef88990ee81b2e15ddb23a52 Mon Sep 17 00:00:00 2001 From: Mohammad Yosefpor <47300215+m-yosefpor@users.noreply.github.com> Date: Sun, 6 Aug 2023 12:59:46 +0330 Subject: [PATCH] Update team_webhook.go --- api/v1alpha1/team_webhook.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/v1alpha1/team_webhook.go b/api/v1alpha1/team_webhook.go index 874da8c..0d692c3 100644 --- a/api/v1alpha1/team_webhook.go +++ b/api/v1alpha1/team_webhook.go @@ -142,13 +142,13 @@ func getClient() (c kubernetes.Clientset, err error) { config, err := rest.InClusterConfig() if err != nil { teamlog.Error(err, "can not get in-cluster config.") - return c, errors.New("something is wrong please contact the cloud team") + return c, errors.New("something went wrong please contact the cloud team") } clientSet, err := kubernetes.NewForConfig(config) if err != nil { teamlog.Error(err, "can not create clientSet") - return *clientSet, errors.New("something is wrong please contact cloud team") + return *clientSet, errors.New("something went wrong please contact cloud team") } return *clientSet, nil } @@ -166,7 +166,7 @@ func nsExists(ns string, c kubernetes.Clientset) (tns corev1.Namespace, err erro func nsHasTeam(r *Team, tns *corev1.Namespace) (err error) { if val, ok := tns.Labels["snappcloud.io/team"]; ok { if tns.Labels["snappcloud.io/team"] != r.Name { - errorResp := fmt.Sprintf("namespace %s already has the team label %s", tns.Name, val) + errorResp := fmt.Sprintf("namespace %s already has the team label %s, please ask in cloud-support if you need to detach the namespace from previous team", tns.Name, val) return errors.New(errorResp) } }