File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,12 @@ type Environment struct {
126
126
// loading.
127
127
Config * rest.Config
128
128
129
+ // KubeConfig provides []byte of a kubeconfig file to talk to the apiserver
130
+ // It's automatically
131
+ // populated if not set using the standard controller-runtime config
132
+ // loading.
133
+ KubeConfig []byte
134
+
129
135
// CRDInstallOptions are the options for installing CRDs.
130
136
CRDInstallOptions CRDInstallOptions
131
137
@@ -221,6 +227,10 @@ func (te *Environment) Start() (*rest.Config, error) {
221
227
if err != nil {
222
228
return nil , fmt .Errorf ("unable to get configuration for existing cluster: %w" , err )
223
229
}
230
+ te .KubeConfig , err = controlplane .KubeConfigFromREST (te .Config )
231
+ if err != nil {
232
+ return nil , fmt .Errorf ("unable to convert configuration to kubeconfig: %w" , err )
233
+ }
224
234
}
225
235
} else {
226
236
apiServer := te .ControlPlane .GetAPIServer ()
You can’t perform that action at this time.
0 commit comments