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

Refactoring of plan_status and first unit tests #1091

Merged
merged 4 commits into from
Nov 22, 2019
Merged

Conversation

alenkacz
Copy link
Contributor

What this PR does / why we need it:
This is follow-up of #1050

It stops using dynamicclient in this command and introduces first unit tests for the output.

This PR does not aim to add full test coverage for that command but from that point on, it will be easier to add tests when needed.

Copy link
Member

@kensipe kensipe left a comment

Choose a reason for hiding this comment

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

lgtm

nice work!

Copy link
Contributor

@zen-dog zen-dog left a comment

Choose a reason for hiding this comment

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

Just one nit and 🚢

},
}

statusCmd.Flags().StringVar(&options.Instance, "instance", "", "The instance name available from 'kubectl get instances'")
if err := statusCmd.MarkFlagRequired("instance"); err != nil {
panic(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't panic much. wdyt about:

Suggested change
panic(err)
clog.V(0).Print("failed to makr --instance flag as required: %v", err)
os.Exit(1)

},
}

statusCmd.Flags().StringVar(&options.Instance, "instance", "", "The instance name available from 'kubectl get instances'")
if err := statusCmd.MarkFlagRequired("instance"); err != nil {
clog.Printf("failed to make --instance flag as required: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
clog.Printf("failed to make --instance flag as required: %v", err)
clog.Printf("failed to mark --instance flag as required: %v", err)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you :)

@alenkacz alenkacz merged commit be5c3d8 into master Nov 22, 2019
@alenkacz alenkacz deleted the av/status-tests branch November 22, 2019 11:18
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.

None yet

3 participants