Skip to content

Conversation

@lizzy-0323
Copy link
Contributor

@lizzy-0323 lizzy-0323 commented Dec 12, 2024

Summary

This PR fix bugs in the first round of cli testing. The problem solved is as follows:

  1. fix version flag panic : 2a1d363
  2. fix password checking in demo cmd: db048b9
  3. fix password logging when using specified namespace: 5f03455
  4. Add checking whether the tenant exists before establishing the cluster: db048b9
  5. fix helm error when using helm<3.7.0: 4db8963
  6. fix duplicate item in backup-policy 's show cmd: 426a61f
  7. fix: remove Complete function when creating a backup policy: 81a827d, and the details can be seen in the commit message. The tenant’s create command has also been modified in 4faa655
  8. fix lint: 13f4779

Solution Description

if !utils.CheckIfClusterExists(cmd.Context(), clusterOptions.Name, clusterOptions.Namespace) {
break
}
logger.Printf("Cluster %s already exists in namespace %s, please input another cluster name", clusterOptions.Name, clusterOptions.Namespace)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This for-loop seems to be endless if the flow gets here.

Copy link
Contributor Author

@lizzy-0323 lizzy-0323 Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because here we want to check if the cluster name typed by user is available in the corresponding namespace, and if it is not exists (which is meet the requirements, the return value of utils.CheckIfClusterExists is false), and the workflow will be advanced.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I see. The cli tool is asking the user to enter the name and namespace of the cluster here.

if !utils.CheckIfTenantExists(cmd.Context(), tenantOptions.Name, clusterOptions.Namespace) {
break
}
logger.Printf("Tenant %s already exists in namespace %s, please input another tenant name", tenantOptions.Name, clusterOptions.Namespace)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as the above

if !utils.CheckIfClusterExists(cmd.Context(), clusterOptions.Name, clusterOptions.Namespace) {
break
}
logger.Printf("Cluster %s already exists in namespace %s, please input another cluster name", clusterOptions.Name, clusterOptions.Namespace)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I see. The cli tool is asking the user to enter the name and namespace of the cluster here.

@powerfooI powerfooI merged commit 91f2197 into oceanbase:master Dec 13, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants