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

OCM-7570 | fix: Small bugfix for rosa describe machinepool #1967

Merged
merged 1 commit into from Apr 25, 2024

Conversation

hunterkepley
Copy link
Contributor

@hunterkepley hunterkepley commented Apr 25, 2024

OCM-7570 describes a bug for rosa describe machinepool. This MR fixes that bug

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 25, 2024
@@ -71,6 +71,7 @@ func DescribeMachinePoolRunner(userOptions DescribeMachinepoolUserOptions) rosa.
userOptions.machinepool = argv[0]
} else {
err := cmd.ParseFlags(argv)
userOptions.machinepool = cmd.Flag("machinepool").Value.String()
Copy link
Contributor

@robpblake robpblake Apr 25, 2024

Choose a reason for hiding this comment

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

@hunterkepley Is userOptions.machinepool not set at the entry to this function if you pass the --machinepool argument to this command? It should be given the way you initialise the FlagSet in the NewDescribeMachinePool function. If it's not, then we need to come back to the pattern here as that's pretty fundamental.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is not it seems, cannot run the command without this @robpblake

Copy link

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 23.24%. Comparing base (59e94e8) to head (f72b592).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1967      +/-   ##
==========================================
+ Coverage   23.22%   23.24%   +0.01%     
==========================================
  Files         136      136              
  Lines       21160    21161       +1     
==========================================
+ Hits         4914     4918       +4     
+ Misses      15879    15878       -1     
+ Partials      367      365       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -71,6 +71,7 @@ func DescribeMachinePoolRunner(userOptions DescribeMachinepoolUserOptions) rosa.
userOptions.machinepool = argv[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

@hunterkepley I think you need to replace the cobra.NoArgs on the cmd definition with cobra.MaximumNArgs(1). That's what is was prior to your refactor and why passing the workers name as an arg is being rejected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@robpblake fixed

@@ -71,6 +71,7 @@ func DescribeMachinePoolRunner(userOptions DescribeMachinepoolUserOptions) rosa.
userOptions.machinepool = argv[0]
} else {
err := cmd.ParseFlags(argv)
Copy link
Contributor

Choose a reason for hiding this comment

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

@hunterkepley I think we can drop this additional cmd.ParseFlags call as it should already be done by this point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@robpblake was able to drop that, but not the line mentioned in the first comment you made

Copy link
Contributor Author

Choose a reason for hiding this comment

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

doesn't pass tests after removing

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 25, 2024
@hunterkepley hunterkepley force-pushed the ocm-7570 branch 2 times, most recently from bbe2ce5 to 0d51f55 Compare April 25, 2024 14:49
Copy link
Contributor

openshift-ci bot commented Apr 25, 2024

@hunterkepley: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@gdbranco
Copy link
Contributor

/lgtm

@gdbranco
Copy link
Contributor

/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 25, 2024
Copy link
Contributor

openshift-ci bot commented Apr 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gdbranco, hunterkepley

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 25, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit c8e8821 into openshift:master Apr 25, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants