Skip to content

Commit

Permalink
Fix cks cluster sync for a normal user
Browse files Browse the repository at this point in the history
  • Loading branch information
vishesh92 committed Jul 3, 2024
1 parent f9e326b commit a0bb10c
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 a0bb10c

Please sign in to comment.