Skip to content

Commit 85540ba

Browse files
committed
fix go vet format string violations for Go 1.26
Signed-off-by: jubittajohn <jujohn@redhat.com>
1 parent b19e51a commit 85540ba

10 files changed

Lines changed: 13 additions & 13 deletions

File tree

pkg/operator/apiserver/controller/apiservice/apigroup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func checkDiscoveryForByAPIServices(ctx context.Context, recorder events.Recorde
7878
err := checkDiscoveryForAPIService(ctx, restclient, apiService)
7979
if err != nil {
8080
groupVersionString := fmt.Sprintf("%s.%s", apiService.Spec.Group, apiService.Spec.Version)
81-
recorder.Warningf("OpenShiftAPICheckFailed", fmt.Sprintf("%q failed with %v", groupVersionString, err))
81+
recorder.Warningf("OpenShiftAPICheckFailed", "%s failed with %v", groupVersionString, err)
8282
missingMessages = append(missingMessages, fmt.Sprintf("%q is not ready: %v", groupVersionString, err))
8383
}
8484
}

pkg/operator/certrotation/client_cert_rotation_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (c CertRotationController) Sync(ctx context.Context, syncCtx factory.SyncCo
126126
return updateErr
127127
}
128128
if updated && syncErr != nil {
129-
syncCtx.Recorder().Warningf("RotationError", syncErr.Error())
129+
syncCtx.Recorder().Warningf("RotationError", "%s", syncErr.Error())
130130
}
131131

132132
return syncErr

pkg/operator/configobserver/etcd/observe_etcd_endpoints.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func innerObserveStorageURLsFromOldEndPoint(genericListers configobserver.Lister
218218
}
219219
} else {
220220
err := fmt.Errorf("endpoints/%s in the %s namespace: no etcd endpoint addresses found, falling back to default etcd service", EtcdEndpointName, EtcdEndpointNamespace)
221-
recorder.Warningf("ObserveStorageFallback", err.Error())
221+
recorder.Warningf("ObserveStorageFallback", "%s", err.Error())
222222
errs = append(errs, err)
223223
}
224224

pkg/operator/configobserver/oauth/observe_tokenconfig.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func ObserveAccessTokenMaxAgeSeconds(genericlisters configobserver.Listers, reco
6161
}
6262

6363
if existingAccessTokenMaxAgeSeconds != observedAccessTokenMaxAgeSeconds {
64-
recorder.Eventf("ObserveAccessTokenMaxAgeSeconds", "%s changed from %d to %d", fieldAccessTokenMaxAgeSeconds,
64+
recorder.Eventf("ObserveAccessTokenMaxAgeSeconds", "%s changed from %f to %f", fieldAccessTokenMaxAgeSeconds,
6565
existingAccessTokenMaxAgeSeconds,
6666
observedAccessTokenMaxAgeSeconds)
6767
}

pkg/operator/encryption/controllers/state_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func (c *stateController) generateAndApplyCurrentEncryptionConfigSecret(ctx cont
153153
currentEncryptionConfig, _ := encryptiondata.ToEncryptionState(currentConfig, encryptionSecrets)
154154
if actionEvents := eventsFromEncryptionConfigChanges(currentEncryptionConfig, desiredEncryptionState); len(actionEvents) > 0 {
155155
for _, event := range actionEvents {
156-
recorder.Eventf(event.reason, event.message)
156+
recorder.Eventf(event.reason, "%s", event.message)
157157
}
158158
}
159159
}

pkg/operator/staticpod/certsyncpod/certsync_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func NewCertSyncController(targetDir, targetNamespace string, configmaps, secret
6666

6767
func (c *CertSyncController) sync(ctx context.Context, syncCtx factory.SyncContext) error {
6868
if err := os.RemoveAll(getStagingDir(c.destinationDir)); err != nil {
69-
c.eventRecorder.Warningf("CertificateUpdateFailed", fmt.Sprintf("Failed to prune staging directory: %v", err))
69+
c.eventRecorder.Warningf("CertificateUpdateFailed", "%s", fmt.Sprintf("Failed to prune staging directory: %v", err))
7070
return err
7171
}
7272

pkg/operator/staticpod/controller/guard/guard_controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,11 +904,11 @@ func TestRenderGuardPodPortChanged(t *testing.T) {
904904

905905
// The port is expected to be set to 99999 by the guard controller
906906
if probe.Port.IntValue() != 99999 {
907-
t.Errorf("unexpected port in ReadinessProbe in the guard, expected %q, got %q instead", ctrl.readyzPort, probe.Port.IntValue())
907+
t.Errorf("unexpected port in ReadinessProbe in the guard, expected %q, got %d instead", ctrl.readyzPort, probe.Port.IntValue())
908908
}
909909
// The port is expected to be different from the one initially set in the guard pod readiness probe
910910
if originalProbe.Port.IntValue() == probe.Port.IntValue() {
911-
t.Errorf("unexpected port in ReadinessProbe in the guard, expected it to be different from %q, got %q", originalProbe.Port.IntValue(), probe.Port.IntValue())
911+
t.Errorf("unexpected port in ReadinessProbe in the guard, expected it to be different from %d, got %d", originalProbe.Port.IntValue(), probe.Port.IntValue())
912912
}
913913

914914
// The path is expected to be set to healthz by the guard controller

pkg/operator/staticpod/controller/installer/installer_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ func (c InstallerController) ensureRequiredResourcesExist(ctx context.Context, r
11191119
for _, err := range aggregatedErr.Errors() {
11201120
eventMessages = append(eventMessages, err.Error())
11211121
}
1122-
c.eventRecorder.Warningf("RequiredInstallerResourcesMissing", strings.Join(eventMessages, ", "))
1122+
c.eventRecorder.Warningf("RequiredInstallerResourcesMissing", "%s", strings.Join(eventMessages, ", "))
11231123
return fmt.Errorf("missing required resources: %v", aggregatedErr)
11241124
}
11251125

pkg/operator/staticpod/controller/installerstate/installer_state_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (c *InstallerStateController) handlePendingInstallerPodsNetworkEvents(ctx c
185185
Message: fmt.Sprintf("Pod %q on node %q observed degraded networking: %s", pod.Name, pod.Spec.NodeName, event.Message),
186186
}
187187
conditions = append(conditions, condition)
188-
recorder.Warningf(condition.Reason, condition.Message)
188+
recorder.Warningf(condition.Reason, "%s", condition.Message)
189189
}
190190
}
191191
return conditions, nil
@@ -204,7 +204,7 @@ func (c *InstallerStateController) handlePendingInstallerPods(recorder events.Re
204204
Message: fmt.Sprintf("Pod %q on node %q is Pending since %s because %s", pod.Name, pod.Spec.NodeName, pod.Status.StartTime.Time, pod.Status.Message),
205205
}
206206
conditions = append(conditions, condition)
207-
recorder.Warningf(condition.Reason, condition.Message)
207+
recorder.Warningf(condition.Reason, "%s", condition.Message)
208208
}
209209

210210
// one or more containers are in waiting state for longer than maxToleratedPodPendingDuration, report the reason and message
@@ -227,7 +227,7 @@ func (c *InstallerStateController) handlePendingInstallerPods(recorder events.Re
227227
Message: message,
228228
}
229229
conditions = append(conditions, condition)
230-
recorder.Warningf(condition.Reason, condition.Message)
230+
recorder.Warningf(condition.Reason, "%s", condition.Message)
231231
}
232232
}
233233
}

pkg/operator/staticpod/controller/node/node_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (c *NodeController) sync(ctx context.Context, syncCtx factory.SyncContext)
182182

183183
oldNodeDegradedCondition := v1helpers.FindOperatorCondition(originalOperatorStatus.Conditions, condition.NodeControllerDegradedConditionType)
184184
if oldNodeDegradedCondition == nil || oldNodeDegradedCondition.Message != *degradedCondition.Message {
185-
syncCtx.Recorder().Eventf("MasterNodesReadyChanged", *degradedCondition.Message)
185+
syncCtx.Recorder().Eventf("MasterNodesReadyChanged", "%s", *degradedCondition.Message)
186186
}
187187
return nil
188188
}

0 commit comments

Comments
 (0)