Skip to content

Commit

Permalink
Update team_webhook.go
Browse files Browse the repository at this point in the history
  • Loading branch information
m-yosefpor authored Aug 6, 2023
1 parent d47597a commit 7fc1a2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/v1alpha1/team_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
}
}
Expand Down

0 comments on commit 7fc1a2e

Please sign in to comment.