Skip to content

Commit

Permalink
Rename some variables. (#1158)
Browse files Browse the repository at this point in the history
- do not use the cryptic 'mans'
- do not reuse the prereq variable
  • Loading branch information
porridge authored Dec 11, 2019
1 parent 51f759d commit 0108c4b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/kudoctl/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,36 +143,36 @@ func (initCmd *initCmd) run() error {
//define an Encoder to replace YAMLWriter
if strings.ToLower(initCmd.output) == "yaml" {

var mans []string
var manifests []string

crd, err := cmdInit.CRDs().AsYaml()
if err != nil {
return err
}
mans = append(mans, crd...)
manifests = append(manifests, crd...)

if !initCmd.crdOnly {
prereq, err := cmdInit.PrereqManifests(opts)
if err != nil {
return err
}
mans = append(mans, prereq...)
manifests = append(manifests, prereq...)

if len(opts.Webhooks) != 0 { // right now there's only 0 or 1 webhook, so this is good enough
prereq, err := cmdInit.WebhookManifests(opts.Namespace)
webhooks, err := cmdInit.WebhookManifests(opts.Namespace)
if err != nil {
return err
}
mans = append(mans, prereq...)
manifests = append(manifests, webhooks...)
}

deploy, err := cmdInit.ManagerManifests(opts)
if err != nil {
return err
}
mans = append(mans, deploy...)
manifests = append(manifests, deploy...)
}
if err := initCmd.YAMLWriter(initCmd.out, mans); err != nil {
if err := initCmd.YAMLWriter(initCmd.out, manifests); err != nil {
return err
}
}
Expand Down

0 comments on commit 0108c4b

Please sign in to comment.