diff --git a/bootstrapper/internal/helm/helm.go b/bootstrapper/internal/helm/helm.go index 225674463..b04969b74 100644 --- a/bootstrapper/internal/helm/helm.go +++ b/bootstrapper/internal/helm/helm.go @@ -71,11 +71,7 @@ func (h *Client) InstallConstellationServices(ctx context.Context, release helm. mergedVals := helm.MergeMaps(release.Values, extraVals) - if err := h.install(ctx, release.Chart, mergedVals); err != nil { - return err - } - - return nil + return h.install(ctx, release.Chart, mergedVals) } // InstallCertManager installs the cert-manager chart. @@ -84,11 +80,7 @@ func (h *Client) InstallCertManager(ctx context.Context, release helm.Release) e h.Wait = release.Wait h.Timeout = 10 * time.Minute - if err := h.install(ctx, release.Chart, release.Values); err != nil { - return err - } - - return nil + return h.install(ctx, release.Chart, release.Values) } // InstallOperators installs the Constellation Operators. @@ -98,11 +90,7 @@ func (h *Client) InstallOperators(ctx context.Context, release helm.Release, ext mergedVals := helm.MergeMaps(release.Values, extraVals) - if err := h.install(ctx, release.Chart, mergedVals); err != nil { - return err - } - - return nil + return h.install(ctx, release.Chart, mergedVals) } // InstallCilium sets up the cilium pod network. @@ -128,10 +116,7 @@ func (h *Client) installCiliumGeneric(ctx context.Context, release helm.Release, release.Values["k8sServiceHost"] = host release.Values["k8sServicePort"] = strconv.Itoa(constants.KubernetesPort) - if err := h.install(ctx, release.Chart, release.Values); err != nil { - return err - } - return nil + return h.install(ctx, release.Chart, release.Values) } func (h *Client) installCiliumGCP(ctx context.Context, kubectl k8sapi.Client, release helm.Release, nodeName, nodePodCIDR, subnetworkPodCIDR, kubeAPIEndpoint string) error { @@ -179,11 +164,7 @@ func (h *Client) installCiliumGCP(ctx context.Context, kubectl k8sapi.Client, re release.Values["k8sServicePort"] = port } - if err := h.install(ctx, release.Chart, release.Values); err != nil { - return err - } - - return nil + return h.install(ctx, release.Chart, release.Values) } // install tries to install the given chart and aborts after ~5 tries. diff --git a/cli/internal/cmd/iamcreate.go b/cli/internal/cmd/iamcreate.go index 9435425f7..ff11ff5b6 100644 --- a/cli/internal/cmd/iamcreate.go +++ b/cli/internal/cmd/iamcreate.go @@ -573,11 +573,7 @@ func (c *gcpIAMCreator) parseAndWriteIDFile(iamFile iamid.File, fileHandler file return err } - if err := fileHandler.WriteJSON(constants.GCPServiceAccountKeyFile, tmpOut, file.OptNone); err != nil { - return err - } - - return nil + return fileHandler.WriteJSON(constants.GCPServiceAccountKeyFile, tmpOut, file.OptNone) } // parseIDFile parses the given base64 encoded JSON string of the GCP service account key and returns a map. diff --git a/cli/internal/cmd/init.go b/cli/internal/cmd/init.go index 7906661e3..f9a0aab6c 100644 --- a/cli/internal/cmd/init.go +++ b/cli/internal/cmd/init.go @@ -190,11 +190,8 @@ func (i *initCmd) initialize(cmd *cobra.Command, newDialer func(validator *cloud i.log.Debugf("Initialization request succeeded") i.log.Debugf("Writing Constellation ID file") idFile.CloudProvider = provider - if err := i.writeOutput(idFile, resp, flags.mergeConfigs, cmd.OutOrStdout(), fileHandler); err != nil { - return err - } - return nil + return i.writeOutput(idFile, resp, flags.mergeConfigs, cmd.OutOrStdout(), fileHandler) } func (i *initCmd) initCall(ctx context.Context, dialer grpcDialer, ip string, req *initproto.InitRequest) (*initproto.InitResponse, error) { diff --git a/cli/internal/cmd/upgradecheck.go b/cli/internal/cmd/upgradecheck.go index 6c6489493..053f6ea9b 100644 --- a/cli/internal/cmd/upgradecheck.go +++ b/cli/internal/cmd/upgradecheck.go @@ -430,11 +430,7 @@ func (v *versionUpgrade) writeConfig(conf *config.Config, fileHandler file.Handl conf.UpdateMeasurements(v.newImages[imageUpgrade]) } - if err := fileHandler.WriteYAML(configPath, conf, file.OptOverwrite); err != nil { - return err - } - - return nil + return fileHandler.WriteYAML(configPath, conf, file.OptOverwrite) } // getCurrentImageVersion retrieves the semantic version of the image currently installed in the cluster. diff --git a/cli/internal/terraform/terraform.go b/cli/internal/terraform/terraform.go index 415a5e58e..0defba4ad 100644 --- a/cli/internal/terraform/terraform.go +++ b/cli/internal/terraform/terraform.go @@ -79,11 +79,7 @@ func (c *Client) PrepareWorkspace(path string, vars Variables) error { return err } - if err := c.writeVars(vars); err != nil { - return err - } - - return nil + return c.writeVars(vars) } // CreateCluster creates a Constellation cluster using Terraform. @@ -303,11 +299,7 @@ func (c *Client) RemoveInstaller() { // CleanUpWorkspace removes terraform files from the current directory. func (c *Client) CleanUpWorkspace() error { - if err := cleanUpWorkspace(c.file, c.workingDir); err != nil { - return err - } - - return nil + return cleanUpWorkspace(c.file, c.workingDir) } // GetExecutable returns a Terraform executable either from the local filesystem,