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

Cleanup logic for skipping essential plugins #704

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

marckhouzam
Copy link
Contributor

What this PR does / why we need it

This is a small cleanup PR which removes some code duplication and fixes some invalid comments.
There is no functionality change.

Which issue(s) this PR fixes

Fixes # N/A

Describe testing done for PR

Let CI run

Release note

Cleanup essential plugins installation logic

Additional information

Special notes for your reviewer

Signed-off-by: Marc Khouzam <marc.khouzam@broadcom.com>
@marckhouzam marckhouzam requested a review from a team as a code owner March 15, 2024 14:28
@marckhouzam marckhouzam requested review from anujc25 and mpanchajanya and removed request for anujc25 and mpanchajanya March 15, 2024 14:29
Copy link
Contributor

@anujc25 anujc25 left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@mpanchajanya mpanchajanya left a comment

Choose a reason for hiding this comment

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

lgmt. Thanks for the changes


// Prompt for CEIP agreement
if !shouldSkipPrompts(cmd) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Join the two identical ifs

if err := cliconfig.ConfigureCEIPOptIn(); err != nil {
return err
}
}

// Install or update essential plugins
InstallEssentialPlugins(cmd)
if !shouldSkipEssentialPlugins(cmd) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Follow the same pattern as the checks above.

"tanzu plugin clean",
// Avoid trying to install essential plugins when the user initializes or updates the plugin
// source information since the essential plugins installation would use the old plugin source
"tanzu plugin source",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No change in the list of commands, just fixed the comments and used isSkipCommand() below instead of having code duplication.

@marckhouzam marckhouzam merged commit 1690814 into vmware-tanzu:main Mar 16, 2024
8 checks passed
@marckhouzam marckhouzam deleted the cleanup/essentials branch March 16, 2024 11:38
@marckhouzam marckhouzam added this to the v1.3.0 milestone Mar 16, 2024
vuil pushed a commit to vuil/tanzu-cli that referenced this pull request Mar 28, 2024
Signed-off-by: Marc Khouzam <marc.khouzam@broadcom.com>
vuil pushed a commit that referenced this pull request Mar 28, 2024
Signed-off-by: Marc Khouzam <marc.khouzam@broadcom.com>
@marckhouzam marckhouzam added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-not-required kind/cleanup Categorizes issue or PR as related to cleaning up code, process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants