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

Bug: Fix incorrect deployment annotations #1662

Merged

Conversation

awgreene
Copy link
Member

Problem: When OLM checks that the Operator's Deployment was created with the correct annotations, it will not update and redeploy the operator if the annotations are incorrect.

Cause: This issue was found when creating an Operator in an OperatorGroup that uses a LabelSelector to identify namespaces in the OperatorGroup. When the operator is created, the set of namespaces returned by the LabelSelector may be different from the set of namespaces when checking the deployment annotations.

Solution: OLM should rebuild the deployment with the correct set of annotations.

@awgreene awgreene force-pushed the fix-webhook-e2e-test branch from 3e22364 to 8227874 Compare July 21, 2020 18:33
@awgreene awgreene changed the title Bug: Rebuild deployment with incorrect annotations Bug: Fix incorrect deployment annotations Jul 21, 2020
@exdx
Copy link
Member

exdx commented Jul 21, 2020

So the logic is if the annotation is missing/wrong OLM will update the annotation on the deployment or delete/recreate the deployment with the new annotation. by going into "InstallReady" are we going to just update the diff or actually recreate the deployment?
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2020
@Bowenislandsong
Copy link
Member

This PR failed tests for 1 times with 1 individual failed tests and 4 skipped tests. A test is considered flaky if failed on multiple commits.

totaltestcount: 1
flaketestcount: 1
skippedtestcount: 4
flaketests:

  • classname: End-to-end
    name: 'Operator when a subscription to a package exists should automatically
    adopt components
    '
    counts: 1
    details:
    • count: 1
      error: |4-

      /home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/test/e2e/operator_test.go:218
      Timed out after 60.213s.
      Error: Unexpected non-nil/non-zero extra argument at index 1:
      	<*errors.StatusError>: &errors.StatusError{ErrStatus:v1.Status{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ListMeta:v1.ListMeta{SelfLink:"", ResourceVersion:"", Continue:"", RemainingItemCount:(*int64)(nil)}, Status:"Failure", Message:"etcdserver: request timed out", Reason:"", Details:(*v1.StatusDetails)(nil), Code:500}}
      /home/runner/work/operator-lifecycle-manager/operator-lifecycle-manager/test/e2e/operator_test.go:268
      
    meandurationsec: 61.692282
    skippedtests:
  • classname: End-to-end
    name: 'Catalog image update'
    counts: 1
    details: []
    meandurationsec: 0.217134
  • classname: End-to-end
    name: 'Subscriptions create required objects from Catalogs Given a Namespace
    when a CatalogSource is created with a bundle that contains prometheus objects
    creating a subscription using the CatalogSource should install the operator
    successfully
    '
    counts: 1
    details: []
    meandurationsec: 2.29714
  • classname: End-to-end
    name: 'Subscription updates existing install plan'
    counts: 1
    details: []
    meandurationsec: 0.323676
  • classname: End-to-end
    name: 'Subscriptions create required objects from Catalogs Given a Namespace
    when a CatalogSource is created with a bundle that contains prometheus objects
    creating a subscription using the CatalogSource should have created the expected
    prometheus objects
    '
    counts: 1
    details: []
    meandurationsec: 2.31187

@awgreene
Copy link
Member Author

awgreene commented Jul 21, 2020

@exdx OLM is actually recreating the deployment, and then updates the deployment
.

@ecordell
Copy link
Member

An e2e might be overkill, but is there an existing unit test we can add a case to?

Problem: When OLM checks that the Operator's Deployment was created with the correct annotations, it will not update and redeploy the operator if the annotations are incorrect.

Cause: This issue was found when creating an Operator in an OperatorGroup that uses a LabelSelector to identify namespaces in the OperatorGroup. When the operator is created, the set of namespaces returned by the LabelSelector may be different from the set of namespaces when checking the deployment annotations.

Solution: OLM should rebuild the deployment with the correct set of annotations.
@awgreene awgreene force-pushed the fix-webhook-e2e-test branch from 8227874 to 60ca7c5 Compare July 21, 2020 19:59
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2020
@awgreene
Copy link
Member Author

awgreene commented Jul 21, 2020

@ecordell added a unit test!

Copy link
Member

@ecordell ecordell 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-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: awgreene, ecordell

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-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 21, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

5 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@awgreene
Copy link
Member Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@awgreene
Copy link
Member Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@ecordell
Copy link
Member

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@awgreene
Copy link
Member Author

/retest

@openshift-merge-robot openshift-merge-robot merged commit ffaa9bc into operator-framework:master Jul 23, 2020
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.

7 participants