Skip to content

Commit

Permalink
feat(KFLUXDP-140): Prepare all Konflux components to integrate with S…
Browse files Browse the repository at this point in the history
…ealights
  • Loading branch information
flacatus committed Jan 26, 2025
1 parent ac2654f commit fa225f9
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 1 deletion.
12 changes: 12 additions & 0 deletions components/build-service/development/sealights-token-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: build-service-controller-manager
spec:
template:
spec:
containers:
- name: manager
env:
- name: SEALIGHTS_TOKEN
value: ""
6 changes: 6 additions & 0 deletions components/image-controller/development/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ patches:
kind: Deployment
name: controller-manager
path: logs-in-console-format-cmd-arg-patch.yaml
- target:
group: apps
version: v1
kind: Deployment
name: controller-manager
path: sealights-token-patch.yaml
12 changes: 12 additions & 0 deletions components/image-controller/development/sealights-token-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
spec:
template:
spec:
containers:
- name: manager
env:
- name: SEALIGHTS_TOKEN
value: ""
7 changes: 6 additions & 1 deletion components/integration/development/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ patches:
target:
kind: CronJob
name: snapshot-garbage-collector

- target:
group: apps
version: v1
kind: Deployment
name: integration-service-controller-manager
path: sealights-token-patch.yaml
components:
- ../rh-certs
12 changes: 12 additions & 0 deletions components/integration/development/sealights-token-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: integration-service-controller-manager
spec:
template:
spec:
containers:
- name: manager
env:
- name: SEALIGHTS_TOKEN
value: ""
8 changes: 8 additions & 0 deletions components/release/development/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ images:
newTag: c49d620f5ec5ddb90ae996fc7d5e05bf1474c985

namespace: release-service

patches:
- target:
group: apps
version: v1
kind: Deployment
name: controller-manager
path: sealights-token-patch.yaml
12 changes: 12 additions & 0 deletions components/release/development/sealights-token-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: release-service-controller-manager
spec:
template:
spec:
containers:
- name: manager
env:
- name: SEALIGHTS_TOKEN
value: ""
5 changes: 5 additions & 0 deletions hack/preview.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,21 @@ sed -i.bak "s/rekor-server.enterprise-contract-service.svc/$rekor_server/" $ROOT
[ -n "${BUILD_SERVICE_IMAGE_TAG}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/konflux-ci/build-service\")) |=.newTag=\"${BUILD_SERVICE_IMAGE_TAG}\"" $ROOT/components/build-service/development/kustomization.yaml
[ -n "${BUILD_SERVICE_IMAGE_TAG_EXPIRATION}" ] && yq -i e "(.spec.template.spec.containers[].env[] | select(.name==\"IMAGE_TAG_ON_PR_EXPIRATION\") | .value) |= \"${BUILD_SERVICE_IMAGE_TAG_EXPIRATION}\"" $ROOT/components/build-service/development/image-expiration-patch.yaml
[[ -n "${BUILD_SERVICE_PR_OWNER}" && "${BUILD_SERVICE_PR_SHA}" ]] && yq -i e "(.resources[] | select(. ==\"*github.com/konflux-ci/build-service*\")) |= \"https://github.com/${BUILD_SERVICE_PR_OWNER}/build-service/config/default?ref=${BUILD_SERVICE_PR_SHA}\"" $ROOT/components/build-service/development/kustomization.yaml
[ -n "${SEALIGHTS_TOKEN}" ] && yq -i e "(.spec.template.spec.containers[].env[] | select(.name==\"SEALIGHTS_TOKEN\") | .value) |= \"${SEALIGHTS_TOKEN}\"" $ROOT/components/build-service/development/sealights-token-patch.yaml

[ -n "${HAS_IMAGE_REPO}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/redhat-appstudio/application-service\")) |=.newName=\"${HAS_IMAGE_REPO}\"" $ROOT/components/has/base/kustomization.yaml
[ -n "${HAS_IMAGE_TAG}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/redhat-appstudio/application-service\")) |=.newTag=\"${HAS_IMAGE_TAG}\"" $ROOT/components/has/base/kustomization.yaml
[[ -n "${HAS_PR_OWNER}" && "${HAS_PR_SHA}" ]] && yq -i e "(.resources[] | select(. ==\"*github.com/redhat-appstudio/application-service*\")) |= \"https://github.com/${HAS_PR_OWNER}/application-service/config/default?ref=${HAS_PR_SHA}\"" $ROOT/components/has/base/kustomization.yaml

[ -n "${INTEGRATION_SERVICE_IMAGE_REPO}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/konflux-ci/integration-service\")) |=.newName=\"${INTEGRATION_SERVICE_IMAGE_REPO}\"" $ROOT/components/integration/development/kustomization.yaml
[ -n "${INTEGRATION_SERVICE_IMAGE_TAG}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/konflux-ci/integration-service\")) |=.newTag=\"${INTEGRATION_SERVICE_IMAGE_TAG}\"" $ROOT/components/integration/development/kustomization.yaml
[[ -n "${INTEGRATION_SERVICE_PR_OWNER}" && "${INTEGRATION_SERVICE_PR_SHA}" ]] && yq -i e "(.resources[] | select(. ==\"*github.com/konflux-ci/integration-service*\")) |= (sub(\"\?ref=.+\", \"?ref=${INTEGRATION_SERVICE_PR_SHA}\" ) | sub(\"github.com/redhat-appstudio\", \"github.com/${INTEGRATION_SERVICE_PR_OWNER}\"))" $ROOT/components/integration/development/kustomization.yaml
[ -n "${SEALIGHTS_TOKEN}" ] && yq -i e "(.spec.template.spec.containers[].env[] | select(.name==\"SEALIGHTS_TOKEN\") | .value) |= \"${SEALIGHTS_TOKEN}\"" $ROOT/components/integration/development/sealights-token-patch.yaml

[ -n "${RELEASE_SERVICE_IMAGE_REPO}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/konflux-ci/release-service\")) |=.newName=\"${RELEASE_SERVICE_IMAGE_REPO}\"" $ROOT/components/release/development/kustomization.yaml
[ -n "${RELEASE_SERVICE_IMAGE_TAG}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/konflux-ci/release-service\")) |=.newTag=\"${RELEASE_SERVICE_IMAGE_TAG}\"" $ROOT/components/release/development/kustomization.yaml
[[ -n "${RELEASE_SERVICE_PR_OWNER}" && "${RELEASE_SERVICE_PR_SHA}" ]] && yq -i e "(.resources[] | select(. ==\"*github.com/konflux-ci/release-service*\")) |= \"https://github.com/${RELEASE_SERVICE_PR_OWNER}/release-service/config/default?ref=${RELEASE_SERVICE_PR_SHA}\"" $ROOT/components/release/development/kustomization.yaml
[ -n "${SEALIGHTS_TOKEN}" ] && yq -i e "(.spec.template.spec.containers[].env[] | select(.name==\"SEALIGHTS_TOKEN\") | .value) |= \"${SEALIGHTS_TOKEN}\"" $ROOT/components/release/development/sealights-token-patch.yaml

[ -n "${MINTMAKER_IMAGE_REPO}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/konflux-ci/mintmaker\")) |=.newName=\"${MINTMAKER_IMAGE_REPO}\"" $ROOT/components/mintmaker/development/kustomization.yaml
[ -n "${MINTMAKER_IMAGE_TAG}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/konflux-ci/mintmaker\")) |=.newTag=\"${MINTMAKER_IMAGE_TAG}\"" $ROOT/components/mintmaker/development/kustomization.yaml
Expand All @@ -210,6 +214,7 @@ sed -i.bak "s/rekor-server.enterprise-contract-service.svc/$rekor_server/" $ROOT
[ -n "${IMAGE_CONTROLLER_IMAGE_REPO}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/konflux-ci/image-controller\")) |=.newName=\"${IMAGE_CONTROLLER_IMAGE_REPO}\"" $ROOT/components/image-controller/development/kustomization.yaml
[ -n "${IMAGE_CONTROLLER_IMAGE_TAG}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/konflux-ci/image-controller\")) |=.newTag=\"${IMAGE_CONTROLLER_IMAGE_TAG}\"" $ROOT/components/image-controller/development/kustomization.yaml
[[ -n "${IMAGE_CONTROLLER_PR_OWNER}" && "${IMAGE_CONTROLLER_PR_SHA}" ]] && yq -i e "(.resources[] | select(. ==\"*github.com/konflux-ci/image-controller*\")) |= \"https://github.com/${IMAGE_CONTROLLER_PR_OWNER}/image-controller/config/default?ref=${IMAGE_CONTROLLER_PR_SHA}\"" $ROOT/components/image-controller/development/kustomization.yaml
[ -n "${SEALIGHTS_TOKEN}" ] && yq -i e "(.spec.template.spec.containers[].env[] | select(.name==\"SEALIGHTS_TOKEN\") | .value) |= \"${SEALIGHTS_TOKEN}\"" $ROOT/components/image-controller/development/sealights-token-patch.yaml

[ -n "${MULTI_ARCH_CONTROLLER_IMAGE_REPO}" ] && yq -i e "(.images.[] | select(.name==\"multi-platform-controller\")) |=.newName=\"${MULTI_ARCH_CONTROLLER_IMAGE_REPO}\"" $ROOT/components/multi-platform-controller/base/kustomization.yaml
[ -n "${MULTI_ARCH_CONTROLLER_IMAGE_TAG}" ] && yq -i e "(.images.[] | select(.name==\"multi-platform-controller\")) |=.newTag=\"${MULTI_ARCH_CONTROLLER_IMAGE_TAG}\"" $ROOT/components/multi-platform-controller/base/kustomization.yaml
Expand Down

0 comments on commit fa225f9

Please sign in to comment.