Skip to content

Commit

Permalink
Merge pull request #385 from shapeblue/fix-cks-sync-normal-user
Browse files Browse the repository at this point in the history
Fix cks cluster sync for a normal user
  • Loading branch information
k8s-ci-robot authored Jul 3, 2024
2 parents f9e326b + a0bb10c commit 3ae856f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/cloud/cks_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ func (c *client) GetOrCreateCksCluster(cluster *clusterv1.Cluster, csCluster *in
if accountName == "" {
userParams := c.cs.User.NewGetUserParams(c.config.APIKey)
user, err := c.cs.User.GetUser(userParams)
if err != nil {
if err != nil && !strings.Contains(err.Error(), "does not exist or is not available for the account") {
return err
} else if err == nil {
accountName = user.Account
}
accountName = user.Account
}
// NewCreateKubernetesClusterParams(description string, kubernetesversionid string, name string, serviceofferingid string, size int64, zoneid string) *CreateKubernetesClusterParams
params := c.cs.Kubernetes.NewCreateKubernetesClusterParams(fmt.Sprintf("%s managed by CAPC", clusterName), "", clusterName, "", 0, fd.Zone.ID)
Expand Down

0 comments on commit 3ae856f

Please sign in to comment.