argoproj / argoproj/argo-workflows
Add validation when git credential type does not match git URL
- Dominant language
- Go
- Stars
- 17k
- Forks
- 3.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 138
Description
**Is this a BUG REPORT or FEATURE REQUEST?**:
BUG REPORT
**What happened**:
Updating to v2.2.0 caused workflows to break which contained a git checkout input artifact
**What you expected to happen**:
The git checkout would continue to work
**How to reproduce it (as minimally and precisely as possible)**:
**Anything else we need to know?**:
**Environment**:
- Argo version: v2.2.0
- Kubernetes version : v1.10.0
**Other debugging information (if applicable)**:
- executor logs:
```
# init:
❯ k logs -f -c init argo-test-8zb2g-438481831
time="2018-08-30T21:00:25Z" level=info msg="Creating a docker executor"
time="2018-08-30T21:00:25Z" level=info msg="Executor (version: v2.2.0, build_date: 2018-08-30T08:52:54Z) initialized with template:\narchiveLocation: {}\ncontainer:\n \ninputs:\n artifacts:\n - git:\n passwordSecret:\n key: password\n name: github-creds\n repo: https://github.com/.git\n revision: \n sshPrivateKeySecret:\n key: ssh-private-key\n name: github-creds\n usernameSecret:\n key: username\n name: github-creds\n name: code\n path: /app\nmetadata: {}\nname: build-statics\noutputs: {}\n"
time="2018-08-30T21:00:25Z" level=info msg="Start loading input artifacts..."
time="2018-08-30T21:00:25Z" level=info msg="Downloading artifact: code"
time="2018-08-30T21:00:25Z" level=info msg="Alloc=3609 TotalAlloc=9938 Sys=10086 NumGC=3 Goroutines=4"
time="2018-08-30T21:00:25Z" level=fatal msg="invalid auth method\ngithub.com/argoproj/argo/errors.Wrap\n\t/root/go/src/github.com/argoproj/argo/errors/errors.go:87\ngithub.com/argoproj/argo/errors.InternalWrapError\n\t/root/go/src/github.com/argoproj/argo/errors/errors.go:70\ngithub.com/argoproj/argo/workflow/artifacts/git.gitClone\n\t/root/go/src/github.com/argoproj/argo/workflow/artifacts/git/git.go:56\ngithub.com/argoproj/argo/workflow/artifacts/git.(*GitArtifactDriver).Load\n\t/root/go/src/github.com/argoproj/argo/workflow/artifacts/git/git.go:34\ngithub.com/argoproj/argo/workflow/executor.(*WorkflowExecutor).LoadArtifacts\n\t/root/go/src/github.com/argoproj/argo/workflow/executor/executor.go:139\ngithub.com/argoproj/argo/cmd/argoexec/commands.loadArtifacts\n\t/root/go/src/github.com/argoproj/argo/cmd/argoexec/commands/init.go:35\ngithub.com/argoproj/argo/cmd/argoexec/commands.glob..func1\n\t/root/go/src/github.com/argoproj/argo/cmd/argoexec/commands/init.go:17\ngithub.com/argoproj/argo/vendor/github.com/spf13/cobra.(*Command).execute\n\t/root/go/src/github.com/argoproj/argo/vendor/github.com/spf13/cobra/command.go:766\ngithub.com/argoproj/argo/vendor/github.com/spf13/cobra.(*Command).ExecuteC\n\t/root/go/src/github.com/argoproj/argo/vendor/github.com/spf13/cobra/command.go:852\ngithub.com/argoproj/argo/vendor/github.com/spf13/cobra.(*Command).Execute\n\t/root/go/src/github.com/argoproj/argo/vendor/github.com/spf13/cobra/command.go:800\nmain.main\n\t/root/go/src/github.com/argoproj/argo/cmd/argoexec/main.go:15\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:198\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:2361"
```
Contributor guide
Research direction
Start in workflow/artifacts/git/git.go at gitClone and GitArtifactDriver.Load, then trace the executor artifact-loading path shown in the logs. Reproduce the HTTPS checkout with both credential fields present and verify that mismatched credential types are rejected clearly while a matching configuration continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, go, kubernetes
- Domain
- authentication, backend, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100