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

OCPBUGS-15440: fix CMO to apply console-plugin pod.spec config #2018

Merged

Conversation

sthaha
Copy link
Contributor

@sthaha sthaha commented Jun 27, 2023

The console-plugin's deployment configs that need to applied to the deployment.spec.template.spec weren't getting applied because the changes were made to the copy of the object instead of the original object itself. The tests didn't catch the issue because the pod assertions didn't validate if any pods were found for the combination of namespace and label-selector

This commit fixes both by refering (pointer) to the original spec instead of the copy and by fixing the assertions fail if it fails to find any pods.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 27, 2023
@openshift-ci-robot
Copy link
Contributor

@sthaha: This pull request references Jira Issue OCPBUGS-15440, which is invalid:

  • expected the bug to target the "4.14.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

The console-plugin's deployment configs that need to applied to the deployment.spec.template.spec weren't getting applied because the changes were made to the copy of the object instead of the original object itself. The tests didn't catch the issue because the pod assertions didn't validate if any pods were found for the combination of namespace and label-selector

This commit fixes both by refering (pointer) to the original spec instead of the copy and by fixing the assertions fail if it fails to find any pods.

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/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jun 27, 2023
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 27, 2023
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.

/lgtm

note for a follow-up: we can also add a unit test in the manifests package for testing all CMO options related to the monitoring console plugin.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 27, 2023
@jan--f
Copy link
Contributor

jan--f commented Jun 27, 2023

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jun 27, 2023
@openshift-ci-robot
Copy link
Contributor

@jan--f: This pull request references Jira Issue OCPBUGS-15440, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.14.0) matches configured target version for branch (4.14.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @Tai-RedHat

In response to this:

/jira refresh

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/test-infra repository.

@openshift-ci openshift-ci bot requested a review from Tai-RedHat June 27, 2023 08:07
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 8d67591 and 2 for PR HEAD edf0ecd in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 7fb0c8f and 1 for PR HEAD edf0ecd in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 2bb7887 and 0 for PR HEAD edf0ecd in total

@openshift-ci-robot
Copy link
Contributor

/hold

Revision edf0ecd was retested 3 times: holding

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 27, 2023
@sthaha
Copy link
Contributor Author

sthaha commented Jun 28, 2023

/retest-required

The console-plugin's deployment configs that need to applied to the
deployment.spec.template.spec weren't getting applied because the
changes were made to the copy of the object instead of the original
object itself. The tests didn't catch the issue because the pod assertions
didn't validate if any pods were found for the combination of namespace
and label-selector

This commit fixes both by refering (pointer) to the original spec
instead of the copy and by fixing the assertions fail if it fails to
find any pods.

Signed-off-by: Sunil Thaha <sthaha@redhat.com>
@sthaha sthaha force-pushed the fix-mon-plugin-config-apply branch from edf0ecd to 959a0ce Compare June 28, 2023 05:30
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 28, 2023
@sthaha
Copy link
Contributor Author

sthaha commented Jun 28, 2023

@simonpasquier @jan--f I have removed the assertion that I added that to AssertPodConfiguration to check that at least one pod matches the selector passed.

			if len(pods.Items) == 0 {
				return fmt.Errorf("%w - failed to find Pods in %s matching %s", err, namespace, labelSelector)
			}

due to the following unrelated test failures which may be another bug to fix

=== RUN   TestClusterMonitorOSMConfig/assert_pod_configuration_is_as_expected
    assertions.go:347: timed out waiting for the condition: %!w(<nil>) - failed to find Pods in openshift-monitoring matching k8s-app=openshift-state-metrics
--- FAIL: TestClusterMonitorOSMConfig (307.04s)

    --- PASS: TestClusterMonitorTelemeterClientConfig/test_the_telemeter-client_deployment_is_rolled_out (6.02s)
    --- FAIL: TestClusterMonitorTelemeterClientConfig/assert_pod_configuration_is_as_expected (300.01s)

=== RUN   TestClusterMonitorTelemeterClientConfig/assert_pod_configuration_is_as_expected
    assertions.go:347: timed out waiting for the condition: %!w(<nil>) - failed to find Pods in openshift-monitoring matching app.kubernetes.io/component=dashboard

@sthaha
Copy link
Contributor Author

sthaha commented Jun 28, 2023

Just a note - for osm below are the labels set on an aws 4.14 cluster

app.kubernetes.io/component=exporter
app.kubernetes.io/managed-by=cluster-monitoring-operator
app.kubernetes.io/name=openshift-state-metrics
app.kubernetes.io/part-of=openshift-monitoring
pod-template-hash=6d87776c5f

@sthaha
Copy link
Contributor Author

sthaha commented Jun 28, 2023

/retest-required

@sthaha
Copy link
Contributor Author

sthaha commented Jun 29, 2023

#2028 should fix the issues found while testing this PR.

@sthaha
Copy link
Contributor Author

sthaha commented Jun 29, 2023

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 29, 2023
Copy link
Contributor

@marioferh marioferh left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 29, 2023
@jan--f
Copy link
Contributor

jan--f commented Jun 29, 2023

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 29, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jan--f, marioferh, simonpasquier, sthaha

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:
  • OWNERS [jan--f,marioferh,simonpasquier,sthaha]

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

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 237cf9a and 2 for PR HEAD 959a0ce in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 29, 2023

@sthaha: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-single-node 959a0ce link false /test e2e-aws-ovn-single-node
ci/prow/versions 959a0ce link false /test versions

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/test-infra repository. I understand the commands that are listed here.

@simonpasquier
Copy link
Contributor

/skip
/retest-required

@openshift-merge-robot openshift-merge-robot merged commit e0e6a25 into openshift:master Jun 29, 2023
16 checks passed
@openshift-ci-robot
Copy link
Contributor

@sthaha: Jira Issue OCPBUGS-15440: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-15440 has been moved to the MODIFIED state.

In response to this:

The console-plugin's deployment configs that need to applied to the deployment.spec.template.spec weren't getting applied because the changes were made to the copy of the object instead of the original object itself. The tests didn't catch the issue because the pod assertions didn't validate if any pods were found for the combination of namespace and label-selector

This commit fixes both by refering (pointer) to the original spec instead of the copy and by fixing the assertions fail if it fails to find any pods.

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/test-infra repository.

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-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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

6 participants