Surpress argument-limit errors and add TODO. (#603)

This commit is contained in:
Otto Bittner 2022-11-21 17:31:01 +01:00 committed by GitHub
parent adc09a1ad1
commit 1362e40f53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 66 additions and 0 deletions

View file

@ -45,6 +45,9 @@ func NewCreator(out io.Writer) *Creator {
}
// 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,
) (clusterid.File, error) {
switch provider {
@ -85,6 +88,9 @@ 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,
name, insType string, controlPlaneCount, workerCount int,
) (idFile clusterid.File, retErr error) {
@ -121,6 +127,9 @@ func (c *Creator) createAWS(ctx context.Context, cl terraformClient, config *con
}, 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,
name, insType string, controlPlaneCount, workerCount int,
) (idFile clusterid.File, retErr error) {
@ -157,6 +166,9 @@ func (c *Creator) createGCP(ctx context.Context, cl terraformClient, config *con
}, 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,
name, insType string, controlPlaneCount, workerCount int,
) (idFile clusterid.File, retErr error) {
@ -222,6 +234,9 @@ func normalizeAzureURIs(vars terraform.AzureVariables) terraform.AzureVariables
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,
controlPlaneCount, workerCount int,
) (idFile clusterid.File, retErr error) {

View file

@ -29,6 +29,9 @@ type stubCloudCreator struct {
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(
ctx context.Context,
provider cloudprovider.Provider,

View file

@ -77,6 +77,9 @@ func (s *spinner) Write(p []byte) (n int, err error) {
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) {
defer wg.Done()
@ -103,6 +106,9 @@ func spinTTY(out io.Writer, wg *sync.WaitGroup, stop *atomic.Bool, delay time.Du
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) {
defer wg.Done()
fmt.Fprintln(out, text+"...")

View file

@ -70,6 +70,9 @@ func runUpgradePlan(cmd *cobra.Command, args []string) error {
}
// 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,
fileHandler file.Handler, client *http.Client, rekor rekorVerifier, flags upgradePlanFlags,
) error {
@ -179,6 +182,9 @@ func getCompatibleImages(csp cloudprovider.Provider, currentVersion string, imag
}
// 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 {
for idx, img := range images {
measurementsURL, err := url.Parse(constants.S3PublicBucket + strings.ToLower(img.Image) + "/measurements.yaml")
@ -256,6 +262,9 @@ func parseUpgradePlanFlags(cmd *cobra.Command) (upgradePlanFlags, error) {
}, 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,
configPath string, config *config.Config, fileHandler file.Handler,
compatibleImages map[string]config.UpgradeConfig,