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 1744984: Add e2e test for kube controller manager lease configmap deletion #311

Merged
merged 2 commits into from Dec 9, 2019

Conversation

damemi
Copy link

@damemi damemi commented Nov 12, 2019

This is a work in progress, trying to create a simple e2e that deletes the KCM configmap then attempts to create a replicaset to see if KCM recovered from the deletion, as described here: https://bugzilla.redhat.com/show_bug.cgi?id=1744984

@openshift-ci-robot
Copy link

@damemi: This pull request references Bugzilla bug 1744984, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Bug 1744984: Add e2e test for kube controller manager lease configmap deletion

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 bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 12, 2019
@damemi
Copy link
Author

damemi commented Nov 13, 2019

/retest

_, err = kubeClient.AppsV1().ReplicaSets(operatorclient.OperatorNamespace).Create(replicaSet)
if err != nil {
t.Fatal(err)
}
Copy link
Member

Choose a reason for hiding this comment

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

You're missing a bit where you wait and verify if that replica set actually run and KCM recovered.

Copy link
Author

Choose a reason for hiding this comment

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

Updated to add a wait loop that looks for pods created with the replicaset labels, that would indicate the KCM has recovered right?

@damemi damemi force-pushed the kcm-recovery-test branch 2 times, most recently from 9cd6ba9 to 1016466 Compare November 13, 2019 18:37
}
}

// Now try to create a replicaset and see that it is successfully created by the controller manager
Copy link
Contributor

Choose a reason for hiding this comment

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

wait for the original pods to be gone before creating this.

}

// Get all the currently running KCM pods, and then delete them
pods, err := kubeClient.CoreV1().Pods("openshift-kube-controller-manager").List(metav1.ListOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

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

this is pointless

},
},
}
_, err = kubeClient.AppsV1().ReplicaSets(operatorclient.OperatorNamespace).Create(replicaSet)
Copy link
Contributor

Choose a reason for hiding this comment

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

because the pods aren't gone, this doesn't matter

test/e2e/operator_test.go Outdated Show resolved Hide resolved
@damemi damemi force-pushed the kcm-recovery-test branch 3 times, most recently from ef569c6 to 64c65ca Compare November 26, 2019 20:14
}

// Check to see that the configmap then gets recreated
wait.Poll(time.Second*5, time.Second*300, func() (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you forgot to check this error.

// Check to see that the configmap then gets recreated
wait.Poll(time.Second*5, time.Second*300, func() (bool, error) {
_, err := kubeClient.CoreV1().ConfigMaps("kube-system").Get("kube-controller-manager", metav1.GetOptions{})
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

if errors.IsNotFound(err){
    return false, nil
}
if err != nil{
    return false, err
}
return true, nil

@deads2k
Copy link
Contributor

deads2k commented Dec 2, 2019

/lgtm

@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 Dec 2, 2019
@openshift-bot
Copy link
Contributor

/retest

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

4 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-ci-robot openshift-ci-robot added bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. and removed bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Dec 5, 2019
@openshift-ci-robot
Copy link

@damemi: This pull request references Bugzilla bug 1744984, which is invalid:

  • expected the bug to target the "4.4.0" release, but it targets "4.3.0" instead

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

In response to this:

Ok, switching to 2 namespaced Roles (as opposed to 1 ClusterRole) seems to fix the problem, and all tests pass. Squashing now and this is ready for final review
cc @soltysh @deads2k
/bugzilla 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.

@damemi
Copy link
Author

damemi commented Dec 6, 2019

/retest

kind: Role
metadata:
namespace: kube-system
name: system:openshift:leader-election-lock-cluster-policy-controller
Copy link
Contributor

Choose a reason for hiding this comment

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

this name doesn't match what you're binding to. This is a general leader election role

- get
- list
- watch
- create
Copy link
Contributor

Choose a reason for hiding this comment

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

only create needs to be unconstrained by names. The rest can use the stock role, right?

@damemi
Copy link
Author

damemi commented Dec 6, 2019

@deads2k updated with your feedback, thanks

@damemi
Copy link
Author

damemi commented Dec 7, 2019

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Dec 7, 2019
@openshift-ci-robot
Copy link

@damemi: This pull request references Bugzilla bug 1744984, which is valid.

In response to this:

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

Copy link
Member

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold cancel

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Dec 9, 2019
@soltysh
Copy link
Member

soltysh commented Dec 9, 2019

/cherry-pick release-4.3

@openshift-cherrypick-robot

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

In response to this:

/cherry-pick release-4.3

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
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damemi, deads2k, soltysh

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

@openshift-merge-robot openshift-merge-robot merged commit 096960a into openshift:master Dec 9, 2019
@openshift-ci-robot
Copy link

@damemi: All pull requests linked via external trackers have merged. Bugzilla bug 1744984 has been moved to the MODIFIED state.

In response to this:

Bug 1744984: Add e2e test for kube controller manager lease configmap deletion

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

@soltysh: new pull request created: #321

In response to this:

/cherry-pick release-4.3

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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants