Skip to content
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

chore: Refactor OpenStackSDConfig #7244

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nutmos
Copy link
Contributor

@nutmos nutmos commented Dec 28, 2024

Description

Refactor 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

1. Add the validation in the type.
2. Add the test cases for type verification.

Fixes #7209

@mviswanathsai
Copy link
Contributor

Hey! thanks for the contribution.
On top of this, you would also need to add e2e test cases and version checks wherever applicable. You can ping me if you need any help with that!

@nutmos nutmos marked this pull request as ready for review December 29, 2024 10:29
@nutmos nutmos requested a review from a team as a code owner December 29, 2024 10:29
@nutmos
Copy link
Contributor Author

nutmos commented Dec 29, 2024

@mviswanathsai Hi, I completed all of the requirements already. Please review.

@nutmos
Copy link
Contributor Author

nutmos commented Jan 22, 2025

@mviswanathsai Hi, do you have any chance to take a look at my PR?

Copy link
Contributor

@slashpai slashpai left a comment

Choose a reason for hiding this comment

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

For string fields we need to add the minlength validation

// +kubebuilder:validation:MinLength:=1

@@ -802,6 +803,8 @@ type OpenStackSDConfig struct {
RefreshInterval *v1.Duration `json:"refreshInterval,omitempty"`
// The port to scrape metrics from. If using the public IP address, this must
// instead be specified in the relabeling rule.
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=65535
// +optional
Port *int `json:"port"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Port *int `json:"port"`
Port *int32 `json:"port,omitempty"`

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.

Refactor OpenStackSDConfig
3 participants