airshipit / airshipctl

A CLI for managing declarative infrastructure.
Apache License 2.0
43 stars 49 forks source link

`airshicptl` claims to support ssh username/password authentication, but it does not #643

Closed ian-howell closed 3 years ago

ian-howell commented 3 years ago

Describe the bug The airshipctl config file indicates that it can pull documents via ssh using only a username and password, but go-git does not support that functionality.

Steps To Reproduce Create a config file which specifies ssh-pass as the auth type, as in the following:

apiVersion: airshipit.org/v1alpha1
managementConfiguration:
  dummy_management_config:
    type: redfish
    insecure: true
    useproxy: false
    systemActionRetries: 30
    systemRebootDelay: 30
contexts:
  ephemeral-cluster:
    manifest: dummy_manifest
    managementConfiguration: dummy_management_config
  target-cluster:
    manifest: dummy_manifest
    managementConfiguration: dummy_management_config
currentContext: ephemeral-cluster
kind: Config
manifests:
  dummy_manifest:
    phaseRepositoryName: primary
    repositories:
      primary:
        checkout:
          branch: "main"
          force: false
          ref: ""
          tag: ""
        fetch:
          remoteRefSpec: ""
        url: git@github.com:airshipit/airshipctl.git
        auth:
          type: "ssh-pass"
          keyPass:  ""
          sshKey:   ""
          httpPass: ""
          sshPass:  "redacted"
          username: "ian-howell"
    metadataPath: manifests/site/test-site/metadata.yaml
    targetPath: /tmp/tmp.ggBG9CvrDo/airship-ssh-pass

run airshipctl document pull -n --debug

Expected behavior The repo should exist at the targetPath, but it does not:

$ ls /tmp/tmp.ggBG9CvrDo/airship-ssh-pass/airshipctl 
$ cd /tmp/tmp.ggBG9CvrDo/airship-ssh-pass/airshipctl
$ git status                                          
On branch master

No commits yet

nothing to commit (create/copy files and use "git add" to track)
$ ls
$                                             
ian-howell commented 3 years ago

Closing as invalid

I encountered this issue when attempting to clone from GitHub, which does not support password authentication over ssh.

Additionally, when attempting to clone from GH via ssh keys, it's important to note that the username must be "git". Not sure if this is common knowledge or not, so I don't think we should update documentation, but it was new to me.