Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cks cluster sync for a normal user #385

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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