-
Notifications
You must be signed in to change notification settings - Fork 66
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
✨ ✨ Feature/auto approval registration #470
✨ ✨ Feature/auto approval registration #470
Conversation
77b902b
to
192ab0a
Compare
pkg/cmd/init/exec.go
Outdated
@@ -157,6 +159,32 @@ func (o *Options) validate() error { | |||
} | |||
} | |||
|
|||
featureGates := o.clusterManagerChartConfig.ClusterManager.RegistrationConfiguration.FeatureGates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have a featuregate flag that you can directly identify rather than check the config. You could check genericclioptionsclusteradm.HubMutableFeatureGate directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved.
pkg/cmd/init/exec.go
Outdated
} | ||
} | ||
|
||
if managedClusterAutoApprove { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be in the Validate func.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is part of the Validate Function.
pkg/cmd/init/cmd.go
Outdated
@@ -81,7 +81,7 @@ func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, stream | |||
_ = clusterManagerSet.SetAnnotation("singleton-name", "singletonSet", []string{}) | |||
o.Helm.AddFlags(singletonSet) | |||
cmd.Flags().AddFlagSet(singletonSet) | |||
cmd.Flags().StringArrayVar(&o.registrationAuth, "registration-auth", []string{}, | |||
cmd.Flags().StringSliceVar(&o.registrationAuth, "registration-auth", []string{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
registration-drivers since it is plural
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved.
1a54036
to
35690fc
Compare
2e21916
to
a51da54
Compare
…hitelist for auto approval Signed-off-by: Jeffrey Wong <jeffreywong0417@gmail.com>
a51da54
to
0727737
Compare
pkg/cmd/init/exec.go
Outdated
if !validRegistrationDriver.Has(driver) { | ||
return fmt.Errorf("only csr and awsirsa are valid drivers") | ||
} | ||
} | ||
|
||
featureGates := genericclioptionsclusteradm.ConvertToFeatureGateAPI( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what I meant here is use
if genericclioptionsclusteradm.HubMutableFeatureGate.Enabled("ManagedClusterAutoApproval"):
.....
…oval Signed-off-by: Jeffrey Wong <jeffreywong0417@gmail.com>
40e2991
to
438e8cd
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qiujian16, ramekris3163 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
b50ec8d
into
open-cluster-management-io:main
Summary
Fixes #514