Skip to content

Commit

Permalink
Enable override for cni download
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Sep 18, 2024
1 parent bfba912 commit 89582ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/system/cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func MakeInstallCNI() *cobra.Command {
command.Flags().StringP("version", "v", "v1.4.0", "The version for CNI to install")
command.Flags().StringP("path", "p", "/opt/cni/bin/", "Installation path, where a go subfolder will be created")
command.Flags().Bool("progress", true, "Show download progress")
command.Flags().String("arch", "", "CPU architecture i.e. amd64")

command.RunE = func(cmd *cobra.Command, args []string) error {
installPath, _ := cmd.Flags().GetString("path")
Expand All @@ -45,6 +46,10 @@ func MakeInstallCNI() *cobra.Command {
}

arch, osVer := env.GetClientArch()
if cmd.Flags().Changed("arch") {
archFlag, _ := cmd.Flags().GetString("arch")
arch = archFlag
}

if strings.ToLower(osVer) != "linux" {
return fmt.Errorf("this app only supports Linux")
Expand Down

0 comments on commit 89582ba

Please sign in to comment.