Skip to content

fix: label selector on sample #1231

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

Merged
merged 2 commits into from
May 24, 2022
Merged

fix: label selector on sample #1231

merged 2 commits into from
May 24, 2022

Conversation

csviri
Copy link
Collaborator

@csviri csviri commented May 23, 2022

No description provided.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@csviri csviri requested a review from metacosm May 23, 2022 13:19
@juangon
Copy link

juangon commented May 23, 2022

I have a question about this PR and labels: why does WebPageDependentReconciler has a DEPENDENT_RESOURCE_LABEL_SELECTOR which isn't used anywhere? Shouldn't be the same as WebPageManagedDependentsReconciler.SELECTOR?

@csviri
Copy link
Collaborator Author

csviri commented May 24, 2022

I have a question about this PR and labels: why does WebPageDependentReconciler has a DEPENDENT_RESOURCE_LABEL_SELECTOR which isn't used anywhere? Shouldn't be the same as WebPageManagedDependentsReconciler.SELECTOR?

Hi this was because of demo purposes,
see comment here: https://github.com/java-operator-sdk/java-operator-sdk/blob/5afdecd3a00b2a5d1c0e6170f4c942bda3126dc8/sample-operators/webpage/k8s/webpage.yaml#L4-L4

TBH it would be better to remove it, you are right, so there is no confusion around it.
thx!

@@ -85,7 +87,7 @@ private void createDependentResources(KubernetesClient client) {
Arrays.asList(configMapDR, deploymentDR, serviceDR, ingressDR).forEach(dr -> {
dr.setKubernetesClient(client);
dr.configureWith(new KubernetesDependentResourceConfig()
.setLabelSelector(DEPENDENT_RESOURCE_LABEL_SELECTOR));
.setLabelSelector(SELECTOR + "=true"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why was the tests working if the selector was wrong?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

since those were not mutal exclusive, the other selector is about not having a label what was true.

@csviri csviri merged commit 8e5e1fa into main May 24, 2022
@csviri csviri deleted the labels-selector-fix branch May 24, 2022 13:24
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