diff --git a/bootstrapper/internal/kubernetes/kubernetes.go b/bootstrapper/internal/kubernetes/kubernetes.go index e5fc1a2be..8551530ec 100644 --- a/bootstrapper/internal/kubernetes/kubernetes.go +++ b/bootstrapper/internal/kubernetes/kubernetes.go @@ -224,7 +224,7 @@ func (k *KubeWrapper) InitCluster( // Store the received k8sVersion in a ConfigMap, overwriting exisiting values (there shouldn't be any). // Joining nodes determine the kubernetes version they will install based on this ConfigMap. - if err := k.setupK8sVersionConfigMap(ctx, k8sVersion, true); err != nil { + if err := k.setupK8sVersionConfigMap(ctx, k8sVersion); err != nil { return nil, fmt.Errorf("failed to setup k8s version ConfigMap: %v", err) } @@ -366,7 +366,7 @@ func (k *KubeWrapper) setupClusterAutoscaler(instance metadata.InstanceMetadata, } // setupK8sVersionConfigMap applies a ConfigMap (cf. server-side apply) to consistently store the installed k8s version. -func (k *KubeWrapper) setupK8sVersionConfigMap(ctx context.Context, k8sVersion string, forceConflicts bool) error { +func (k *KubeWrapper) setupK8sVersionConfigMap(ctx context.Context, k8sVersion string) error { if !versions.IsSupportedK8sVersion(k8sVersion) { return fmt.Errorf("supplied k8s version is not supported: %v", k8sVersion) } diff --git a/cli/internal/cloudcmd/serviceaccount.go b/cli/internal/cloudcmd/serviceaccount.go index 11d576269..c0262e423 100644 --- a/cli/internal/cloudcmd/serviceaccount.go +++ b/cli/internal/cloudcmd/serviceaccount.go @@ -88,7 +88,7 @@ func (c *ServiceAccountCreator) createServiceAccountGCP(ctx context.Context, cl } func (c *ServiceAccountCreator) createServiceAccountAzure(ctx context.Context, cl azureclient, - stat state.ConstellationState, config *config.Config, + stat state.ConstellationState, _ *config.Config, ) (string, state.ConstellationState, error) { if err := cl.SetState(stat); err != nil { return "", state.ConstellationState{}, fmt.Errorf("setting state while creating service account: %w", err) diff --git a/cli/internal/cloudcmd/validators.go b/cli/internal/cloudcmd/validators.go index 5509d62c5..5e9a09caa 100644 --- a/cli/internal/cloudcmd/validators.go +++ b/cli/internal/cloudcmd/validators.go @@ -119,23 +119,23 @@ func (v *Validators) Warnings() string { sb := &strings.Builder{} if v.pcrs[0] == nil || v.pcrs[1] == nil { - writeFmt(sb, warningStr, "BIOS") + writeWarnFmt(sb, "BIOS") } if v.pcrs[2] == nil || v.pcrs[3] == nil { - writeFmt(sb, warningStr, "OPROM") + writeWarnFmt(sb, "OPROM") } if v.pcrs[4] == nil || v.pcrs[5] == nil { - writeFmt(sb, warningStr, "MBR") + writeWarnFmt(sb, "MBR") } // GRUB measures kernel command line and initrd into pcrs 8 and 9 if v.pcrs[8] == nil { - writeFmt(sb, warningStr, "kernel command line") + writeWarnFmt(sb, "kernel command line") } if v.pcrs[9] == nil { - writeFmt(sb, warningStr, "initrd") + writeWarnFmt(sb, "initrd") } return sb.String() @@ -166,6 +166,10 @@ func (v *Validators) checkPCRs(pcrs map[uint32][]byte) error { return nil } +func writeWarnFmt(sb *strings.Builder, args ...any) { + writeFmt(sb, warningStr, args...) +} + func writeFmt(sb *strings.Builder, fmtStr string, args ...any) { sb.WriteString(fmt.Sprintf(fmtStr, args...)) } diff --git a/cli/internal/cmd/verify.go b/cli/internal/cmd/verify.go index 8f763054a..6fd3b658a 100644 --- a/cli/internal/cmd/verify.go +++ b/cli/internal/cmd/verify.go @@ -170,7 +170,7 @@ func readIds(fileHandler file.Handler) (clusterIDsFile, error) { // verifyCompletion handles the completion of CLI arguments. It is frequently called // while the user types arguments of the command to suggest completion. -func verifyCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { +func verifyCompletion(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) { switch len(args) { case 0: return []string{"gcp", "azure"}, cobra.ShellCompDirectiveNoFileComp diff --git a/debugd/cdbg/state/state.go b/debugd/cdbg/state/state.go index 8cd9c74c1..cb8998e09 100644 --- a/debugd/cdbg/state/state.go +++ b/debugd/cdbg/state/state.go @@ -24,7 +24,7 @@ func GetScalingGroupsFromConfig(stat state.ConstellationState, config *config.Co } } -func getGCPInstances(stat state.ConstellationState, config *config.Config) (controlPlanes, workers cloudtypes.ScalingGroup, err error) { +func getGCPInstances(stat state.ConstellationState, _ *config.Config) (controlPlanes, workers cloudtypes.ScalingGroup, err error) { if len(stat.GCPControlPlanes) == 0 { return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no control-plane workers available, can't create Constellation without any instance") } @@ -59,7 +59,7 @@ func getAzureInstances(stat state.ConstellationState, _ *config.Config) (control return } -func getQEMUInstances(stat state.ConstellationState, config *config.Config) (controlPlanes, workers cloudtypes.ScalingGroup, err error) { +func getQEMUInstances(stat state.ConstellationState, _ *config.Config) (controlPlanes, workers cloudtypes.ScalingGroup, err error) { controlPlaneMap := stat.QEMUControlPlane if len(controlPlaneMap) == 0 { return cloudtypes.ScalingGroup{}, cloudtypes.ScalingGroup{}, errors.New("no controlPlanes available, can't create Constellation without any instance") diff --git a/internal/atls/atls.go b/internal/atls/atls.go index 893e59d1a..56f4d8fce 100644 --- a/internal/atls/atls.go +++ b/internal/atls/atls.go @@ -164,7 +164,7 @@ func getCertificate(issuer Issuer, priv, pub any, nonce []byte) (*tls.Certificat // processCertificate parses the certificate and verifies it. // If successful returns the certificate and its hashed public key, an error otherwise. -func processCertificate(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) (*x509.Certificate, []byte, error) { +func processCertificate(rawCerts [][]byte, _ [][]*x509.Certificate) (*x509.Certificate, []byte, error) { // parse certificate if len(rawCerts) == 0 { return nil, nil, errors.New("rawCerts is empty") diff --git a/joinservice/internal/server/server.go b/joinservice/internal/server/server.go index bedf42142..b2df93cdc 100644 --- a/joinservice/internal/server/server.go +++ b/joinservice/internal/server/server.go @@ -137,7 +137,7 @@ func (s *Server) IssueJoinTicket(ctx context.Context, req *joinproto.IssueJoinTi } // getK8sVersion reads the k8s version from a VolumeMount that is backed by the k8s-version ConfigMap. -func (s *Server) getK8sVersion(ctx context.Context) (string, error) { +func (s *Server) getK8sVersion(_ context.Context) (string, error) { fileContent, err := s.file.Read(filepath.Join(constants.ServiceBasePath, "k8s-version")) if err != nil { return "", fmt.Errorf("could not read k8s version file: %v", err)