diff options
Diffstat (limited to 'src/k8splugin/internal/app/client.go')
-rw-r--r-- | src/k8splugin/internal/app/client.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/k8splugin/internal/app/client.go b/src/k8splugin/internal/app/client.go index 4fdce599..d44f3505 100644 --- a/src/k8splugin/internal/app/client.go +++ b/src/k8splugin/internal/app/client.go @@ -18,7 +18,6 @@ import ( "os" "time" - "github.com/onap/multicloud-k8s/src/k8splugin/internal/config" "github.com/onap/multicloud-k8s/src/k8splugin/internal/connection" "github.com/onap/multicloud-k8s/src/k8splugin/internal/helm" "github.com/onap/multicloud-k8s/src/k8splugin/internal/plugin" @@ -45,8 +44,9 @@ type KubernetesClient struct { // getKubeConfig uses the connectivity client to get the kubeconfig based on the name // of the cloudregion. This is written out to a file. func (k *KubernetesClient) getKubeConfig(cloudregion string) (string, error) { + conn := connection.NewConnectionClient() - kubeConfigPath, err := conn.Download(cloudregion, config.GetConfiguration().KubeConfigDir) + kubeConfigPath, err := conn.Download(cloudregion) if err != nil { return "", pkgerrors.Wrap(err, "Downloading kubeconfig") } @@ -122,8 +122,6 @@ func (k *KubernetesClient) ensureNamespace(namespace string) error { func (k *KubernetesClient) createKind(resTempl helm.KubernetesResourceTemplate, namespace string) (helm.KubernetesResource, error) { - log.Println("Processing Kind: " + resTempl.GVK.Kind) - if _, err := os.Stat(resTempl.FilePath); os.IsNotExist(err) { return helm.KubernetesResource{}, pkgerrors.New("File " + resTempl.FilePath + "does not exists") } @@ -137,6 +135,7 @@ func (k *KubernetesClient) createKind(resTempl helm.KubernetesResourceTemplate, createdResourceName, err := pluginImpl.Create(resTempl.FilePath, namespace, k) if err != nil { + log.Printf("Error: %s while creating: %s", err.Error(), resTempl.GVK.Kind) return helm.KubernetesResource{}, pkgerrors.Wrap(err, "Error in plugin "+resTempl.GVK.Kind+" plugin") } |