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

hydrator: enable pushing for SSH creds #19499

Closed
crenshaw-dev opened this issue Aug 12, 2024 · 3 comments
Closed

hydrator: enable pushing for SSH creds #19499

crenshaw-dev opened this issue Aug 12, 2024 · 3 comments
Labels
bug Something isn't working component:hydrator enhancement New feature or request hydrator Issues related to the manifest hydrator. type:bug type:enhancement

Comments

@crenshaw-dev
Copy link
Member

I've tested the hydrator so far only with GitHub App credentials. Trying to do the same with SSH creds currently fails.

Here's the credential format I'm using.

I've enabled the key as a deploy key in my test repo.

apiVersion: v1
kind: Secret
metadata:
  name: argocd-example-apps-ssh
  namespace: argocd
  labels:
    argocd.argoproj.io/secret-type: repository-write
stringData:
  url: https://github.com/crenshaw-dev/argocd-example-apps
  sshPrivateKey: |

Here's the error I get:

Failed to hydrated revision 6950caf8881481f20017156b3ac0528343d0da4f: failed to hydrate apps: failed to commit hydrated manifests: rpc error: code = Unknown desc = failed to commit and push: failed to push: `git push origin whatever` failed exit status 128: fatal: could not read Username for 'https://github.com': terminal prompts disabled

I've confirmed via logs that the commit-server is using the SSH credential.

@crenshaw-dev crenshaw-dev added enhancement New feature or request type:enhancement hydrator Issues related to the manifest hydrator. component:hydrator labels Aug 12, 2024
@crenshaw-dev
Copy link
Member Author

More details:

13:02:38             commit-server | ERRO[1980] `git push origin env/test` failed exit status 1: remote: error: refusing to update checked out branch: refs/heads/env/test        
13:02:38             commit-server | remote: error: By default, updating the current branch in a non-bare repository        
13:02:38             commit-server | remote: is denied, because it will make the index and work tree inconsistent        
13:02:38             commit-server | remote: with what you pushed, and will require 'git reset --hard' to match        
13:02:38             commit-server | remote: the work tree to HEAD.        
13:02:38             commit-server | remote: 
13:02:38             commit-server | remote: You can set the 'receive.denyCurrentBranch' configuration variable        
13:02:38             commit-server | remote: to 'ignore' or 'warn' in the remote repository to allow pushing into        
13:02:38             commit-server | remote: its current branch; however, this is not recommended unless you        
13:02:38             commit-server | remote: arranged to update its work tree to match what you pushed in some        
13:02:38             commit-server | remote: other way.        
13:02:38             commit-server | remote: 
13:02:38             commit-server | remote: To squelch this message and still keep the default behaviour, set        
13:02:38             commit-server | remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'.        
13:02:38             commit-server | To file:///tmp/argo-e2e/testdata.git
13:02:38             commit-server |  ! [remote rejected] env/test -> env/test (branch is currently checked out)

@crenshaw-dev
Copy link
Member Author

The second error might be old. I think the first one is the relevant one.

@alexmt alexmt added bug Something isn't working type:bug labels Aug 12, 2024
@crenshaw-dev
Copy link
Member Author

Looks like this had to do with local issues in my dev environment.

@crenshaw-dev crenshaw-dev closed this as not planned Won't fix, can't repro, duplicate, stale Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component:hydrator enhancement New feature or request hydrator Issues related to the manifest hydrator. type:bug type:enhancement
Projects
Status: Done
Development

No branches or pull requests

2 participants