mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
go: remove redundant if-err check
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
0036b24266
commit
658cac046f
@ -71,11 +71,7 @@ func (h *Client) InstallConstellationServices(ctx context.Context, release helm.
|
|||||||
|
|
||||||
mergedVals := helm.MergeMaps(release.Values, extraVals)
|
mergedVals := helm.MergeMaps(release.Values, extraVals)
|
||||||
|
|
||||||
if err := h.install(ctx, release.Chart, mergedVals); err != nil {
|
return h.install(ctx, release.Chart, mergedVals)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// InstallCertManager installs the cert-manager chart.
|
// 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.Wait = release.Wait
|
||||||
h.Timeout = 10 * time.Minute
|
h.Timeout = 10 * time.Minute
|
||||||
|
|
||||||
if err := h.install(ctx, release.Chart, release.Values); err != nil {
|
return h.install(ctx, release.Chart, release.Values)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// InstallOperators installs the Constellation Operators.
|
// 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)
|
mergedVals := helm.MergeMaps(release.Values, extraVals)
|
||||||
|
|
||||||
if err := h.install(ctx, release.Chart, mergedVals); err != nil {
|
return h.install(ctx, release.Chart, mergedVals)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// InstallCilium sets up the cilium pod network.
|
// 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["k8sServiceHost"] = host
|
||||||
release.Values["k8sServicePort"] = strconv.Itoa(constants.KubernetesPort)
|
release.Values["k8sServicePort"] = strconv.Itoa(constants.KubernetesPort)
|
||||||
|
|
||||||
if err := h.install(ctx, release.Chart, release.Values); err != nil {
|
return h.install(ctx, release.Chart, release.Values)
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Client) installCiliumGCP(ctx context.Context, kubectl k8sapi.Client, release helm.Release, nodeName, nodePodCIDR, subnetworkPodCIDR, kubeAPIEndpoint string) error {
|
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
|
release.Values["k8sServicePort"] = port
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := h.install(ctx, release.Chart, release.Values); err != nil {
|
return h.install(ctx, release.Chart, release.Values)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// install tries to install the given chart and aborts after ~5 tries.
|
// install tries to install the given chart and aborts after ~5 tries.
|
||||||
|
@ -573,11 +573,7 @@ func (c *gcpIAMCreator) parseAndWriteIDFile(iamFile iamid.File, fileHandler file
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := fileHandler.WriteJSON(constants.GCPServiceAccountKeyFile, tmpOut, file.OptNone); err != nil {
|
return fileHandler.WriteJSON(constants.GCPServiceAccountKeyFile, tmpOut, file.OptNone)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseIDFile parses the given base64 encoded JSON string of the GCP service account key and returns a map.
|
// parseIDFile parses the given base64 encoded JSON string of the GCP service account key and returns a map.
|
||||||
|
@ -190,11 +190,8 @@ func (i *initCmd) initialize(cmd *cobra.Command, newDialer func(validator *cloud
|
|||||||
i.log.Debugf("Initialization request succeeded")
|
i.log.Debugf("Initialization request succeeded")
|
||||||
i.log.Debugf("Writing Constellation ID file")
|
i.log.Debugf("Writing Constellation ID file")
|
||||||
idFile.CloudProvider = provider
|
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) {
|
func (i *initCmd) initCall(ctx context.Context, dialer grpcDialer, ip string, req *initproto.InitRequest) (*initproto.InitResponse, error) {
|
||||||
|
@ -430,11 +430,7 @@ func (v *versionUpgrade) writeConfig(conf *config.Config, fileHandler file.Handl
|
|||||||
conf.UpdateMeasurements(v.newImages[imageUpgrade])
|
conf.UpdateMeasurements(v.newImages[imageUpgrade])
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := fileHandler.WriteYAML(configPath, conf, file.OptOverwrite); err != nil {
|
return fileHandler.WriteYAML(configPath, conf, file.OptOverwrite)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// getCurrentImageVersion retrieves the semantic version of the image currently installed in the cluster.
|
// getCurrentImageVersion retrieves the semantic version of the image currently installed in the cluster.
|
||||||
|
@ -79,11 +79,7 @@ func (c *Client) PrepareWorkspace(path string, vars Variables) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := c.writeVars(vars); err != nil {
|
return c.writeVars(vars)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateCluster creates a Constellation cluster using Terraform.
|
// CreateCluster creates a Constellation cluster using Terraform.
|
||||||
@ -303,11 +299,7 @@ func (c *Client) RemoveInstaller() {
|
|||||||
|
|
||||||
// CleanUpWorkspace removes terraform files from the current directory.
|
// CleanUpWorkspace removes terraform files from the current directory.
|
||||||
func (c *Client) CleanUpWorkspace() error {
|
func (c *Client) CleanUpWorkspace() error {
|
||||||
if err := cleanUpWorkspace(c.file, c.workingDir); err != nil {
|
return cleanUpWorkspace(c.file, c.workingDir)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetExecutable returns a Terraform executable either from the local filesystem,
|
// GetExecutable returns a Terraform executable either from the local filesystem,
|
||||||
|
Loading…
Reference in New Issue
Block a user