connected allowresourcesidchanges bool to allow_id_changes flag

This commit is contained in:
Natasha Sarkar
2020-12-02 18:03:09 -08:00
parent deb2b21cbe
commit 724bbe9452
2 changed files with 25 additions and 0 deletions

View File

@@ -99,6 +99,7 @@ func NewCmdBuild(out io.Writer) *cobra.Command {
addFlagReorderOutput(cmd.Flags())
addFlagEnableManagedbyLabel(cmd.Flags())
addFlagEnableKyaml(cmd.Flags())
addFlagAllowResourceIdChanges(cmd.Flags())
return cmd
}
@@ -137,6 +138,7 @@ func (o *Options) makeOptions() *krusty.Options {
}
opts.AddManagedbyLabel = isManagedbyLabelEnabled()
opts.UseKyaml = flagEnableKyamlValue
opts.AllowResourceIdChanges = flagAllowResourceIdChangesValue
return opts
}

View File

@@ -0,0 +1,23 @@
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package build
import (
"github.com/spf13/pflag"
)
const (
flagAllowResourceIdChangesName = "allow_id_changes"
flagAllowResourceIdChangesHelp = `enable changes to a resourceId`
)
var (
flagAllowResourceIdChangesValue = false
)
func addFlagAllowResourceIdChanges(set *pflag.FlagSet) {
set.BoolVar(
&flagAllowResourceIdChangesValue, flagAllowResourceIdChangesName,
false, flagAllowResourceIdChangesHelp)
}