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

feat: skip install on validate-krew-manifest #736

Merged
merged 2 commits into from
Nov 11, 2021
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
18 changes: 11 additions & 7 deletions cmd/validate-krew-manifest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ import (
)

var flManifest string
var flSkipInstall bool

func init() {
flag.StringVar(&flManifest, "manifest", "", "path to plugin manifest file")
flag.BoolVar(&flSkipInstall, "skip-install", false, "skips installing the plugin as part of the validation")
}

func main() {
Expand Down Expand Up @@ -97,15 +99,17 @@ func validateManifestFile(path string) error {
}
klog.Infof("no overlapping spec.platform[].selector")

// exercise "install" for all platforms
for i, p := range p.Spec.Platforms {
klog.Infof("installing spec.platform[%d]", i)
if err := installPlatformSpec(path, p); err != nil {
return errors.Wrapf(err, "spec.platforms[%d] failed to install", i)
if !flSkipInstall {
// exercise "install" for all platforms
for i, p := range p.Spec.Platforms {
klog.Infof("installing spec.platform[%d]", i)
if err := installPlatformSpec(path, p); err != nil {
return errors.Wrapf(err, "spec.platforms[%d] failed to install", i)
}
klog.Infof("installed spec.platforms[%d]", i)
}
klog.Infof("installed spec.platforms[%d]", i)
log.Printf("all %d spec.platforms installed fine", len(p.Spec.Platforms))
}
log.Printf("all %d spec.platforms installed fine", len(p.Spec.Platforms))
return nil
}

Expand Down