Skip to content

Commit

Permalink
Add additional init to run-e2e-local.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan West <[email protected]>
  • Loading branch information
jgwest committed Mar 26, 2024
1 parent 6a75064 commit 7aafe37
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/onsi/gomega v1.30.0
github.com/openshift/api v0.0.0-20230417092139-1b2161d23365
github.com/openshift/client-go v0.0.0-20230419131419-497c7032c581
k8s.io/api v0.26.3
k8s.io/apimachinery v0.26.3
k8s.io/client-go v0.26.3
)
Expand Down Expand Up @@ -84,7 +85,6 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.26.3 // indirect
k8s.io/apiserver v0.26.3 // indirect
k8s.io/cli-runtime v0.26.3 // indirect
k8s.io/component-base v0.26.3 // indirect
Expand Down
4 changes: 3 additions & 1 deletion hack/run-e2e-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if [ $# -eq 0 ]; then
fi
ROLLOUTS_DIR=$1

mkdir -p $ROLLOUTS_DIR/plugin-bin

kubectl delete ns argo-rollouts || true

Expand Down Expand Up @@ -49,6 +50,7 @@ EOF
cd $ROLLOUTS_DIR
kubectl apply -k manifests/crds
rm -f /tmp/rollouts-controller.log || true
go mod tidy
go run ./cmd/rollouts-controller/main.go 2>&1 | tee /tmp/rollouts-controller.log &

# wait for the controller to start
Expand All @@ -58,4 +60,4 @@ sleep 30
cd $SCRIPT_DIR/..
make test-e2e

cleanup
cleanup
6 changes: 3 additions & 3 deletions tests/fixtures/rollout/rollout.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func HasTransitionedToCanary(expectedReplicas int) matcher.GomegaMatcher {
}
stableService, err := k8sClient.CoreV1().Services(ns).Get(ctx, stableName, metav1.GetOptions{})
if err != nil {
fmt.Println("failed to get stable servive", err)
fmt.Println("failed to get stable service", err)
return false
}

Expand All @@ -111,13 +111,13 @@ func HasTransitionedToCanary(expectedReplicas int) matcher.GomegaMatcher {
} else if rs.ResourceVersion == "2" {
if rs.Spec.Template.Labels[rolloutsv1alpha1.DefaultRolloutUniqueLabelKey] !=
stableService.Spec.Selector[rolloutsv1alpha1.DefaultRolloutUniqueLabelKey] {
fmt.Printf("expected the stable service %s to point to the latest ReplicSet %s\n", stableName, rs.Name)
fmt.Printf("expected the stable service %s to point to the latest ReplicaSet %s\n", stableName, rs.Name)
return false
}

if rs.Spec.Template.Labels[rolloutsv1alpha1.DefaultRolloutUniqueLabelKey] !=
canaryService.Spec.Selector[rolloutsv1alpha1.DefaultRolloutUniqueLabelKey] {
fmt.Printf("expected the canary service %s to point to the latest ReplicSet %s\n", canaryName, rs.Name)
fmt.Printf("expected the canary service %s to point to the latest ReplicaSet %s\n", canaryName, rs.Name)
return false
}

Expand Down

0 comments on commit 7aafe37

Please sign in to comment.