Skip to content

Commit cfc170a

Browse files
committed
Remove --no-creds
The --no-creds breaks the ssh command. Ssh will unconditionally use the ssh key path from the VM json config, passing --no-creds sets the path to "". Since we don't have any open issue about it, let's remove this option until someone ask for it. Signed-off-by: German Maglione <[email protected]>
1 parent 949638f commit cfc170a

File tree

5 files changed

+0
-21
lines changed

5 files changed

+0
-21
lines changed

cmd/run.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ type osVmConfig struct {
1919
CloudInitDir string
2020
KsFile string
2121
Background bool
22-
NoCredentials bool
2322
RemoveVm bool // Kill the running VM when it exits
2423
RemoveDiskImage bool // After exit of the VM, remove the disk image
2524
Quiet bool
@@ -47,7 +46,6 @@ func init() {
4746
runCmd.Flags().StringVar(&vmConfig.CloudInitDir, "cloudinit", "", "--cloudinit <cloud-init data directory>")
4847

4948
runCmd.Flags().StringVar(&diskImageConfigInstance.Filesystem, "filesystem", "", "Override the root filesystem (e.g. xfs, btrfs, ext4)")
50-
runCmd.Flags().BoolVar(&vmConfig.NoCredentials, "no-creds", false, "Do not inject default SSH key via credentials; also implies --background")
5149
runCmd.Flags().BoolVarP(&vmConfig.Background, "background", "B", false, "Do not spawn SSH, run in background")
5250
runCmd.Flags().BoolVar(&vmConfig.RemoveVm, "rm", false, "Remove the VM and it's disk when the SSH session exits. Cannot be used with --background")
5351
runCmd.Flags().BoolVar(&vmConfig.Quiet, "quiet", false, "Suppress output from bootc disk creation and VM boot console")
@@ -108,7 +106,6 @@ func doRun(flags *cobra.Command, args []string) error {
108106
err = bootcVM.Run(vm.RunVMParameters{
109107
Cmd: cmd,
110108
CloudInitDir: vmConfig.CloudInitDir,
111-
NoCredentials: vmConfig.NoCredentials,
112109
CloudInitData: flags.Flags().Changed("cloudinit"),
113110
RemoveVm: vmConfig.RemoveVm,
114111
Background: vmConfig.Background,

pkg/vm/vm.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ type NewVMParameters struct {
5454
type RunVMParameters struct {
5555
VMUser string //user to use when connecting to the VM
5656
CloudInitDir string
57-
NoCredentials bool
5857
CloudInitData bool
5958
SSHIdentity string
6059
SSHPort int

pkg/vm/vm_darwin.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,6 @@ func (b *BootcVMMac) Run(params RunVMParameters) (err error) {
8484
b.vmUsername = params.VMUser
8585
b.sshIdentity = params.SSHIdentity
8686

87-
if params.NoCredentials {
88-
b.sshIdentity = ""
89-
if !b.background {
90-
fmt.Print("No credentials provided for SSH, using --background by default")
91-
b.background = true
92-
}
93-
}
94-
9587
execPath, err := os.Executable()
9688
if err != nil {
9789
return fmt.Errorf("getting executable path: %w", err)

pkg/vm/vm_linux.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,6 @@ func (v *BootcVMLinux) Run(params RunVMParameters) (err error) {
123123
v.vmUsername = params.VMUser
124124
v.sshIdentity = params.SSHIdentity
125125

126-
if params.NoCredentials {
127-
v.sshIdentity = ""
128-
if !v.background {
129-
fmt.Print("No credentials provided for SSH, using --background by default")
130-
v.background = true
131-
}
132-
}
133-
134126
if v.domain != nil {
135127
isRunning, err := v.IsRunning()
136128
if err != nil {

pkg/vm/vm_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ func runTestVM(bootcVM vm.BootcVM) {
9696
err := bootcVM.Run(vm.RunVMParameters{
9797
VMUser: "root",
9898
CloudInitDir: "",
99-
NoCredentials: false,
10099
CloudInitData: false,
101100
SSHPort: 22,
102101
Cmd: []string{},

0 commit comments

Comments
 (0)