Skip to content

Commit

Permalink
[v2] Use official nonroot images for e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blampe committed Sep 26, 2024
1 parent fcd9589 commit 19206fe
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 73 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/v2-run-acceptance-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ jobs:
runs-on: ubuntu-latest
name: E2E tests
steps:
# Building the rootless image currently eats up all of our free disk.
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
- name: Setup cluster
uses: helm/kind-action@v1
with:
Expand Down
6 changes: 1 addition & 5 deletions operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,9 @@ run: manifests generate fmt vet ## Run a controller from your host.
# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: docker-rootless ## Build docker image with the manager.
docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG}:${VERSION} --build-context agent=../agent --build-arg VERSION=${VERSION} .

.PHONY: docker-rootless
docker-rootless:
$(MAKE) -C hack/nonroot

.PHONY: docker-push
docker-push: ## Push docker image with the manager.
$(CONTAINER_TOOL) push ${IMG}:${VERSION}
Expand Down
2 changes: 0 additions & 2 deletions operator/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ func TestE2E(t *testing.T) {

err := loadImageToKindClusterWithName(projectimage)
require.NoError(t, err, "failed to load image into kind")
err = loadImageToKindClusterWithName("pulumi/pulumi:3.130.0-nonroot")
require.NoError(t, err, "failed to load image into kind")

cmd = exec.Command("make", "install")
require.NoError(t, run(cmd), "failed to install CRDs")
Expand Down
2 changes: 1 addition & 1 deletion operator/e2e/testdata/git-auth-nonroot/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
value: "test"
workspaceTemplate:
spec:
image: pulumi/pulumi:3.130.0-nonroot
image: pulumi/pulumi:3.134.1-nonroot
podTemplate:
spec:
containers:
Expand Down
2 changes: 1 addition & 1 deletion operator/e2e/testdata/random-yaml-nonroot/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
value: "test"
workspaceTemplate:
spec:
image: pulumi/pulumi:3.130.0-nonroot
image: pulumi/pulumi:3.134.1-nonroot
podTemplate:
spec:
containers:
Expand Down
3 changes: 2 additions & 1 deletion operator/examples/random-yaml/stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ spec:
secret:
name: pulumi-api-secret
key: accessToken
image: pulumi/pulumi:3.130.0-nonroot
image: pulumi/pulumi:3.134.1-nonroot

87 changes: 43 additions & 44 deletions operator/examples/random-yaml/workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ kind: Workspace
metadata:
name: random-yaml-1e2fc47
spec:
image: pulumi/pulumi:3.130.0-nonroot
securityProfile: restricted
image: pulumi/pulumi:3.134.1-nonroot
securityProfile: restricted
serviceAccountName: default

# git:
# url: https://github.com/pulumi/examples.git
# revision: 1e2fc471709448f3c9f7a250f28f1eafcde7017b
Expand All @@ -24,11 +24,11 @@ spec:
digest: sha256:6560311e95689086aa195a82c0310080adc31bea2457936ce528a014d811407a
dir: random-yaml
env:
- name: PULUMI_ACCESS_TOKEN
valueFrom:
secretKeyRef:
name: pulumi-api-secret
key: accessToken
- name: PULUMI_ACCESS_TOKEN
valueFrom:
secretKeyRef:
name: pulumi-api-secret
key: accessToken
resources:
requests:
cpu: 1
Expand All @@ -53,27 +53,27 @@ spec:
operator: "Exists"
effect: "NoSchedule"
initContainers:
- name: extra
image: busybox
command: ["sh", "-c", "echo 'Hello, extra init container!'"]
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
drop:
- ALL
volumeMounts:
- name: share
mountPath: /share
- name: extra
image: busybox
command: ["sh", "-c", "echo 'Hello, extra init container!'"]
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
drop:
- ALL
volumeMounts:
- name: share
mountPath: /share
containers:
- name: pulumi
volumeMounts:
- name: secret-volume
mountPath: /etc/secret-volume
readOnly: true
- name: oidc-token
mountPath: /var/run/secrets/pulumi
- name: pulumi
volumeMounts:
- name: secret-volume
mountPath: /etc/secret-volume
readOnly: true
- name: oidc-token
mountPath: /var/run/secrets/pulumi
volumes:
- name: secret-volume
secret:
Expand All @@ -88,19 +88,18 @@ spec:
stacks:
- name: dev
config:
- key: "pulumi:oidcToken"
valueFrom:
path: /var/run/secrets/pulumi/token
secret: true
- key: kubernetes:namespace
value: "default"
- key: data.active
path: true
value: "true"
- key: data.nums[0]
path: true
value: "1"
- key: data.nums[1]
path: true
value: "2"

- key: "pulumi:oidcToken"
valueFrom:
path: /var/run/secrets/pulumi/token
secret: true
- key: kubernetes:namespace
value: "default"
- key: data.active
path: true
value: "true"
- key: data.nums[0]
path: true
value: "1"
- key: data.nums[1]
path: true
value: "2"
9 changes: 0 additions & 9 deletions operator/hack/nonroot/Dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions operator/hack/nonroot/Makefile

This file was deleted.

0 comments on commit 19206fe

Please sign in to comment.