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

MULTIARCH-4304: Add validation for the name of the PodPlacementConfig… #72

Conversation

AnnaZivkovic
Copy link
Contributor

… so there can only be one cluster

Unfortunately, make manifests overrides manually adding validation (example here) in multiarch.openshift.io_podplacementconfigs.yaml.

The only issue with using +kubebuilder:validation:XValidation:rule is the error message is not as nicely formatted as shown
Screenshot from 2024-04-11 13-37-40

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 11, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 11, 2024

@AnnaZivkovic: This pull request references MULTIARCH-4304 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to this:

… so there can only be one cluster

Unfortunately, make manifests overrides manually adding validation (example here) in multiarch.openshift.io_podplacementconfigs.yaml.

The only issue with using +kubebuilder:validation:XValidation:rule is the error message is not as nicely formatted as shown
Screenshot from 2024-04-11 13-37-40

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@aleskandro
Copy link
Member

The error doesn't look so bad to me and the solution is quick enough to cover the problem for now.

The alternative is to hack the Makefile target so that the CRD yaml is patched after all the other steps execute: we're needing it in https://github.com/openshift/multiarch-tuning-operator/pull/70/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R291 (as per suggestions in some operator-framework threads internally), but I like that even less.

What's the field the API is considering to be <nil>? Any way we can change it?

@aleskandro
Copy link
Member

@AnnaZivkovic, remember that we also have to remove any previous code that was checking the name in the pod placement config controller.

Also, let's check the integration test cases, patch any that were already verifying the previous work, or add at least one integration/unit test that verifies CR with a wrong name cannot be created

@AnnaZivkovic AnnaZivkovic force-pushed the validate-operands-deletion-from-console branch from 6968310 to f1ec914 Compare April 16, 2024 20:40
@AnnaZivkovic
Copy link
Contributor Author

@aleskandro are you talking about removing the logic here and the stuff below it?

@aleskandro
Copy link
Member

From line 100 in particular. But yes, we could even delete that if statement that you linked as we can assume the name of the object will always be the correct one

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 19, 2024
@AnnaZivkovic AnnaZivkovic force-pushed the validate-operands-deletion-from-console branch 2 times, most recently from 8049645 to 5fa6d5b Compare April 23, 2024 19:57
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 23, 2024
@AnnaZivkovic AnnaZivkovic force-pushed the validate-operands-deletion-from-console branch from 5fa6d5b to 590fb53 Compare April 23, 2024 20:09
@AnnaZivkovic
Copy link
Contributor Author

/retest-required

@AnnaZivkovic AnnaZivkovic force-pushed the validate-operands-deletion-from-console branch 3 times, most recently from 28f24bf to 1ec0d70 Compare April 26, 2024 22:58
@AnnaZivkovic
Copy link
Contributor Author

/retest-required

@AnnaZivkovic AnnaZivkovic force-pushed the validate-operands-deletion-from-console branch from 1ec0d70 to e7a42e9 Compare May 8, 2024 22:36
@AnnaZivkovic
Copy link
Contributor Author

/retest-required

@AnnaZivkovic AnnaZivkovic force-pushed the validate-operands-deletion-from-console branch from e7a42e9 to a7bd992 Compare May 30, 2024 00:22
@AnnaZivkovic
Copy link
Contributor Author

/retest

@AnnaZivkovic
Copy link
Contributor Author

/test vendor

@AnnaZivkovic AnnaZivkovic force-pushed the validate-operands-deletion-from-console branch from a7bd992 to 6990fe2 Compare May 30, 2024 23:20
@AnnaZivkovic AnnaZivkovic force-pushed the validate-operands-deletion-from-console branch 3 times, most recently from 5060a3e to 2cf18b9 Compare June 6, 2024 20:54
Copy link
Member

@aleskandro aleskandro left a comment

Choose a reason for hiding this comment

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

Hey @AnnaZivkovic thanks!

Leaving some comments. In general, it looks good to me. I wonder if we can simplify the kustomize to buffer process by using resMap (see suggestions).

controllers/operator/suite_test.go Outdated Show resolved Hide resolved
controllers/operator/suite_test.go Outdated Show resolved Hide resolved
controllers/operator/suite_test.go Outdated Show resolved Hide resolved
@AnnaZivkovic AnnaZivkovic force-pushed the validate-operands-deletion-from-console branch from 2cf18b9 to 56a6e61 Compare June 7, 2024 21:26
@AnnaZivkovic AnnaZivkovic force-pushed the validate-operands-deletion-from-console branch from 56a6e61 to 20ae98b Compare June 7, 2024 22:16
Copy link

openshift-ci bot commented Jun 8, 2024

@AnnaZivkovic: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@aleskandro
Copy link
Member

/lgtm
/approve

Thanks @AnnaZivkovic

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 8, 2024
Copy link

openshift-ci bot commented Jun 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aleskandro

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 8, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit f634e0a into openshift:main Jun 8, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants