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

pkg/apis: Add support to specify relabel actions in CamelCase #4873

Merged
merged 1 commit into from
Jun 29, 2022

Conversation

slashpai
Copy link
Contributor

Adds support to specify relabel actions in CamelCase format
to follow https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#constants
and at the same time always downcase the value in the generated config.
Eventually remove the lowercase way of specifying actions once
monitoring.coreos.com/v2 is created

Signed-off-by: Jayapriya Pai slashpai9@gmail.com

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.

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.)

Changelog entry

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

Add support to specify relabel actions in CamelCase

@slashpai slashpai requested a review from a team as a code owner June 28, 2022 19:42
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.

Can you add a test in pkg/prometheus/promcfg.go?

pkg/apis/monitoring/v1/types.go Show resolved Hide resolved
@slashpai slashpai force-pushed the cleanup branch 3 times, most recently from 09435ac to f11f29b Compare June 29, 2022 13:22
@slashpai
Copy link
Contributor Author

@simonpasquier Updated with test

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.

just one more place to "fix" :)

relabeling = append(relabeling, yaml.MapItem{Key: "action", Value: c.Action})

Adds support to specify relabel actions in CamelCase format
to follow https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#constants
and at the same time always downcase the value in the generated config.
Eventually remove the lowercase way of specifying actions once
monitoring.coreos.com/v2 is created

Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
@slashpai
Copy link
Contributor Author

Done

@simonpasquier simonpasquier enabled auto-merge (squash) June 29, 2022 14:31
@simonpasquier simonpasquier merged commit 17618aa into prometheus-operator:main Jun 29, 2022
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.

None yet

2 participants