Skip to content

Commit 1791511

Browse files
committed
e2e: improve logging, enable wait for providers
1 parent e4c5bcf commit 1791511

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

test/framework/clusterctl/client.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ type InitInput struct {
5757
}
5858

5959
// Init calls clusterctl init with the list of providers defined in the local repository.
60-
func Init(ctx context.Context, input InitInput) {
61-
log.Logf("clusterctl init --core %s --bootstrap %s --control-plane %s --infrastructure %s",
60+
func Init(_ context.Context, input InitInput) {
61+
log.Logf("clusterctl init --core %s --bootstrap %s --control-plane %s --infrastructure %s --config %s --kubeconfig %s",
6262
input.CoreProvider,
6363
strings.Join(input.BootstrapProviders, ","),
6464
strings.Join(input.ControlPlaneProviders, ","),
6565
strings.Join(input.InfrastructureProviders, ","),
66+
input.ClusterctlConfigPath,
67+
input.KubeconfigPath,
6668
)
6769

6870
initOpt := clusterctlclient.InitOptions{
@@ -75,6 +77,7 @@ func Init(ctx context.Context, input InitInput) {
7577
ControlPlaneProviders: input.ControlPlaneProviders,
7678
InfrastructureProviders: input.InfrastructureProviders,
7779
LogUsageInstructions: true,
80+
WaitProviders: true,
7881
}
7982

8083
clusterctlClient, log := getClusterctlClientWithLogger(input.ClusterctlConfigPath, "clusterctl-init.log", input.LogFolder)
@@ -86,11 +89,13 @@ func Init(ctx context.Context, input InitInput) {
8689

8790
// InitWithBinary uses clusterctl binary to run init with the list of providers defined in the local repository.
8891
func InitWithBinary(_ context.Context, binary string, input InitInput) {
89-
log.Logf("clusterctl init --core %s --bootstrap %s --control-plane %s --infrastructure %s",
92+
log.Logf("clusterctl init --core %s --bootstrap %s --control-plane %s --infrastructure %s --config %s --kubeconfig %s",
9093
input.CoreProvider,
9194
strings.Join(input.BootstrapProviders, ","),
9295
strings.Join(input.ControlPlaneProviders, ","),
9396
strings.Join(input.InfrastructureProviders, ","),
97+
input.ClusterctlConfigPath,
98+
input.KubeconfigPath,
9499
)
95100

96101
cmd := exec.Command(binary, "init", //nolint:gosec // We don't care about command injection here.
@@ -123,16 +128,19 @@ type UpgradeInput struct {
123128

124129
// Upgrade calls clusterctl upgrade apply with the list of providers defined in the local repository.
125130
func Upgrade(ctx context.Context, input UpgradeInput) {
126-
log.Logf("clusterctl upgrade apply --contract %s",
131+
log.Logf("clusterctl upgrade apply --contract %s --config %s --kubeconfig %s",
127132
input.Contract,
133+
input.ClusterctlConfigPath,
134+
input.KubeconfigPath,
128135
)
129136

130137
upgradeOpt := clusterctlclient.ApplyUpgradeOptions{
131138
Kubeconfig: clusterctlclient.Kubeconfig{
132139
Path: input.KubeconfigPath,
133140
Context: "",
134141
},
135-
Contract: input.Contract,
142+
Contract: input.Contract,
143+
WaitProviders: true,
136144
}
137145

138146
clusterctlClient, log := getClusterctlClientWithLogger(input.ClusterctlConfigPath, "clusterctl-upgrade.log", input.LogFolder)

0 commit comments

Comments
 (0)