I’m using kubernetes/create-or-update-resource orb to deploy my statefulset to AWS EKS. The all deployment worked fine until I added an extra step to manually update my image tag inside my .yaml file using “sed” to the desired tag id.
My original file charts/neo4j-graphql-v3.yaml
# GRAPHQL SERVER
- name: graphql-server
image: xxxxxxxxxxx.dkr.ecr.ap-southeast-2.amazonaws.com/enigma-graphql:<IMAGE_TAG>
My config.yml
- run:
name: "PREPARE FILES"
command: |
# UPDATE IMAGE TYPE
sed -i "s/<IMAGE_TAG>/${CIRCLE_TAG}-b$CIRCLE_BUILD_NUM/g" charts/neo4j-graphql-v3.yaml
cat charts/neo4j-graphql-v3.yaml. #just to confirm file is writen properly
- kubernetes/create-or-update-resource:
get-rollout-status: true
resource-file-path: charts/neo4j-graphql-v3.yaml
resource-name: sts/neo4j-graphql-v3
I would expect orb to use my new modified file charts/neo4j-graphql-v3.yaml, but instead, it uses the original file that was checkout from repository and the deploy failes as there is no tag called <IMAGE_TAG>.
@awsassembly Thanks for sharing the link! It looks like there are 2 checkout steps in the job and one of them takes place after the yaml file has been modified. I think that could be the reason that the modification was not effective. Could you try removing the 2nd checkout step?
In fact, the extra checkout was coming from the command. “- aws-eks/update-kubeconfig-with-authenticator:” I don’t see “extra” checkouts in other orb commands, is this expected?
Complementing, if I remove my manual checkout the extra one doesn’t run.
Complementing my msg, in fact its not “- aws-eks/update-kubeconfig-with-authenticator:” that triggers checkout, but it always trigger after I run by “prepare files” run command. I’m not sure what is going on
All good now Stela, problem was the ECR orb checking out code, the command “checkout: false” resolved the issue now for good. Thanks again for your prompt response.