Skip to content

Commit

Permalink
Remove supfluous context in ForSpec() func (#6867)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdoherty4 authored Nov 3, 2023
1 parent 0ded1f5 commit 2b4c1a4
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/eksctl-anywhere/cmd/createcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (cc *createClusterOptions) createCluster(cmd *cobra.Command, _ []string) er
}
}

factory := dependencies.ForSpec(ctx, clusterSpec).WithExecutableMountDirs(dirs...).
factory := dependencies.ForSpec(clusterSpec).WithExecutableMountDirs(dirs...).
WithBootstrapper().
WithCliConfig(cliConfig).
WithClusterManager(clusterSpec.Cluster, clusterManagerTimeoutOpts).
Expand Down
2 changes: 1 addition & 1 deletion cmd/eksctl-anywhere/cmd/deletecluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (dc *deleteClusterOptions) deleteCluster(ctx context.Context) error {
return err
}

deps, err := dependencies.ForSpec(ctx, clusterSpec).WithExecutableMountDirs(dirs...).
deps, err := dependencies.ForSpec(clusterSpec).WithExecutableMountDirs(dirs...).
WithBootstrapper().
WithCliConfig(cliConfig).
WithClusterManager(clusterSpec.Cluster, nil).
Expand Down
2 changes: 1 addition & 1 deletion cmd/eksctl-anywhere/cmd/generatebundleconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (gsbo *generateSupportBundleOptions) generateBundleConfig(ctx context.Conte
return nil, fmt.Errorf("unable to get cluster config from file: %v", err)
}

deps, err := dependencies.ForSpec(ctx, clusterSpec).
deps, err := dependencies.ForSpec(clusterSpec).
WithProvider(clusterConfigPath, clusterSpec.Cluster, cc.skipIpCheck, gsbo.hardwareFileName, false, gsbo.tinkerbellBootstrapIP, map[string]bool{}, nil).
WithDiagnosticBundleFactory().
Build(ctx)
Expand Down
2 changes: 1 addition & 1 deletion cmd/eksctl-anywhere/cmd/supportbundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (csbo *createSupportBundleOptions) createBundle(ctx context.Context, since,
return fmt.Errorf("unable to get cluster config from file: %v", err)
}

deps, err := dependencies.ForSpec(ctx, clusterSpec).
deps, err := dependencies.ForSpec(clusterSpec).
WithProvider(csbo.fileName, clusterSpec.Cluster, cc.skipIpCheck, csbo.hardwareFileName, false, csbo.tinkerbellBootstrapIP, map[string]bool{}, nil).
WithDiagnosticBundleFactory().
Build(ctx)
Expand Down
2 changes: 1 addition & 1 deletion cmd/eksctl-anywhere/cmd/upgradecluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (uc *upgradeClusterOptions) upgradeCluster(cmd *cobra.Command, args []strin
}
}

factory := dependencies.ForSpec(ctx, clusterSpec).WithExecutableMountDirs(dirs...).
factory := dependencies.ForSpec(clusterSpec).WithExecutableMountDirs(dirs...).
WithBootstrapper().
WithCliConfig(cliConfig).
WithClusterManager(clusterSpec.Cluster, clusterManagerTimeoutOpts).
Expand Down
2 changes: 1 addition & 1 deletion cmd/eksctl-anywhere/cmd/upgradeplancluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (uc *upgradeClusterOptions) upgradePlanCluster(ctx context.Context) error {
return err
}

deps, err := dependencies.ForSpec(ctx, newClusterSpec).
deps, err := dependencies.ForSpec(newClusterSpec).
WithClusterManager(newClusterSpec.Cluster, nil).
WithProvider(uc.fileName, newClusterSpec.Cluster, false, uc.hardwareCSVPath, uc.forceClean, uc.tinkerbellBootstrapIP, map[string]bool{}, uc.providerOptions).
WithGitOpsFlux(newClusterSpec.Cluster, newClusterSpec.FluxConfig, nil).
Expand Down
2 changes: 1 addition & 1 deletion cmd/eksctl-anywhere/cmd/validatecreatecluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (valOpt *validateOptions) validateCreateCluster(cmd *cobra.Command, _ []str
if err != nil {
return err
}
deps, err := dependencies.ForSpec(ctx, clusterSpec).
deps, err := dependencies.ForSpec(clusterSpec).
WithExecutableMountDirs(dirs...).
WithWriterFolder(tmpPath).
WithDocker().
Expand Down
3 changes: 2 additions & 1 deletion pkg/dependencies/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ func (d *Dependencies) Close(ctx context.Context) error {
return nil
}

func ForSpec(ctx context.Context, clusterSpec *cluster.Spec) *Factory {
// ForSpec constructs a Factory using the bundle referenced by clusterSpec.
func ForSpec(clusterSpec *cluster.Spec) *Factory {
versionsBundle := clusterSpec.RootVersionsBundle()
eksaToolsImage := versionsBundle.Eksa.CliTools
return NewFactory().
Expand Down

0 comments on commit 2b4c1a4

Please sign in to comment.