You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have sensor that is getting the event from gitlab and then building the image and after this build I want to update my rollouts to use this latest build image , my build part working fine but the second part where I need to patch the rollout not able to use the image tag variable here can any one let me know I can I solve this parameterization issue.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
i have sensor that is getting the event from gitlab and then building the image and after this build I want to update my rollouts to use this latest build image , my build part working fine but the second part where I need to patch the rollout not able to use the image tag variable here can any one let me know I can I solve this parameterization issue.
using this sensor file
`apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: combined-sensor
#namespace: argocd
spec:
dependencies:
- name: test-dep
eventSourceName: gitlab
eventName: event
triggers:
template:
name: kaniko-workflow-trigger
k8s:
group: argoproj.io
version: v1alpha1
resource: workflows
operation: create
source:
resource:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: kaniko-build-
spec:
entrypoint: kaniko-build
arguments:
parameters:
- name: unique-id
value: "{{workflow.creationTimestamp.Y}}{{workflow.creationTimestamp.m}}{{workflow.creationTimestamp.d}}{{workflow.creationTimestamp.H}}{{workflow.creationTimestamp.M}}{{workflow.creationTimestamp.S}}"
#value: "{{workflow.creationTimestamp.Y}}-{{workflow.creationTimestamp.m}}-{{workflow.creationTimestamp.d}}"
#value: "{{ formatDate "20060102150405" .workflow.creationTimestamp }}"
templates:
- name: kaniko-build
container:
image: gcr.io/kaniko-project/executor:debug
command: ["/kaniko/executor"]
args: ["--context=git://oauth2:glpat-XXXXXXXXXXXV@gitlab.gitaccess.com/xxx/xxx-browser.git#dockerbuild",
"--dockerfile=docker-build/Dockerfile",
"--destination=gitlab.gitaccess.com:5050/xxx/xxx-browser:{{workflow.parameters.unique-id}}"]
resources:
requests:
memory: 1000Mi
limits:
memory: 5000Mi
volumeMounts:
- name: kaniko-secret
mountPath: /kaniko/.docker
volumes:
- name: kaniko-secret
secret:
secretName: regcred
items:
- key: .dockerconfigjson
path: config.json
outputs:
parameters:
- name: unique-id
value: "{{workflow.parameters.unique-id}}"
template:
name: nginx-patch-trigger
waitFor:
k8s:
group: argoproj.io
version: v1alpha1
resource: rollouts
operation: patch
source:
resource:
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: rl-xxx-browser
namespace: xxxx-browser
spec:
template:
spec:
containers:
- name: xxx-browser
image: gitlab.gitaccess.com:5050/xxx/xxxx-browser:{{kaniko-workflow-trigger.outputs.parameters.unique-id}}
`
this :{{kaniko-workflow-trigger.outputs.parameters.unique-id}} variable is not picking the value
Beta Was this translation helpful? Give feedback.
All reactions