10BC0 feat: Add support the `loadbalancer` role in OpenStackSDConfig by dongjiang1989 · Pull Request #7356 · prometheus-operator/prometheus-operator · GitHub
[go: up one dir, main page]

Skip to content

Conversation

dongjiang1989
Copy link
Member

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.

Add support the loadbalancer role in OpenStackSDConfig

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.

Add support the `loadbalancer` role in OpenStackSDConfig

Signed-off-by: dongjiang <dongjiang1989@126.com>
@dongjiang1989 dongjiang1989 marked this pull request as ready for review February 19, 2025 04:31
@dongjiang1989 dongjiang1989 requested a review from a team as a code owner February 19, 2025 04:31
@slashpai
Copy link
Contributor

Lets add e2e test as well https://github.com/prometheus-operator/prometheus-operator/blob/main/test/e2e/scrapeconfig_test.go#L2679 as we have been doing refactoring ScrapeConfig CRD
See #7209

@AshwinSriram11
Copy link
Member

It would be good to add e2e test for "Valid loadbalancer Role" in e2e/scrapeconfig_test.go

Signed-off-by: dongjiang <dongjiang1989@126.com>
@dongjiang1989
Copy link
Member Author

Lets add e2e test as well https://github.com/prometheus-operator/prometheus-operator/blob/main/test/e2e/scrapeconfig_test.go#L2679 as we have been doing refactoring ScrapeConfig CRD See #7209

Thanks @slashpai
Added e2e case done.

//
// Note: The `loadbalancer` or `Loadbalancer` role requires Prometheus >= v3.2.0.
//
// +kubebuilder:validation:Enum=Instance;instance;Hypervisor;hypervisor;Loadbalancer;loadbalancer
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit)

Suggested change
// +kubebuilder:validation:Enum=Instance;instance;Hypervisor;hypervisor;Loadbalancer;loadbalancer
// +kubebuilder:validation:Enum=Instance;Hypervisor;Loadbalancer

Copy link
Contributor

Choose a reason for hiding this comment

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

(suggestion) It might make sense here to define a OpenStackRole type. Something like:

// +kubebuilder:validation:Enum=Instance;Hypervisor;Loadbalancer
type OpenStackRole string

const (
	OpenStackRoleInstance     OpenStackRole = "Instance"
	OpenStackRoleHypervisor   OpenStackRole = "Hypervisor"
	OpenStackRoleLoadBalancer OpenStackRole = "LoadBalancer"
)

We will also need to update the rest of the code base to use these constants.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm.... 🤔 Removing a historically supported field is a breaking change

Copy link
Contributor

Choose a reason for hiding this comment

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

we're ok breaking the API here because it's v1alpha1. In fact we plan on making all breaking changes before v1beta1. I would only advise to remove the lower-case enums in a separate PR. For this PR, I'd add only LoadBalancer.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @simonpasquier @mviswanathsai
Add only LoadBalancer in this PR.
Will remove the lower-case enums in next PR.

@mviswanathsai
Copy link
Contributor

Why are the AM Config Reloader tests failing?

Co-authored-by: M Viswanath Sai <110663831+mviswanathsai@users.noreply.github.com>
@dongjiang1989
Copy link
Member Author

Why are the AM Config Reloader tests failing?

Maybe other problem

dongjiang1989 and others added 2 commits February 22, 2025 10:46
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: dongjiang <dongjiang1989@126.com>
@pull-request-size pull-request-size bot added size/L and removed size/M labels Feb 24, 2025
Signed-off-by: dongjiang <dongjiang1989@126.com>
Copy link
Contributor
@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

thanks!

@simonpasquier simonpasquier merged commit 35f6d05 into prometheus-operator:main Feb 27, 2025
23 checks passed
@dongjiang1989 dongjiang1989 deleted the support-openstacksd-loadbalancer branch February 28, 2025 05:38
hoperays pushed a commit to hoperays/prometheus-operator that referenced this pull request Sep 10, 2025
…theus-operator#7356)

---------

Signed-off-by: dongjiang <dongjiang1989@126.com>
Co-authored-by: M Viswanath Sai <110663831+mviswanathsai@users.noreply.github.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0