-
Notifications
You must be signed in to change notification settings - Fork 38
feat: update hub-agent to use custom cluster affinity plugin in scheduler when property checker is enabled #1221
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // | ||
| //Copyright (c) Microsoft Corporation. | ||
| //Licensed under the MIT license. | ||
|
|
||
| package options | ||
|
|
||
| import ( | ||
| "flag" | ||
| ) | ||
|
|
||
| // AzurePropertyCheckerOptions holds the options for the Azure property checker. | ||
| type AzurePropertyCheckerOptions struct { | ||
| // IsEnabled indicates whether the Azure property checker is enabled. | ||
| IsEnabled bool | ||
| // ComputeServiceAddressWithBasePath is the address of the Azure compute service with base path. | ||
| ComputeServiceAddressWithBasePath string | ||
| } | ||
|
|
||
| // NewAzurePropertyCheckerOptions creates a new AzurePropertyCheckerOptions with default values. | ||
| func NewAzurePropertyCheckerOptions() AzurePropertyCheckerOptions { | ||
| return AzurePropertyCheckerOptions{ | ||
| IsEnabled: false, | ||
| ComputeServiceAddressWithBasePath: "http://localhost:8421/compute", | ||
| } | ||
| } | ||
|
|
||
| // AddFlags adds flags for Azure Property Checker options to the given FlagSet. | ||
| func (o AzurePropertyCheckerOptions) AddFlags(flags *flag.FlagSet) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if we want to make this a pointer. cc @zhiying-lin like RatelimiterOpts: https://github.com/kubefleet-dev/kubefleet/blob/main/cmd/hubagent/options/ratelimit.go#L43
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my bad, we have to use the pointer in this case, otherwise, when we check flags.BoolVar(&o.IsEnabled, "azure-property-checker-enabled", o.IsEnabled, "Enable Azure property checker for validating Azure-specific cluster properties.")
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. btw, here's the doc about receiver type, https://google.github.io/styleguide/go/decisions#receiver-type |
||
| flags.BoolVar(&o.IsEnabled, "azure-property-checker-enabled", o.IsEnabled, "Enable Azure property checker for validating Azure-specific cluster properties.") | ||
| flags.StringVar(&o.ComputeServiceAddressWithBasePath, "azure-compute-server-address", o.ComputeServiceAddressWithBasePath, "The address of the Azure compute service with base path.") | ||
| } | ||
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.
ditto, do we want to return a pointer instead?
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 feel value is better here since the caller needs the value instead of the pointer.