Skip to content

Commit

Permalink
Add vSphere inputs
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
  • Loading branch information
ArangoGutierrez committed Aug 8, 2024
1 parent b49a324 commit ef2bc10
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ inputs:
aws_ssh_key:
description: 'AWS SSH Key'
required: false
vsphere_ssh_key:
description: 'vSphere SSH Key'
required: false
vsphere_username:
description: 'vSphere Username'
required: false
vsphere_password:
description: 'vSphere Password'
required: false
holodeck_config:
description: 'Holodeck configuration file'
required: true
Expand Down
25 changes: 25 additions & 0 deletions cmd/action/ci/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,31 @@ func readInputs() error {
}
}

// For vSphere
vsphereSshKey := os.Getenv("INPUT_VSPHERE_SSH_KEY")
if vsphereSshKey != "" {
err := os.Setenv("VSPHERE_SSH_KEY", vsphereSshKey)
if err != nil {
return fmt.Errorf("failed to set VSPHERE_SSH_KEY: %v", err)
}
}
// Map INPUT_VSPHERE_USERNAME and INPUT_VSPHERE_PASSWORD
// to VSPHERE_USERNAME and VSPHERE_PASSWORD
vsphereUsername := os.Getenv("INPUT_VSPHERE_USERNAME")
if vsphereUsername != "" {
err := os.Setenv("VSPHERE_USERNAME", vsphereUsername)
if err != nil {
return fmt.Errorf("failed to set VSPHERE_USERNAME: %v", err)
}
}
vspherePassword := os.Getenv("INPUT_VSPHERE_PASSWORD")
if vspherePassword != "" {
err := os.Setenv("VSPHERE_PASSWORD", vspherePassword)
if err != nil {
return fmt.Errorf("failed to set VSPHERE_PASSWORD: %v", err)
}
}

return nil
}

Expand Down

0 comments on commit ef2bc10

Please sign in to comment.