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

WINC-818: [test] Fix upgradeable condition test #1283

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

mansikulkarni96
Copy link
Member

@mansikulkarni96 mansikulkarni96 commented Oct 19, 2022

This PR fixes an issue where the upgradeable condition was not being tested in the e2e test suite. This was the case because the OPERATOR_CONDITION_NAME env var is not being set in the CI env when using the OLM upgrade workflow. The recommendation to fix this was to instead get it from the deployment spec as the condition is present once the operator is deployed. The cache client also had to be replaced with the OLM client to get the operator condition using current context.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 19, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 19, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@mansikulkarni96
Copy link
Member Author

/test aws-e2e-upgrade

@mansikulkarni96
Copy link
Member Author

/test aws-e2e-upgrade
cluster install failed

@mansikulkarni96
Copy link
Member Author

/test aws-e2e-upgrade

1 similar comment
@mansikulkarni96
Copy link
Member Author

/test aws-e2e-upgrade

@mansikulkarni96
Copy link
Member Author

/test aws-e2e-upgrade

@mansikulkarni96 mansikulkarni96 changed the title test PR WINC-818: [test] Fix upgradeable condition test Nov 1, 2022
@mansikulkarni96
Copy link
Member Author

/test aws-e2e-upgrade

@mansikulkarni96
Copy link
Member Author

/test aws-e2e-upgrade

@mansikulkarni96
Copy link
Member Author

/cherry-pick release-4.12

@openshift-cherrypick-robot

@mansikulkarni96: once the present PR merges, I will cherry-pick it on top of release-4.12 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.12

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.

@mansikulkarni96
Copy link
Member Author

/test aws-e2e-upgrade

1 similar comment
@mansikulkarni96
Copy link
Member Author

/test aws-e2e-upgrade

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 2, 2022
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 2, 2022
return err
}
// Get the operator condition name using the deployment spec
ocName := deployment.Spec.Template.Spec.Containers[0].Env[3].Value
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it safe to get these values by index? Will the operator condition name always be in the third position?

Copy link
Member Author

Choose a reason for hiding this comment

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

that has been my observation but I think it will be safer to loop through and find the env var by key, will update.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also the Container[0] -- is it worth looping over containers and filtering for the the desired one by name?

return err
}
// Get the operator condition name using the deployment spec
ocName := deployment.Spec.Template.Spec.Containers[0].Env[3].Value
Copy link
Contributor

Choose a reason for hiding this comment

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

Also the Container[0] -- is it worth looping over containers and filtering for the the desired one by name?

specCheck := condition.Validate(oc.Spec.Conditions, operators.Upgradeable, expected)
statusCheck := condition.Validate(oc.Status.Conditions, operators.Upgradeable, expected)
return specCheck && statusCheck, nil
return condition.Validate(oc.Status.Conditions, operators.Upgradeable, expected), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason to move to away from checking both spec and status? I felt that checking both was important since the upgradeable condition changes so often, we should ensure it has settled at the expected state (i.e. spec == status == expected).

Copy link
Member Author

Choose a reason for hiding this comment

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

good point, I was thinking why it wasn't available in the object. I realised I was using the v1 client, switched to v2 now and I see conditions in spec now. Updating this as well.

@openshift-cherrypick-robot

@mansikulkarni96: once the present PR merges, I will cherry-pick it on top of release-4.10 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.10

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.

@mansikulkarni96
Copy link
Member Author

/retest-required

1 similar comment
@mansikulkarni96
Copy link
Member Author

/retest-required

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2022
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2022
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2022
go get github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned
go mod tidy && go mod vendor
This commit fixes an issue where the upgradeable condition was
not being tested in the e2e test suite. This was the case
because the OPERATOR_CONDITION_NAME env var is not being set in
the CI env when using the OLM upgrade workflow. The recommendation
to fix this was to instead get it from the deployment spec as the
condition is present once the operator is deployed. The cache
client had to be replaced with the OLM client to get the operator
condition using current context.
@mansikulkarni96
Copy link
Member Author

/retest-required

Copy link
Contributor

@saifshaikh48 saifshaikh48 left a comment

Choose a reason for hiding this comment

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

/lgtm

I think it's worth noting that a side effect of this PR is that the e2e suite will fail if the operator is not deployed through OLM (this shouldn't affect end users though).

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2022
@mansikulkarni96
Copy link
Member Author

I think it's worth noting that a side effect of this PR is that the e2e suite will fail if the operator is not deployed through OLM (this shouldn't affect end users though).

I would like to clarify though the test modified through this PR is testable when running the test suite locally as well as CI through the hack script.

@mtnbikenc
Copy link
Member

/retest required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 7, 2022

@mtnbikenc: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test aws-e2e-ccm-install
  • /test aws-e2e-operator
  • /test aws-e2e-upgrade
  • /test azure-e2e-operator
  • /test build
  • /test ci-index
  • /test gcp-e2e-operator
  • /test images
  • /test lint
  • /test platform-none-vsphere-e2e-operator
  • /test unit
  • /test vsphere-e2e-operator
  • /test wicd-unit-vsphere

The following commands are available to trigger optional jobs:

  • /test azure-e2e-ccm-install
  • /test vsphere-e2e-ccm-install

Use /test all to run the following jobs that were automatically triggered:

  • pull-ci-openshift-windows-machine-config-operator-master-aws-e2e-ccm-install
  • pull-ci-openshift-windows-machine-config-operator-master-aws-e2e-operator
  • pull-ci-openshift-windows-machine-config-operator-master-aws-e2e-upgrade
  • pull-ci-openshift-windows-machine-config-operator-master-azure-e2e-operator
  • pull-ci-openshift-windows-machine-config-operator-master-build
  • pull-ci-openshift-windows-machine-config-operator-master-ci-index
  • pull-ci-openshift-windows-machine-config-operator-master-gcp-e2e-operator
  • pull-ci-openshift-windows-machine-config-operator-master-images
  • pull-ci-openshift-windows-machine-config-operator-master-lint
  • pull-ci-openshift-windows-machine-config-operator-master-platform-none-vsphere-e2e-operator
  • pull-ci-openshift-windows-machine-config-operator-master-unit
  • pull-ci-openshift-windows-machine-config-operator-master-vsphere-e2e-operator
  • pull-ci-openshift-windows-machine-config-operator-master-wicd-unit-vsphere

In response to this:

/retest required

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.

@mtnbikenc
Copy link
Member

/retest-required

1 similar comment
@mtnbikenc
Copy link
Member

/retest-required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 8, 2022

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

@openshift-merge-robot openshift-merge-robot merged commit feaa3c3 into openshift:master Nov 8, 2022
@openshift-cherrypick-robot

@mansikulkarni96: #1283 failed to apply on top of branch "release-4.11":

Applying: Vendor dependencies for OLM clientset
.git/rebase-apply/patch:10320: trailing whitespace.
limited by the interface). 
.git/rebase-apply/patch:10410: trailing whitespace.
environment via benchmarks: 
.git/rebase-apply/patch:522: new blank line at EOF.
+
warning: 3 lines add whitespace errors.
Using index info to reconstruct a base tree...
M	go.mod
M	go.sum
M	vendor/modules.txt
Falling back to patching base and 3-way merge...
Auto-merging vendor/modules.txt
CONFLICT (content): Merge conflict in vendor/modules.txt
Auto-merging go.sum
CONFLICT (content): Merge conflict in go.sum
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Vendor dependencies for OLM clientset
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.11

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-cherrypick-robot

@mansikulkarni96: #1283 failed to apply on top of branch "release-4.10":

Applying: Vendor dependencies for OLM clientset
.git/rebase-apply/patch:10320: trailing whitespace.
limited by the interface). 
.git/rebase-apply/patch:10410: trailing whitespace.
environment via benchmarks: 
.git/rebase-apply/patch:522: new blank line at EOF.
+
warning: 3 lines add whitespace errors.
Using index info to reconstruct a base tree...
M	go.mod
M	go.sum
M	vendor/modules.txt
Falling back to patching base and 3-way merge...
Auto-merging vendor/modules.txt
CONFLICT (content): Merge conflict in vendor/modules.txt
Auto-merging go.sum
CONFLICT (content): Merge conflict in go.sum
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Vendor dependencies for OLM clientset
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.10

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-cherrypick-robot

@mansikulkarni96: new pull request created: #1317

In response to this:

/cherry-pick release-4.12

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.

@saifshaikh48
Copy link
Contributor

@mansikulkarni96 should this be backported to 4.9 as well (since #618 is also in 4.9)?

@mansikulkarni96
Copy link
Member Author

@mansikulkarni96 should this be backported to 4.9 as well (since #618 is also in 4.9)?

yes it should looking into the failed backports as well.

@mansikulkarni96
Copy link
Member Author

/cherry-pick relase-4.11

@openshift-cherrypick-robot

@mansikulkarni96: cannot checkout relase-4.11: error checking out relase-4.11: exit status 1. output: error: pathspec 'relase-4.11' did not match any file(s) known to git

In response to this:

/cherry-pick relase-4.11

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-cherrypick-robot

@mansikulkarni96: #1283 failed to apply on top of branch "release-4.11":

Applying: Vendor dependencies for OLM clientset
.git/rebase-apply/patch:10320: trailing whitespace.
limited by the interface). 
.git/rebase-apply/patch:10410: trailing whitespace.
environment via benchmarks: 
.git/rebase-apply/patch:522: new blank line at EOF.
+
warning: 3 lines add whitespace errors.
Using index info to reconstruct a base tree...
M	go.mod
M	go.sum
M	vendor/modules.txt
Falling back to patching base and 3-way merge...
Auto-merging vendor/modules.txt
CONFLICT (content): Merge conflict in vendor/modules.txt
Auto-merging go.sum
CONFLICT (content): Merge conflict in go.sum
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Vendor dependencies for OLM clientset
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.11
not seeing issue backporting locally.

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. 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

8 participants