Skip to content

Conversation

@britaniar
Copy link
Contributor

@britaniar britaniar commented Nov 5, 2025

Description of your changes

I have:

  • Hub agent reads in a Boolean to enable property checker functionalities and passes the compute service endpoint base url.

  • Use newly added options to create scheduler with a custom cluster affinity plugin to use property checker.

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

  • Tested in Standalone
    Logs from hub agent used for testing:
I1106 19:15:29.423534       1 workload/setup.go:389] Setting up scheduler
I1106 19:15:29.423560       1 workload/setup.go:392] Azure property checker is enabled for cluster property validation
I1106 19:15:29.423626       1 workload/setup.go:408] Starting the scheduler

Special notes for your reviewer

There are some copied files from previous PR so that the setup could work.

@britaniar britaniar marked this pull request as ready for review November 5, 2025 23:46
@britaniar britaniar force-pushed the addPropertyChecker branch 2 times, most recently from 6f94158 to 0dcc8a8 Compare November 20, 2025 22:34
@britaniar britaniar requested a review from jwtty November 20, 2025 23:43
Copy link
Contributor

@zhiying-lin zhiying-lin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please update the PR descriptions and title to reflect the latest changes?

@britaniar britaniar changed the title feat: add deployment changes to include property checker feat: update hub-agent to use custom cluster affinity plugin in scheduler when property checker is enabled Nov 21, 2025
@britaniar britaniar force-pushed the addPropertyChecker branch 3 times, most recently from 992ddbf to 9438540 Compare November 24, 2025 16:42
Signed-off-by: Britania Rodriguez Reyes <britaniar@microsoft.com>
}

// AddFlags adds flags for Azure Property Checker options to the given FlagSet.
func (o AzurePropertyCheckerOptions) AddFlags(flags *flag.FlagSet) {
Copy link
Contributor

@jwtty jwtty Nov 24, 2025

Choose a reason for hiding this comment

The 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

Copy link
Contributor

@zhiying-lin zhiying-lin Nov 25, 2025

Choose a reason for hiding this comment

The 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 if opts.AzurePropertyCheckerOpts.IsEnabled {, it's using original value, as the flag is using the copy of the option.

flags.BoolVar(&o.IsEnabled, "azure-property-checker-enabled", o.IsEnabled, "Enable Azure property checker for validating Azure-specific cluster properties.")

Copy link
Contributor

Choose a reason for hiding this comment

The 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

}

// NewAzurePropertyCheckerOptions creates a new AzurePropertyCheckerOptions with default values.
func NewAzurePropertyCheckerOptions() AzurePropertyCheckerOptions {
Copy link
Contributor

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?

Copy link
Contributor

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.

@britaniar britaniar merged commit 66704a2 into Azure:main Nov 24, 2025
16 of 18 checks passed
@britaniar britaniar deleted the addPropertyChecker branch November 24, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants