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

Relocate kubeconfig for non-root access #1437

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/Containerfile.operator
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ RUN go install github.com/onsi/ginkgo/[email protected] && go mod vendor && ginkgo
# create new docker image to hold built artifacts
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest

# pre-create directories and set permissions
RUN mkdir -p /resources /results && \
chown -R 1001:1001 /resources /results

# run as non-root
USER 1001:1001

# expose env vars for runtime
ENV KUBECONFIG "/opt/.kube/config"
ENV IMPORT_KUBECONFIG "/opt/.kube/import-kubeconfig"
ENV KUBECONFIG "/workspace/.kube/config"
ENV IMPORT_KUBECONFIG "/workspace/.kube/import-kubeconfig"
ENV OPTIONS "/resources/options.yaml"
ENV REPORT_FILE "/results/results.xml"
ENV GINKGO_DEFAULT_FLAGS "-slowSpecThreshold=120 -timeout 7200s"
Expand Down
8 changes: 6 additions & 2 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ RUN go install github.com/onsi/ginkgo/[email protected] && go mod vendor && ginkgo
# create new docker image to hold built artifacts
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest

# pre-create directories and set permissions
RUN mkdir -p /resources /results && \
chown -R 1001:1001 /resources /results

# run as non-root
USER 1001:1001

# expose env vars for runtime
ENV KUBECONFIG "/opt/.kube/config"
ENV IMPORT_KUBECONFIG "/opt/.kube/import-kubeconfig"
ENV KUBECONFIG "/workspace/.kube/config"
ENV IMPORT_KUBECONFIG "/workspace/.kube/import-kubeconfig"
ENV OPTIONS "/resources/options.yaml"
ENV REPORT_FILE "/results/results.xml"
ENV GINKGO_DEFAULT_FLAGS "-slowSpecThreshold=120 -timeout 7200s"
Expand Down