From cdf7e1c9f23008a20883972b01faa61fb16af28f Mon Sep 17 00:00:00 2001 From: Aliaksei Ivanou Date: Mon, 17 Apr 2023 17:49:33 -0500 Subject: [PATCH] Image push pod update --- teams/team-scan/dev/templates/image-push-pod.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/teams/team-scan/dev/templates/image-push-pod.yaml b/teams/team-scan/dev/templates/image-push-pod.yaml index 7af7a326d..b2020445f 100644 --- a/teams/team-scan/dev/templates/image-push-pod.yaml +++ b/teams/team-scan/dev/templates/image-push-pod.yaml @@ -1,15 +1,14 @@ apiVersion: v1 kind: Pod metadata: - name: privileged-pod + name: ecr-pod + namespace: scan spec: + serviceAccountName: team-scan-sa containers: - name: app - image: centos + image: quay.io/skopeo/stable:latest command: ["/bin/sh"] args: - [ - "-c", - "docker pull centos:8 && docker tag centos:8 /centos:latest && docker push /centos:latest", - ] - securityContext: + - "-c" + - 'yum update -y && yum install unzip less -y && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && unzip awscliv2.zip && ./aws/install && aws ecr get-login-password --region {{ .Values.spec.region }} | skopeo login --username AWS --password-stdin {{ (split "/" .Values.spec.repositoryUri)._0 }} && skopeo copy docker://centos:8 docker://{{ .Values.spec.repositoryUri }}:latest && sleep 3600'