Changed cert flags and added cert for gofish

This commit is contained in:
David J. Allen 2024-05-06 14:01:29 -06:00
parent b58167a322
commit b5c0d9ce2a
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC
4 changed files with 74 additions and 49 deletions

View file

@ -41,17 +41,17 @@ var collectCmd = &cobra.Command{
threads = mathutil.Clamp(len(probeStates), 1, 255)
}
q := &magellan.QueryParams{
User: user,
Pass: pass,
Protocol: protocol,
Drivers: drivers,
Preferred: preferredDriver,
Timeout: timeout,
Threads: threads,
Verbose: verbose,
WithSecureTLS: withSecureTLS,
OutputPath: outputPath,
ForceUpdate: forceUpdate,
User: user,
Pass: pass,
Protocol: protocol,
Drivers: drivers,
Preferred: preferredDriver,
Timeout: timeout,
Threads: threads,
Verbose: verbose,
CaCertPath: cacertPath,
OutputPath: outputPath,
ForceUpdate: forceUpdate,
}
magellan.CollectAll(&probeStates, l, q)
@ -74,7 +74,6 @@ func init() {
collectCmd.PersistentFlags().BoolVar(&forceUpdate, "force-update", false, "set flag to force update data sent to SMD ")
collectCmd.PersistentFlags().StringVar(&preferredDriver, "preferred-driver", "ipmi", "set the preferred driver to use")
collectCmd.PersistentFlags().StringVar(&ipmitoolPath, "ipmitool.path", "/usr/bin/ipmitool", "set the path for ipmitool")
collectCmd.PersistentFlags().BoolVar(&withSecureTLS, "secure-tls", false, "enable secure TLS")
collectCmd.PersistentFlags().StringVar(&certPoolFile, "cert-pool", "", "path to CA cert. (defaults to system CAs; used with --secure-tls=true)")
collectCmd.PersistentFlags().StringVar(&cacertPath, "ca-cert", "", "path to CA cert. (defaults to system CAs; used with --secure-tls=true)")
rootCmd.AddCommand(collectCmd)
}

View file

@ -14,8 +14,7 @@ var (
ports []int
hosts []string
protocol string
withSecureTLS bool
certPoolFile string
cacertPath string
user string
pass string
dbpath string

View file

@ -28,15 +28,14 @@ var updateCmd = &cobra.Command{
Component: component,
TransferProtocol: transferProtocol,
QueryParams: magellan.QueryParams{
Drivers: []string{"redfish"},
Preferred: "redfish",
Protocol: protocol,
Host: host,
User: user,
Pass: pass,
Timeout: timeout,
Port: port,
WithSecureTLS: withSecureTLS,
Drivers: []string{"redfish"},
Preferred: "redfish",
Protocol: protocol,
Host: host,
User: user,
Pass: pass,
Timeout: timeout,
Port: port,
},
}
@ -76,7 +75,6 @@ func init() {
updateCmd.Flags().StringVar(&firmwareUrl, "firmware-url", "", "set the path to the firmware")
updateCmd.Flags().StringVar(&firmwareVersion, "firmware-version", "", "set the version of firmware to be installed")
updateCmd.Flags().StringVar(&component, "component", "", "set the component to upgrade")
updateCmd.Flags().BoolVar(&withSecureTLS, "secure-tls", false, "enable secure TLS")
updateCmd.Flags().BoolVar(&status, "status", false, "get the status of the update")
rootCmd.AddCommand(updateCmd)
}