Skip to content

Commit

Permalink
UPSTREAM: <carry>: Apply SCC in e2e tests when reinstalling operator …
Browse files Browse the repository at this point in the history
…in another namespace

Signed-off-by: Christoph Stäbler <cstabler@redhat.com>
(cherry picked from commit 7509eee)
(cherry picked from commit 38cc1fd)
(cherry picked from commit de2462b)
  • Loading branch information
creydr committed Jun 30, 2022
1 parent cea51d1 commit 3a1e61e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cluster/sync-operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ function deploy_operator() {
$kubectl apply -f $MANIFESTS_DIR/role_binding.yaml
$kubectl apply -f deploy/crds/nmstate.io_nmstates.yaml
$kubectl apply -f $MANIFESTS_DIR/operator.yaml

if isOpenshift; then
$kubectl apply -f $MANIFESTS_DIR/scc.yaml
fi
}

function wait_ready_operator() {
Expand Down
2 changes: 0 additions & 2 deletions hack/ocp-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ fi
while ! oc wait mcp --all --for=condition=Updated --timeout -1s; do sleep 1; done

make cluster-sync-operator
# Will fail on subsequent runs, this is fine.
oc create -f build/_output/manifests/scc.yaml || :
oc create -f test/e2e/nmstate.yaml
# On first deployment, it can take a while for all of the pods to come up
# First wait for the handler pods to be created
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ func InstallOperator(operator TestData) {
false,
fmt.Sprintf("OPERATOR_NAMESPACE=%s", operator.Ns),
fmt.Sprintf("HANDLER_NAMESPACE=%s", operator.Ns),
"IMAGE_REGISTRY=registry:5000",
"manifests",
)
Expect(err).ToNot(HaveOccurred())
Expand All @@ -146,6 +145,7 @@ func InstallOperator(operator TestData) {
_, err = cmd.Kubectl("apply", "-f", operator.ManifestsDir+manifest)
Expect(err).ToNot(HaveOccurred())
}
cmd.Kubectl("apply", "-f", fmt.Sprintf("%s/scc.yaml", operator.ManifestsDir)) //ignore the error to be able to run the test against none OCP clusters as well
deployment.GetEventually(types.NamespacedName{Namespace: operator.Ns, Name: "nmstate-operator"}).Should(deployment.BeReady())
}

Expand Down

0 comments on commit 3a1e61e

Please sign in to comment.