45
45
moreThanOneCoreProviderInstanceExistsMessage = "CoreProvider already exists in the cluster. Only one is allowed."
46
46
moreThanOneProviderInstanceExistsMessage = "There is already a %s with name %s in the cluster. Only one is allowed."
47
47
capiVersionIncompatibilityMessage = "CAPI operator is only compatible with %s providers, detected %s for provider %s."
48
- invalidGithubTokenMessage = "Invalid github token, please check your github token value and its permissions" //nolint:gosec
49
- waitingForCoreProviderReadyMessage = "Waiting for the core provider to be installed."
50
- incorrectCoreProviderNameMessage = "Incorrect CoreProvider name: %s. It should be %s"
51
- unsupportedProviderDowngradeMessage = "Downgrade is not supported for provider %s"
52
48
)
53
49
54
50
// preflightChecks performs preflight checks before installing provider.
@@ -73,7 +69,7 @@ func preflightChecks(ctx context.Context, c client.Client, provider genericprovi
73
69
operatorv1 .PreflightCheckCondition ,
74
70
operatorv1 .IncorrectCoreProviderNameReason ,
75
71
clusterv1 .ConditionSeverityError ,
76
- fmt . Sprintf ( incorrectCoreProviderNameMessage , provider . GetName (), configclient . ClusterAPIProviderName ) ,
72
+ "Incorrect CoreProvider name" ,
77
73
))
78
74
79
75
return ctrl.Result {}, fmt .Errorf ("incorrect CoreProvider name: %s, it should be %s" , provider .GetName (), configclient .ClusterAPIProviderName )
@@ -129,7 +125,7 @@ func preflightChecks(ctx context.Context, c client.Client, provider genericprovi
129
125
operatorv1 .PreflightCheckCondition ,
130
126
operatorv1 .InvalidGithubTokenReason ,
131
127
clusterv1 .ConditionSeverityError ,
132
- invalidGithubTokenMessage ,
128
+ "Invalid github token, please check your github token value and its permissions" ,
133
129
))
134
130
135
131
return ctrl.Result {}, fmt .Errorf ("failed to validate provided github token: %w" , err )
@@ -182,12 +178,11 @@ func preflightChecks(ctx context.Context, c client.Client, provider genericprovi
182
178
}
183
179
184
180
if ! ready {
185
- log .Info (waitingForCoreProviderReadyMessage )
186
181
conditions .Set (provider , conditions .FalseCondition (
187
182
operatorv1 .PreflightCheckCondition ,
188
183
operatorv1 .WaitingForCoreProviderReadyReason ,
189
184
clusterv1 .ConditionSeverityInfo ,
190
- waitingForCoreProviderReadyMessage ,
185
+ "Waiting for the core provider to be installed." ,
191
186
))
192
187
193
188
return ctrl.Result {RequeueAfter : preflightFailedRequeueAfter }, nil
@@ -213,7 +208,7 @@ func checkProviderVersion(ctx context.Context, providerVersion string, provider
213
208
operatorv1 .PreflightCheckCondition ,
214
209
operatorv1 .IncorrectVersionFormatReason ,
215
210
clusterv1 .ConditionSeverityError ,
216
- err .Error (),
211
+ "%s" , err .Error (),
217
212
))
218
213
219
214
return fmt .Errorf ("version contains invalid value for provider %q" , provider .GetName ())
@@ -231,7 +226,7 @@ func checkProviderVersion(ctx context.Context, providerVersion string, provider
231
226
operatorv1 .PreflightCheckCondition ,
232
227
operatorv1 .UnsupportedProviderDowngradeReason ,
233
228
clusterv1 .ConditionSeverityError ,
234
- fmt . Sprintf ( unsupportedProviderDowngradeMessage , provider . GetName ()) ,
229
+ "Downgrade is not supported for provider" ,
235
230
))
236
231
237
232
return fmt .Errorf ("downgrade is not supported for provider %q" , provider .GetName ())
0 commit comments