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

Rhtapwatch 1182 create empty regcred fix #9

Draft
wants to merge 2 commits into
base: local-registry
Choose a base branch
from
Draft
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: 5 additions & 3 deletions test/e2e/customize-docker-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ main() {
local original_docker_build_bundle_ref

# This is required in order to push the modified pipeline to local registry
kubectl port-forward -n kind-registry svc/registry-service 30001:80 &
kubectl port-forward -n kind-registry svc/registry-service 30001:443 &
original_docker_build_bundle_ref=$(yq ".data[\"config.yaml\"]" konflux-ci/build-service/core/build-pipeline-config.yaml | yq ".pipelines[] | select(.name == \"docker-build\").bundle")
# Remove the problematic "clair-scan" task from the docker pipeline
tkn bundle list "$original_docker_build_bundle_ref" -o yaml | yq 'del(.spec.tasks[] | select(.name == "clair-scan"))' > "/tmp/customized-docker-pipeline.yaml"
tkn bundle push "$CUSTOMIZED_DOCKER_PIPELINE_IMAGE_REF_LOCALHOST" -f "/tmp/customized-docker-pipeline.yaml"
tkn bundle list --remote-skip-tls "$original_docker_build_bundle_ref" -o yaml \
| yq 'del(.spec.tasks[] | select(.name == "clair-scan"))' > "/tmp/customized-docker-pipeline.yaml"
tkn bundle push --remote-skip-tls "$CUSTOMIZED_DOCKER_PIPELINE_IMAGE_REF_LOCALHOST" \
-f "/tmp/customized-docker-pipeline.yaml"
# Update the bundle ref in build-service pipeline configmap
sed -i "s|bundle:.*docker-build.*|bundle: ${CUSTOMIZED_DOCKER_PIPELINE_IMAGE_REF_CLUSTER}|g" konflux-ci/build-service/core/build-pipeline-config.yaml
}
Expand Down
1 change: 1 addition & 0 deletions test/e2e/prepare-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ main() {
--from-literal webhook.secret="$app_webhook_secret"; done
sed -i "s|<smee-channel>|$smee_channel|g" "${script_path}/../../smee/smee-client.yaml"
kubectl create -f "${script_path}/../../smee/smee-client.yaml"
kubectl wait --for=condition=Available deployment --all -A --timeout=180s
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Empty secret for registry that does not use authentication
apiVersion: v1
kind: Secret
metadata:
name: regcred-empty
namespace: managed-ns2
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: eyJhdXRocyI6eyJ4Ijp7ImVtYWlsIjoiIn19fQ==
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: appstudio-pipeline
namespace: managed-ns2
secrets:
- name: regcred-empty
12 changes: 12 additions & 0 deletions test/resources/demo-users/user/ns2/appstudio-pipeline-sa.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# Empty secret for registry that does not use authentication
apiVersion: v1
kind: Secret
metadata:
name: regcred-empty
namespace: user-ns2
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: eyJhdXRocyI6eyJ4Ijp7ImVtYWlsIjoiIn19fQ==
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: appstudio-pipeline
namespace: user-ns2
secrets:
- name: regcred-empty
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
Loading