Skip to content

Conversation

@shuheiktgw
Copy link
Contributor

Description:
This PR is part of the migration from webhook-based validation to CEL. As a first step, I removed the duplicate validations from the webhook. Thank you for reviewing!

Link to tracking Issue(s):

Testing:

Documentation:

@shuheiktgw shuheiktgw requested a review from a team as a code owner November 2, 2025 15:07
return warnings, fmt.Errorf("the OpenTelemetry Spec Ingress configuiration is incorrect. Ingress can only be used in combination with the modes: %s, %s, %s",
ModeDeployment, ModeDaemonSet, ModeStatefulSet,
)
}
Copy link
Contributor Author

@shuheiktgw shuheiktgw Nov 2, 2025

Choose a reason for hiding this comment

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

This was simply duplicated with the validation just above.

@swiatekm
Copy link
Contributor

swiatekm commented Nov 2, 2025

Note that we have E2E tests checking both options - the CRD and the webhook - here. These were originally done as E2E tests because we were already running them for the oldest and latest K8s version we support. I think using envtest for this is more ergonomic, though. So how about:

  • We delete the e2e tests.
  • In a follow-up, we run unit tests with envtest 1.25 in addition to what we do right now.

WDYT @open-telemetry/operator-approvers ?

@shuheiktgw
Copy link
Contributor Author

Thank you so much for the feedback! I’ve updated the Makefile so that we can run the unit tests with the minimum supported version in CI and removed the e2e tests. Please let me know what you think 🙏

expectedErr: fmt.Sprintf("Ingress can only be used in combination with the modes: %s, %s, %s", v1beta1.ModeDeployment, v1beta1.ModeDaemonSet, v1beta1.ModeStatefulSet),
},
{
name: "invalid mode with priorityClassName",
Copy link
Member

Choose a reason for hiding this comment

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

Are we removing these tests because we are not longer able to test the CEL expressions?

Copy link
Contributor Author

@shuheiktgw shuheiktgw Nov 6, 2025

Choose a reason for hiding this comment

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

They’re now being tested in TestValidationViaCRDAnnotations using envtest 🙂

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.

3 participants