Skip to content

Commit

Permalink
make compiler happy
Browse files Browse the repository at this point in the history
  • Loading branch information
jsturtevant committed Feb 25, 2022
1 parent c444fdb commit 50a5172
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 57 deletions.
1 change: 1 addition & 0 deletions test/e2e/aks.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand Down
1 change: 1 addition & 0 deletions test/e2e/azure_gpu.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand Down
1 change: 1 addition & 0 deletions test/e2e/azure_lb.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand Down
1 change: 1 addition & 0 deletions test/e2e/azure_machinepool_drain.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand Down
85 changes: 85 additions & 0 deletions test/e2e/e2e_suite.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
//go:build e2e
// +build e2e

/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package e2e

import (
"regexp"

"sigs.k8s.io/cluster-api/test/framework"
"sigs.k8s.io/cluster-api/test/framework/bootstrap"
"sigs.k8s.io/cluster-api/test/framework/clusterctl"
)

const (
kubesystem = "kube-system"
activitylog = "azure-activity-logs"
)

// Test suite flags
var (
// configPath is the path to the e2e config file.
configPath string

// useExistingCluster instructs the test to use the current cluster instead of creating a new one (default discovery rules apply).
useExistingCluster bool

// artifactFolder is the folder to store e2e test artifacts.
artifactFolder string

// skipCleanup prevents cleanup of test resources e.g. for debug purposes.
skipCleanup bool
)

// Test suite global vars
var (
// e2eConfig to be used for this test, read from configPath.
e2eConfig *clusterctl.E2EConfig

// clusterctlConfigPath to be used for this test, created by generating a clusterctl local repository
// with the providers specified in the configPath.
clusterctlConfigPath string

// bootstrapClusterProvider manages provisioning of the the bootstrap cluster to be used for the e2e tests.
// Please note that provisioning will be skipped if e2e.use-existing-cluster is provided.
bootstrapClusterProvider bootstrap.ClusterProvider

// bootstrapClusterProxy allows to interact with the bootstrap cluster to be used for the e2e tests.
bootstrapClusterProxy framework.ClusterProxy

// kubetestConfigFilePath is the path to the kubetest configuration file
kubetestConfigFilePath string

// kubetestRepoListPath
kubetestRepoListPath string

// useCIArtifacts specifies whether or not to use the latest build from the main branch of the Kubernetes repository
useCIArtifacts bool

// usePRArtifacts specifies whether or not to use the build from a PR of the Kubernetes repository
usePRArtifacts bool
)

// validateStableReleaseString validates the string format that declares "get be the latest stable release for this <Major>.<Minor>"
// it should be called wherever we process a stable version string expression like "stable-1.22"
func validateStableReleaseString(stableVersion string) (bool, []string) {
stableReleaseFormat := regexp.MustCompile(`^stable-(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$`)
matches := stableReleaseFormat.FindStringSubmatch(stableVersion)
return len(matches) > 0, matches
}
57 changes: 0 additions & 57 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,55 +59,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

const (
kubesystem = "kube-system"
activitylog = "azure-activity-logs"
)

// Test suite flags
var (
// configPath is the path to the e2e config file.
configPath string

// useExistingCluster instructs the test to use the current cluster instead of creating a new one (default discovery rules apply).
useExistingCluster bool

// artifactFolder is the folder to store e2e test artifacts.
artifactFolder string

// skipCleanup prevents cleanup of test resources e.g. for debug purposes.
skipCleanup bool
)

// Test suite global vars
var (
// e2eConfig to be used for this test, read from configPath.
e2eConfig *clusterctl.E2EConfig

// clusterctlConfigPath to be used for this test, created by generating a clusterctl local repository
// with the providers specified in the configPath.
clusterctlConfigPath string

// bootstrapClusterProvider manages provisioning of the the bootstrap cluster to be used for the e2e tests.
// Please note that provisioning will be skipped if e2e.use-existing-cluster is provided.
bootstrapClusterProvider bootstrap.ClusterProvider

// bootstrapClusterProxy allows to interact with the bootstrap cluster to be used for the e2e tests.
bootstrapClusterProxy framework.ClusterProxy

// kubetestConfigFilePath is the path to the kubetest configuration file
kubetestConfigFilePath string

// kubetestRepoListPath
kubetestRepoListPath string

// useCIArtifacts specifies whether or not to use the latest build from the main branch of the Kubernetes repository
useCIArtifacts bool

// usePRArtifacts specifies whether or not to use the build from a PR of the Kubernetes repository
usePRArtifacts bool
)

type (
AzureClusterProxy struct {
framework.ClusterProxy
Expand Down Expand Up @@ -571,11 +522,3 @@ func getLatestSkuForMinor(version string, skus semver.Versions) string {
// otherwise, we just return the version as-is. This allows for versions in other formats, such as "latest" or "latest-1.21".
return version
}

// validateStableReleaseString validates the string format that declares "get be the latest stable release for this <Major>.<Minor>"
// it should be called wherever we process a stable version string expression like "stable-1.22"
func validateStableReleaseString(stableVersion string) (bool, []string) {
stableReleaseFormat := regexp.MustCompile(`^stable-(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$`)
matches := stableReleaseFormat.FindStringSubmatch(stableVersion)
return len(matches) > 0, matches
}
1 change: 1 addition & 0 deletions test/e2e/helpers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand Down
1 change: 1 addition & 0 deletions test/e2e/kubernetes/namespace/namespace.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand Down
1 change: 1 addition & 0 deletions test/e2e/kubescape.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/log.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build e2e
// +build e2e

/*
Copyright 2021 The Kubernetes Authors.
Expand Down
1 change: 1 addition & 0 deletions test/e2e/retry.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand Down

0 comments on commit 50a5172

Please sign in to comment.