Skip to content

Conversation

@sethking900
Copy link

Description

This Pull Request introduces basic CR validation to take place at operator deployment time, ensuring that CPU and memory request/limits are valid before admitting the operator. This is useful for avoiding scenarios where the operator deployment succeeds but then fails to create CRs due to the invalid memory definitions, thereby potentially becoming a silent failure where a helm release of prometheus-operator succeeds but subsequently fails to create CRs.

Type of change

  • 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

Authored unit tests, tested via company internal CI/CD

Changelog entry

Add CR validation to ensure valid CPU and memory limits/requests at operator deployment time.

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!

)

// ValidateResourceRequirements validates that resource requests do not exceed limits.
func ValidateResourceRequirements(resources v1.ResourceRequirements) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume that you intended to use this for all 3 CRDs?

Copy link
Contributor

Choose a reason for hiding this comment

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

to be removed?

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.

2 participants