Skip to content

Commit 1e1db3e

Browse files
authored
Add flag enable sync labels to clusteradm init command (#495)
Signed-off-by: Jeffrey Wong <[email protected]>
1 parent e968137 commit 1e1db3e

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

pkg/cmd/init/cmd.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,7 @@ func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, stream
9999
"The users or identities that can be auto approved for CSR and auto accepted to join with hub cluster")
100100
cmd.Flags().StringSliceVar(&o.autoApprovedARNPatterns, "auto-approved-arn-patterns", []string{},
101101
"List of AWS EKS ARN patterns so any EKS clusters with these patterns will be auto accepted to join with hub cluster")
102+
cmd.Flags().BoolVar(&o.enableSyncLabels, "enable-sync-labels", false, "If true, sync the labels from clustermanager to all hub resources.")
103+
102104
return cmd
103105
}

pkg/cmd/init/exec.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ func (o *Options) complete(cmd *cobra.Command, args []string) (err error) {
6464
return err
6565
}
6666

67+
o.clusterManagerChartConfig.EnableSyncLabels = o.enableSyncLabels
68+
6769
if !o.singleton {
6870
o.clusterManagerChartConfig.Images = chart.ImagesConfig{
6971
Registry: o.registry,

pkg/cmd/init/options.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ type Options struct {
6565
autoApprovedARNPatterns []string
6666
// List of tags to be added to AWS resources created by hub while processing awsirsa registration request
6767
awsResourceTags []string
68+
// enableSyncLabels is to enable the feature which can sync the labels from clustermanager to all hub resources.
69+
enableSyncLabels bool
6870
}
6971

7072
func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options {

0 commit comments

Comments
 (0)