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

repeated use of git-clone causes confusion in out path in git-clear #3500

Open
jessesuen opened this issue Feb 13, 2025 · 0 comments
Open

repeated use of git-clone causes confusion in out path in git-clear #3500

jessesuen opened this issue Feb 13, 2025 · 0 comments

Comments

@jessesuen
Copy link
Member

jessesuen commented Feb 13, 2025

Description

I have a Stage that calls a PromotionTask and will perform git-clone multiple times for the same repo. After the second git-clone, the following git-clear step will fail with:

step execution failed: step 7 met error threshold of 1: failed to run step "git-clear": error loading working tree from ./out: error reading repo dir from config: error executing cmd [/usr/bin/git config kargo.repoDir]: : chdir /tmp/promotion-a81a77c5-5c57-4af0-95c7-057f122628c8/out: no such file or directory

Screenshots

Image Image

Steps to Reproduce

apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
  name: render-envs
  namespace: kargo-rendered-branches
  annotations:
    kargo.akuity.io/color: grey
spec:
  requestedFreight:
  - origin:
      kind: Warehouse
      name: config
    sources:
      direct: true
  promotionTemplate:
    spec:
      steps:
      - task: {name: render-config}
        vars: [{name: env, value: dev}]
      - task: {name: render-config}
        vars: [{name: env, value: staging}]
      - task: {name: render-config}
        vars: [{name: env, value: prod}]

----
apiVersion: kargo.akuity.io/v1alpha1
kind: PromotionTask
metadata:
  name: render-config
  namespace: kargo-rendered-branches
spec:
  vars:
  - name: repoURL
    value: https://github.com/jessesuen/kargo-rendered-branches.git
  - name: branch
    value: main
  - name: env
  steps:
  - uses: git-clone
    config:
      repoURL: ${{ vars.repoURL }}
      checkout:
      - commit: ${{ commitFrom(vars.repoURL).ID }}
        path: ./src
      - branch: env/${{ vars.env }}
        path: ./out
        create: true
  - uses: git-clear
    config:
      path: ./out
  - uses: kustomize-build
    config:
      path: ./src/env/${{ vars.env }}
      outPath: ./out
  - uses: git-commit
    as: commit
    config:
      path: ./out
      message: Updated configuration for ${{ vars.env }}
  - uses: git-push
    config:
      path: ./out
  # This is necessary so subsequent invocations of this task
  # have a clean out directory
  - uses: delete
    config:
      path: ./out

Version

v1.2.2

Logs

Paste any relevant application logs here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant