@@ -26,8 +26,12 @@ import (
26
26
"k8s.io/client-go/rest"
27
27
"sigs.k8s.io/controller-runtime/pkg/client/config"
28
28
"sigs.k8s.io/testing_frameworks/integration"
29
+
30
+ logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
29
31
)
30
32
33
+ var log = logf .KBLog .WithName ("test-env" )
34
+
31
35
// Default binary path for test framework
32
36
const (
33
37
envKubeAPIServerBin = "TEST_ASSET_KUBE_APISERVER"
@@ -117,9 +121,11 @@ func (te Environment) getAPIServerFlags() []string {
117
121
// Start starts a local Kubernetes server and updates te.ApiserverPort with the port it is listening on
118
122
func (te * Environment ) Start () (* rest.Config , error ) {
119
123
if te .UseExistingCluster {
124
+ log .V (1 ).Info ("using existing cluster" )
120
125
if te .Config == nil {
121
126
// we want to allow people to pass in their own config, so
122
127
// only load a config if it hasn't already been set.
128
+ log .V (1 ).Info ("automatically acquiring client configuration" )
123
129
124
130
var err error
125
131
te .Config , err = config .GetConfig ()
@@ -153,6 +159,7 @@ func (te *Environment) Start() (*rest.Config, error) {
153
159
te .ControlPlane .APIServer .StartTimeout = te .ControlPlaneStartTimeout
154
160
te .ControlPlane .APIServer .StopTimeout = te .ControlPlaneStopTimeout
155
161
162
+ log .V (1 ).Info ("starting control plane" , "api server flags" , te .ControlPlane .APIServer .Args )
156
163
if err := te .startControlPlane (); err != nil {
157
164
return nil , err
158
165
}
@@ -163,6 +170,7 @@ func (te *Environment) Start() (*rest.Config, error) {
163
170
}
164
171
}
165
172
173
+ log .V (1 ).Info ("installing CRDs" )
166
174
_ , err := InstallCRDs (te .Config , CRDInstallOptions {
167
175
Paths : te .CRDDirectoryPaths ,
168
176
CRDs : te .CRDs ,
@@ -179,6 +187,7 @@ func (te *Environment) startControlPlane() error {
179
187
if err == nil {
180
188
break
181
189
}
190
+ log .Error (err , "unable to start the controlplane" , "tries" , numTries )
182
191
}
183
192
if numTries == maxRetries {
184
193
return fmt .Errorf ("failed to start the controlplane. retried %d times: %v" , numTries , err )
0 commit comments