Remove obsolote revive comments

This commit is contained in:
Otto Bittner 2022-11-23 08:12:33 +01:00
parent 6c0509e34d
commit 6b2d9d16f8
13 changed files with 0 additions and 63 deletions

View file

@ -24,9 +24,6 @@ import (
"go.uber.org/zap" "go.uber.org/zap"
) )
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func run(issuerWrapper initserver.IssuerWrapper, tpm vtpm.TPMOpenFunc, fileHandler file.Handler, func run(issuerWrapper initserver.IssuerWrapper, tpm vtpm.TPMOpenFunc, fileHandler file.Handler,
kube clusterInitJoiner, metadata metadataAPI, kube clusterInitJoiner, metadata metadataAPI,
bindIP, bindPort string, log *logger.Logger, bindIP, bindPort string, log *logger.Logger,

View file

@ -146,9 +146,6 @@ func (h *Client) installCiliumGeneric(ctx context.Context, release helm.Release,
return nil return nil
} }
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
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 {
out, err := exec.CommandContext(ctx, constants.KubectlPath, "--kubeconfig", constants.ControlPlaneAdminConfFilename, "patch", "node", nodeName, "-p", "{\"spec\":{\"podCIDR\": \""+nodePodCIDR+"\"}}").CombinedOutput() out, err := exec.CommandContext(ctx, constants.KubectlPath, "--kubeconfig", constants.ControlPlaneAdminConfFilename, "patch", "node", nodeName, "-p", "{\"spec\":{\"podCIDR\": \""+nodePodCIDR+"\"}}").CombinedOutput()
if err != nil { if err != nil {

View file

@ -109,9 +109,6 @@ func (k *KubernetesUtil) InstallComponents(ctx context.Context, version versions
} }
// InitCluster instruments kubeadm to initialize the K8s cluster. // InitCluster instruments kubeadm to initialize the K8s cluster.
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func (k *KubernetesUtil) InitCluster( func (k *KubernetesUtil) InitCluster(
ctx context.Context, initConfig []byte, nodeName string, ips []net.IP, controlPlaneEndpoint string, conformanceMode bool, log *logger.Logger, ctx context.Context, initConfig []byte, nodeName string, ips []net.IP, controlPlaneEndpoint string, conformanceMode bool, log *logger.Logger,
) error { ) error {

View file

@ -66,9 +66,6 @@ type KubeWrapper struct {
} }
// New creates a new KubeWrapper with real values. // New creates a new KubeWrapper with real values.
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func New(cloudProvider string, clusterUtil clusterUtil, configProvider configurationProvider, client k8sapi.Client, func New(cloudProvider string, clusterUtil clusterUtil, configProvider configurationProvider, client k8sapi.Client,
providerMetadata ProviderMetadata, initialMeasurementsJSON []byte, helmClient helmClient, kubeAPIWaiter kubeAPIWaiter, providerMetadata ProviderMetadata, initialMeasurementsJSON []byte, helmClient helmClient, kubeAPIWaiter kubeAPIWaiter,
) *KubeWrapper { ) *KubeWrapper {
@ -87,9 +84,6 @@ func New(cloudProvider string, clusterUtil clusterUtil, configProvider configura
} }
// InitCluster initializes a new Kubernetes cluster and applies pod network provider. // InitCluster initializes a new Kubernetes cluster and applies pod network provider.
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func (k *KubeWrapper) InitCluster( func (k *KubeWrapper) InitCluster(
ctx context.Context, cloudServiceAccountURI, versionString string, measurementSalt []byte, enforcedPCRs []uint32, ctx context.Context, cloudServiceAccountURI, versionString string, measurementSalt []byte, enforcedPCRs []uint32,
enforceIDKeyDigest bool, idKeyDigest []byte, azureCVM bool, enforceIDKeyDigest bool, idKeyDigest []byte, azureCVM bool,

View file

@ -45,9 +45,6 @@ func NewCreator(out io.Writer) *Creator {
} }
// Create creates the handed amount of instances and all the needed resources. // Create creates the handed amount of instances and all the needed resources.
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func (c *Creator) Create(ctx context.Context, provider cloudprovider.Provider, config *config.Config, name, insType string, controlPlaneCount, workerCount int, func (c *Creator) Create(ctx context.Context, provider cloudprovider.Provider, config *config.Config, name, insType string, controlPlaneCount, workerCount int,
) (clusterid.File, error) { ) (clusterid.File, error) {
switch provider { switch provider {
@ -88,9 +85,6 @@ func (c *Creator) Create(ctx context.Context, provider cloudprovider.Provider, c
} }
} }
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func (c *Creator) createAWS(ctx context.Context, cl terraformClient, config *config.Config, func (c *Creator) createAWS(ctx context.Context, cl terraformClient, config *config.Config,
name, insType string, controlPlaneCount, workerCount int, name, insType string, controlPlaneCount, workerCount int,
) (idFile clusterid.File, retErr error) { ) (idFile clusterid.File, retErr error) {
@ -127,9 +121,6 @@ func (c *Creator) createAWS(ctx context.Context, cl terraformClient, config *con
}, nil }, nil
} }
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func (c *Creator) createGCP(ctx context.Context, cl terraformClient, config *config.Config, func (c *Creator) createGCP(ctx context.Context, cl terraformClient, config *config.Config,
name, insType string, controlPlaneCount, workerCount int, name, insType string, controlPlaneCount, workerCount int,
) (idFile clusterid.File, retErr error) { ) (idFile clusterid.File, retErr error) {
@ -166,9 +157,6 @@ func (c *Creator) createGCP(ctx context.Context, cl terraformClient, config *con
}, nil }, nil
} }
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func (c *Creator) createAzure(ctx context.Context, cl terraformClient, config *config.Config, func (c *Creator) createAzure(ctx context.Context, cl terraformClient, config *config.Config,
name, insType string, controlPlaneCount, workerCount int, name, insType string, controlPlaneCount, workerCount int,
) (idFile clusterid.File, retErr error) { ) (idFile clusterid.File, retErr error) {
@ -234,9 +222,6 @@ func normalizeAzureURIs(vars terraform.AzureVariables) terraform.AzureVariables
return vars return vars
} }
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func (c *Creator) createQEMU(ctx context.Context, cl terraformClient, lv libvirtRunner, name string, config *config.Config, func (c *Creator) createQEMU(ctx context.Context, cl terraformClient, lv libvirtRunner, name string, config *config.Config,
controlPlaneCount, workerCount int, controlPlaneCount, workerCount int,
) (idFile clusterid.File, retErr error) { ) (idFile clusterid.File, retErr error) {

View file

@ -29,9 +29,6 @@ type stubCloudCreator struct {
createErr error createErr error
} }
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func (c *stubCloudCreator) Create( func (c *stubCloudCreator) Create(
ctx context.Context, ctx context.Context,
provider cloudprovider.Provider, provider cloudprovider.Provider,

View file

@ -77,9 +77,6 @@ func (s *spinner) Write(p []byte) (n int, err error) {
return s.out.Write(p) return s.out.Write(p)
} }
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func spinTTY(out io.Writer, wg *sync.WaitGroup, stop *atomic.Bool, delay time.Duration, text string, showDots bool) { func spinTTY(out io.Writer, wg *sync.WaitGroup, stop *atomic.Bool, delay time.Duration, text string, showDots bool) {
defer wg.Done() defer wg.Done()
@ -106,9 +103,6 @@ func spinTTY(out io.Writer, wg *sync.WaitGroup, stop *atomic.Bool, delay time.Du
fmt.Fprint(out, showCursor) fmt.Fprint(out, showCursor)
} }
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func spinNoTTY(out io.Writer, wg *sync.WaitGroup, _ *atomic.Bool, _ time.Duration, text string, _ bool) { func spinNoTTY(out io.Writer, wg *sync.WaitGroup, _ *atomic.Bool, _ time.Duration, text string, _ bool) {
defer wg.Done() defer wg.Done()
fmt.Fprintln(out, text+"...") fmt.Fprintln(out, text+"...")

View file

@ -70,9 +70,6 @@ func runUpgradePlan(cmd *cobra.Command, args []string) error {
} }
// upgradePlan plans an upgrade of a Constellation cluster. // upgradePlan plans an upgrade of a Constellation cluster.
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func upgradePlan(cmd *cobra.Command, planner upgradePlanner, func upgradePlan(cmd *cobra.Command, planner upgradePlanner,
fileHandler file.Handler, client *http.Client, rekor rekorVerifier, flags upgradePlanFlags, fileHandler file.Handler, client *http.Client, rekor rekorVerifier, flags upgradePlanFlags,
) error { ) error {
@ -182,9 +179,6 @@ func getCompatibleImages(csp cloudprovider.Provider, currentVersion string, imag
} }
// getCompatibleImageMeasurements retrieves the expected measurements for each image. // getCompatibleImageMeasurements retrieves the expected measurements for each image.
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func getCompatibleImageMeasurements(ctx context.Context, cmd *cobra.Command, client *http.Client, rekor rekorVerifier, pubK []byte, images map[string]config.UpgradeConfig) error { func getCompatibleImageMeasurements(ctx context.Context, cmd *cobra.Command, client *http.Client, rekor rekorVerifier, pubK []byte, images map[string]config.UpgradeConfig) error {
for idx, img := range images { for idx, img := range images {
measurementsURL, err := url.Parse(constants.S3PublicBucket + strings.ToLower(img.Image) + "/measurements.yaml") measurementsURL, err := url.Parse(constants.S3PublicBucket + strings.ToLower(img.Image) + "/measurements.yaml")
@ -262,9 +256,6 @@ func parseUpgradePlanFlags(cmd *cobra.Command) (upgradePlanFlags, error) {
}, nil }, nil
} }
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func upgradePlanInteractive(out io.WriteCloser, in io.ReadCloser, func upgradePlanInteractive(out io.WriteCloser, in io.ReadCloser,
configPath string, config *config.Config, fileHandler file.Handler, configPath string, config *config.Config, fileHandler file.Handler,
compatibleImages map[string]config.UpgradeConfig, compatibleImages map[string]config.UpgradeConfig,

View file

@ -217,9 +217,6 @@ func closeCryptDevice(device DeviceMapper, source, volumeID, deviceType string)
} }
// openCryptDevice maps the volume at source to the crypt device identified by volumeID. // openCryptDevice maps the volume at source to the crypt device identified by volumeID.
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func openCryptDevice(ctx context.Context, device DeviceMapper, source, volumeID string, integrity bool, func openCryptDevice(ctx context.Context, device DeviceMapper, source, volumeID string, integrity bool,
getKey func(ctx context.Context, keyID string, keySize int) ([]byte, error), diskInfo func(disk string) (string, error), getKey func(ctx context.Context, keyID string, keySize int) ([]byte, error), diskInfo func(disk string) (string, error),
) (string, error) { ) (string, error) {

View file

@ -51,9 +51,6 @@ type Manager struct {
} }
// New initializes a SetupManager with the given parameters. // New initializes a SetupManager with the given parameters.
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func New(log *logger.Logger, csp string, diskPath string, fs afero.Afero, func New(log *logger.Logger, csp string, diskPath string, fs afero.Afero,
mapper DeviceMapper, mounter Mounter, openTPM vtpm.TPMOpenFunc, mapper DeviceMapper, mounter Mounter, openTPM vtpm.TPMOpenFunc,
) *Manager { ) *Manager {

View file

@ -154,9 +154,6 @@ type Validator struct {
} }
// NewValidator returns a new Validator. // NewValidator returns a new Validator.
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func NewValidator(expectedPCRs map[uint32][]byte, enforcedPCRs []uint32, getTrustedKey GetTPMTrustedAttestationPublicKey, func NewValidator(expectedPCRs map[uint32][]byte, enforcedPCRs []uint32, getTrustedKey GetTPMTrustedAttestationPublicKey,
validateCVM ValidateCVM, verifyUserData VerifyUserData, log AttestationLogger, validateCVM ValidateCVM, verifyUserData VerifyUserData, log AttestationLogger,
) *Validator { ) *Validator {

View file

@ -42,9 +42,6 @@ type Server struct {
} }
// New initializes a new Server. // New initializes a new Server.
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func New( func New(
measurementSalt []byte, fileHandler file.Handler, ca certificateAuthority, measurementSalt []byte, fileHandler file.Handler, ca certificateAuthority,
joinTokenGetter joinTokenGetter, dataKeyGetter dataKeyGetter, log *logger.Logger, joinTokenGetter joinTokenGetter, dataKeyGetter dataKeyGetter, log *logger.Logger,

View file

@ -54,9 +54,6 @@ type KMSClient struct {
} }
// New initializes a KMS client for Google Cloud Platform. // New initializes a KMS client for Google Cloud Platform.
// TODO: Upon changing this function, please refactor it to reduce the number of arguments to <= 5.
//
//revive:disable-next-line
func New(ctx context.Context, projectID, locationID, keyRingID string, store kmsInterface.Storage, protectionLvl kmspb.ProtectionLevel, opts ...gax.CallOption) (*KMSClient, error) { func New(ctx context.Context, projectID, locationID, keyRingID string, store kmsInterface.Storage, protectionLvl kmspb.ProtectionLevel, opts ...gax.CallOption) (*KMSClient, error) {
if store == nil { if store == nil {
store = storage.NewMemMapStorage() store = storage.NewMemMapStorage()