X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=mecm%2Fmepm%2Fapplcm%2Fk8shelm%2Fpkg%2Fplugin%2Fhelmclient.go;h=0115ed99935c51ea043465522f9be8f213539654;hb=68e4075a8ba4a80b7727824eb8a91216a18c32dc;hp=eae3c039db0cab015bbc0163913d0e072894f03e;hpb=3d759364d2ce020b2298381bce815174bf1f6aec;p=ealt-edge.git diff --git a/mecm/mepm/applcm/k8shelm/pkg/plugin/helmclient.go b/mecm/mepm/applcm/k8shelm/pkg/plugin/helmclient.go index eae3c03..0115ed9 100644 --- a/mecm/mepm/applcm/k8shelm/pkg/plugin/helmclient.go +++ b/mecm/mepm/applcm/k8shelm/pkg/plugin/helmclient.go @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package plugin import ( @@ -53,7 +54,7 @@ func NewHelmClient(hostIP string, logger *logrus.Logger) (*HelmClient, error) { // Install a given helm chart func (hc *HelmClient) installChart(helmPkg bytes.Buffer) (string, error) { - hc.logger.Info("Inside helm client") + hc.logger.Debug("Inside helm client") // Create temporary file to hold helm chart file, err := os.Create(chartPath + "temp.tar.gz") @@ -84,11 +85,11 @@ func (hc *HelmClient) installChart(helmPkg bytes.Buffer) (string, error) { actionConfig := new(action.Configuration) if err := actionConfig.Init(kube.GetConfig(hc.kubeconfig, "", releaseNamespace), releaseNamespace, os.Getenv("HELM_DRIVER"), func(format string, v ...interface{}) { - fmt.Sprintf(format, v) + fmt.Sprintf(format, v) }); err != nil { hc.logger.Errorf("Unable to initialize action config Err: %s", err) return "", err - } + } // Prepare chart install action and install chart installer := action.NewInstall(actionConfig) @@ -109,11 +110,11 @@ func (hc *HelmClient) uninstallChart(relName string) (error) { actionConfig := new(action.Configuration) if err := actionConfig.Init(kube.GetConfig(hc.kubeconfig, "", releaseNamespace), releaseNamespace, os.Getenv("HELM_DRIVER"), func(format string, v ...interface{}) { - fmt.Sprintf(format, v) + fmt.Sprintf(format, v) }); err != nil { hc.logger.Errorf("Unable to initialize action config Err: %s", err) return err - } + } ui := action.NewUninstall(actionConfig) res, err := ui.Run(relName); @@ -130,8 +131,8 @@ func (hc *HelmClient) queryChart(relName string) (string, error) { actionConfig := new(action.Configuration) if err := actionConfig.Init(kube.GetConfig(hc.kubeconfig, "", releaseNamespace), releaseNamespace, os.Getenv("HELM_DRIVER"), func(format string, v ...interface{}) { - fmt.Sprintf(format, v) - }); err != nil { + fmt.Sprintf(format, v) + }); err != nil { hc.logger.Errorf("Unable to initialize action config Err: %s", err) return "", err } @@ -152,5 +153,4 @@ func fileExists(filename string) (bool, error) { return false, err } return !info.IsDir(), nil -} - +} \ No newline at end of file