diff --git a/cmd/diff.go b/cmd/diff.go index fa9b934..8101a4b 100644 --- a/cmd/diff.go +++ b/cmd/diff.go @@ -74,19 +74,20 @@ CMD1=oc exec -t neutron-cd94d8ccb-vq2gk -c neutron-api -- } path1 := args[0] path2 := args[1] + configPath := CheckFilesPresence(serviceCfgFile) if crd { if frompod { if podname == "" { panic("Please provide a pod name with --frompod option.") } - servicecfg.DiffServiceConfigFromPod(service, path2, path1, serviceCfgFile) + servicecfg.DiffServiceConfigFromPod(service, path2, path1, configPath) } else if frompodman { if podname == "" { panic("Please provide a pod name with --frompodman option.") } - servicecfg.DiffServiceConfigFromPodman(service, path2, path1, serviceCfgFile) + servicecfg.DiffServiceConfigFromPodman(service, path2, path1, configPath) } else { - servicecfg.DiffServiceConfigWithCRD(service, path2, path1, serviceCfgFile) + servicecfg.DiffServiceConfigWithCRD(service, path2, path1, configPath) } return } diff --git a/cmd/pull.go b/cmd/pull.go index db4e70d..ca2c802 100644 --- a/cmd/pull.go +++ b/cmd/pull.go @@ -54,6 +54,7 @@ This command will populate the config.yaml file with the podman and image Ids an if serviceConfig == "" { serviceConfig = config.Default.ServiceConfigFile } + configPath := CheckFilesPresence(serviceConfig) if cloud == "ocp" { // Test OCP connection: @@ -63,7 +64,7 @@ This command will populate the config.yaml file with the podman and image Ids an } // OCP Settings localOCPDir := config.Openshift.OcpLocalConfigPath - err := collectcfg.FetchConfigFromEnv(serviceConfig, localOCPDir, "", false, config.Openshift.Connection, "", "", filters) + err := collectcfg.FetchConfigFromEnv(configPath, localOCPDir, "", false, config.Openshift.Connection, "", "", filters) if err != nil { fmt.Println("Error while collecting config: ", err) return @@ -79,12 +80,12 @@ This command will populate the config.yaml file with the podman and image Ids an return } if update || updateOnly { - collectcfg.SetTripleODataEnv(serviceConfig, fullCmd, filters, true) + collectcfg.SetTripleODataEnv(configPath, fullCmd, filters, true) if updateOnly { return } } - err := collectcfg.FetchConfigFromEnv(serviceConfig, localConfigDir, remoteConfigDir, true, config.Tripleo.Connection, sshCmd, config.Tripleo.DirectorHost, filters) + err := collectcfg.FetchConfigFromEnv(configPath, localConfigDir, remoteConfigDir, true, config.Tripleo.Connection, sshCmd, config.Tripleo.DirectorHost, filters) if err != nil { fmt.Println("Error while collecting config: ", err) return