Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziopandini committed Apr 26, 2021
1 parent 9d1ab79 commit d12ba1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions test/e2e/clusterctl_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
})

It("Should create a management cluster and then upgrade all the providers", func() {

By("Creating a workload cluster to be used as a new management cluster")
// NOTE: given that the bootstrap cluster could be shared by several tests, it is not practical to use it for testing clusterctl upgrades.
// So we are creating a workload cluster that will be used as a new management cluster where to install older version of providers
Expand Down Expand Up @@ -127,15 +126,15 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
// Get a ClusterBroker so we can interact with the workload cluster
managementClusterProxy = input.BootstrapClusterProxy.GetWorkloadCluster(context.TODO(), cluster.Namespace, cluster.Name)

var binaryUrl string
var binaryURL string
if input.E2EConfig.HasVariable("INIT_WITH_BINARY") {
binaryUrl = input.E2EConfig.GetVariable("INIT_WITH_BINARY")
binaryUrl = strings.ReplaceAll(binaryUrl, "{OS}", runtime.GOOS)
binaryUrl = strings.ReplaceAll(binaryUrl, "{ARCH}", runtime.GOARCH)
binaryURL = input.E2EConfig.GetVariable("INIT_WITH_BINARY")
binaryURL = strings.ReplaceAll(binaryURL, "{OS}", runtime.GOOS)
binaryURL = strings.ReplaceAll(binaryURL, "{ARCH}", runtime.GOARCH)
}

log.Logf("downloading clusterctl binary from %s", binaryUrl)
binaryFile := downloadToTmpFile(binaryUrl)
log.Logf("downloading clusterctl binary from %s", binaryURL)
binaryFile := downloadToTmpFile(binaryURL)
defer os.Remove(binaryFile) // clean up

err := os.Chmod(binaryFile, 0744)
Expand Down
4 changes: 2 additions & 2 deletions test/framework/clusterctl/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func Init(ctx context.Context, input InitInput) {
Expect(err).ToNot(HaveOccurred(), "failed to run clusterctl init")
}

// InitWithBinary uses clusterctl binary to run init with the list of providers defined in the local repository
// InitWithBinary uses clusterctl binary to run init with the list of providers defined in the local repository.
func InitWithBinary(_ context.Context, binary string, input InitInput) {
log.Logf("clusterctl init --core %s --bootstrap %s --control-plane %s --infrastructure %s",
input.CoreProvider,
Expand Down Expand Up @@ -117,7 +117,7 @@ type UpgradeInput struct {
Contract string
}

// Upgrade calls clusterctl upgrade apply with the list of providers defined in the local repository
// Upgrade calls clusterctl upgrade apply with the list of providers defined in the local repository.
func Upgrade(ctx context.Context, input UpgradeInput) {
log.Logf("clusterctl upgrade apply --management-group %s --contract %s",
input.ManagementGroup,
Expand Down

0 comments on commit d12ba1e

Please sign in to comment.