Skip to content

Commit 294af4f

Browse files
committed
Update to use new internal/testing paths
This updates envtests, etc to use to the new refactored internal/testing/xyz paths (certs, addr, controlplane).
1 parent 9d53bf1 commit 294af4f

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

pkg/builder/builder_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
"k8s.io/client-go/rest"
3030
"sigs.k8s.io/controller-runtime/pkg/envtest"
3131
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
32-
"sigs.k8s.io/controller-runtime/pkg/internal/testing/integration/addr"
32+
"sigs.k8s.io/controller-runtime/pkg/internal/testing/addr"
3333
logf "sigs.k8s.io/controller-runtime/pkg/log"
3434
"sigs.k8s.io/controller-runtime/pkg/log/zap"
3535
"sigs.k8s.io/controller-runtime/pkg/metrics"

pkg/envtest/server.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"k8s.io/client-go/rest"
2929
"sigs.k8s.io/controller-runtime/pkg/client"
3030
"sigs.k8s.io/controller-runtime/pkg/client/config"
31-
"sigs.k8s.io/controller-runtime/pkg/internal/testing/integration"
31+
"sigs.k8s.io/controller-runtime/pkg/internal/testing/controlplane"
3232

3333
logf "sigs.k8s.io/controller-runtime/pkg/internal/log"
3434
)
@@ -82,20 +82,20 @@ func (te *Environment) getBinAssetPath(binary string) string {
8282
return filepath.Join(defaultKubebuilderPath, binary)
8383
}
8484

85-
// ControlPlane is the re-exported ControlPlane type from the internal integration package
86-
type ControlPlane = integration.ControlPlane
85+
// ControlPlane is the re-exported ControlPlane type from the internal testing package
86+
type ControlPlane = controlplane.ControlPlane
8787

88-
// APIServer is the re-exported APIServer type from the internal integration package
89-
type APIServer = integration.APIServer
88+
// APIServer is the re-exported APIServer type from the internal testing package
89+
type APIServer = controlplane.APIServer
9090

91-
// Etcd is the re-exported Etcd type from the internal integration package
92-
type Etcd = integration.Etcd
91+
// Etcd is the re-exported Etcd type from the internal testing package
92+
type Etcd = controlplane.Etcd
9393

9494
// Environment creates a Kubernetes test environment that will start / stop the Kubernetes control plane and
9595
// install extension APIs
9696
type Environment struct {
9797
// ControlPlane is the ControlPlane including the apiserver and etcd
98-
ControlPlane integration.ControlPlane
98+
ControlPlane controlplane.ControlPlane
9999

100100
// Scheme is used to determine if conversion webhooks should be enabled
101101
// for a particular CRD / object.
@@ -219,10 +219,10 @@ func (te *Environment) Start() (*rest.Config, error) {
219219
}
220220
} else {
221221
if te.ControlPlane.APIServer == nil {
222-
te.ControlPlane.APIServer = &integration.APIServer{Args: te.getAPIServerFlags()}
222+
te.ControlPlane.APIServer = &controlplane.APIServer{Args: te.getAPIServerFlags()}
223223
}
224224
if te.ControlPlane.Etcd == nil {
225-
te.ControlPlane.Etcd = &integration.Etcd{}
225+
te.ControlPlane.Etcd = &controlplane.Etcd{}
226226
}
227227

228228
if os.Getenv(envAttachOutput) == "true" {
@@ -357,4 +357,4 @@ func (te *Environment) useExistingCluster() bool {
357357

358358
// DefaultKubeAPIServerFlags exposes the default args for the APIServer so that
359359
// you can use those to append your own additional arguments.
360-
var DefaultKubeAPIServerFlags = integration.APIServerDefaultArgs
360+
var DefaultKubeAPIServerFlags = controlplane.APIServerDefaultArgs

pkg/envtest/webhook.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ import (
3333
"k8s.io/apimachinery/pkg/util/wait"
3434
"k8s.io/client-go/rest"
3535
"sigs.k8s.io/controller-runtime/pkg/client"
36-
"sigs.k8s.io/controller-runtime/pkg/internal/testing/integration"
37-
"sigs.k8s.io/controller-runtime/pkg/internal/testing/integration/addr"
36+
"sigs.k8s.io/controller-runtime/pkg/internal/testing/addr"
37+
"sigs.k8s.io/controller-runtime/pkg/internal/testing/certs"
3838
"sigs.k8s.io/yaml"
3939
)
4040

@@ -274,7 +274,7 @@ func (p *webhookPoller) poll() (done bool, err error) {
274274

275275
// setupCA creates CA for testing and writes them to disk
276276
func (o *WebhookInstallOptions) setupCA() error {
277-
hookCA, err := integration.NewTinyCA()
277+
hookCA, err := certs.NewTinyCA()
278278
if err != nil {
279279
return fmt.Errorf("unable to set up webhook CA: %v", err)
280280
}

0 commit comments

Comments
 (0)