mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-01 02:11:20 +00:00
connected allowresourcesidchanges bool to allow_id_changes flag
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user