Skip to content

Commit 7df466a

Browse files
committed
Change flag --insecure to --tls-verify
Signed-off-by: Hariharan <[email protected]>
1 parent 253bc5d commit 7df466a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cmd/run.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type osVmConfig struct {
2323
RemoveVm bool // Kill the running VM when it exits
2424
RemoveDiskImage bool // After exit of the VM, remove the disk image
2525
Quiet bool
26-
SkipTLSVerify bool
26+
TLSVerify bool
2727
}
2828

2929
var (
@@ -53,7 +53,7 @@ func init() {
5353
runCmd.Flags().BoolVar(&vmConfig.Quiet, "quiet", false, "Suppress output from bootc disk creation and VM boot console")
5454
runCmd.Flags().StringVar(&diskImageConfigInstance.RootSizeMax, "root-size-max", "", "Maximum size of root filesystem in bytes; optionally accepts M, G, T suffixes")
5555
runCmd.Flags().StringVar(&diskImageConfigInstance.DiskSize, "disk-size", "", "Allocate a disk image of this size in bytes; optionally accepts M, G, T suffixes")
56-
runCmd.Flags().BoolVar(&vmConfig.SkipTLSVerify, "insecure", false, "Skip TLS verification while pulling the image")
56+
runCmd.Flags().BoolVar(&vmConfig.TLSVerify, "tls-verify", true, "Require HTTPS and verify certificates when accessing the registry")
5757
}
5858

5959
func doRun(flags *cobra.Command, args []string) error {
@@ -73,7 +73,10 @@ func doRun(flags *cobra.Command, args []string) error {
7373
// create the disk image
7474
idOrName := args[0]
7575
bootcDisk := bootc.NewBootcDisk(idOrName, machine.Ctx, user)
76-
bootcDisk.SkipTLSVerify = vmConfig.SkipTLSVerify
76+
77+
// skip tls verification if tls-verfiy flag is set to false
78+
bootcDisk.SkipTLSVerify = !vmConfig.TLSVerify
79+
7780
err = bootcDisk.Install(vmConfig.Quiet, diskImageConfigInstance)
7881

7982
if err != nil {

0 commit comments

Comments
 (0)