@@ -57,12 +57,14 @@ type InitInput struct {
57
57
}
58
58
59
59
// 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 " ,
62
62
input .CoreProvider ,
63
63
strings .Join (input .BootstrapProviders , "," ),
64
64
strings .Join (input .ControlPlaneProviders , "," ),
65
65
strings .Join (input .InfrastructureProviders , "," ),
66
+ input .ClusterctlConfigPath ,
67
+ input .KubeconfigPath ,
66
68
)
67
69
68
70
initOpt := clusterctlclient.InitOptions {
@@ -75,6 +77,7 @@ func Init(ctx context.Context, input InitInput) {
75
77
ControlPlaneProviders : input .ControlPlaneProviders ,
76
78
InfrastructureProviders : input .InfrastructureProviders ,
77
79
LogUsageInstructions : true ,
80
+ WaitProviders : true ,
78
81
}
79
82
80
83
clusterctlClient , log := getClusterctlClientWithLogger (input .ClusterctlConfigPath , "clusterctl-init.log" , input .LogFolder )
@@ -86,11 +89,13 @@ func Init(ctx context.Context, input InitInput) {
86
89
87
90
// InitWithBinary uses clusterctl binary to run init with the list of providers defined in the local repository.
88
91
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 " ,
90
93
input .CoreProvider ,
91
94
strings .Join (input .BootstrapProviders , "," ),
92
95
strings .Join (input .ControlPlaneProviders , "," ),
93
96
strings .Join (input .InfrastructureProviders , "," ),
97
+ input .ClusterctlConfigPath ,
98
+ input .KubeconfigPath ,
94
99
)
95
100
96
101
cmd := exec .Command (binary , "init" , //nolint:gosec // We don't care about command injection here.
@@ -123,16 +128,19 @@ type UpgradeInput struct {
123
128
124
129
// Upgrade calls clusterctl upgrade apply with the list of providers defined in the local repository.
125
130
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 " ,
127
132
input .Contract ,
133
+ input .ClusterctlConfigPath ,
134
+ input .KubeconfigPath ,
128
135
)
129
136
130
137
upgradeOpt := clusterctlclient.ApplyUpgradeOptions {
131
138
Kubeconfig : clusterctlclient.Kubeconfig {
132
139
Path : input .KubeconfigPath ,
133
140
Context : "" ,
134
141
},
135
- Contract : input .Contract ,
142
+ Contract : input .Contract ,
143
+ WaitProviders : true ,
136
144
}
137
145
138
146
clusterctlClient , log := getClusterctlClientWithLogger (input .ClusterctlConfigPath , "clusterctl-upgrade.log" , input .LogFolder )
0 commit comments