@@ -2,11 +2,11 @@ package kubernetes
22
33import (
44 "bytes"
5- "fmt"
65 "io"
76 "os"
87 "path"
98 "sort"
9+ "strconv"
1010 "strings"
1111 "testing"
1212
@@ -292,6 +292,7 @@ func TestAnnotate(t *testing.T) {
292292 var out bytes.Buffer
293293 in := []io.Reader {inputFile }
294294 for i , annotation := range tt .annotations {
295+ annotation := annotation
295296 annotator := NewK8sAnnotator (K8sAnnotatorConfig {
296297 TargetResource : & annotation .targetResource ,
297298 TargetNamespace : & annotation .targetNamespace ,
@@ -423,39 +424,39 @@ func TestGetDaprAnnotations(t *testing.T) {
423424
424425 assert .Equal (t , "true" , annotations [daprEnabledKey ])
425426 assert .Equal (t , appID , annotations [daprAppIDKey ])
426- assert .Equal (t , fmt . Sprintf ( "%d" , appPort ), annotations [daprAppPortKey ])
427+ assert .Equal (t , strconv . Itoa ( appPort ), annotations [daprAppPortKey ])
427428 assert .Equal (t , config , annotations [daprConfigKey ])
428429 assert .Equal (t , appProtocol , annotations [daprAppProtocolKey ])
429430 assert .Equal (t , "true" , annotations [daprEnableProfilingKey ])
430431 assert .Equal (t , logLevel , annotations [daprLogLevelKey ])
431432 assert .Equal (t , apiTokenSecret , annotations [daprAPITokenSecretKey ])
432433 assert .Equal (t , appTokenSecret , annotations [daprAppTokenSecretKey ])
433434 assert .Equal (t , "true" , annotations [daprLogAsJSONKey ])
434- assert .Equal (t , fmt . Sprintf ( "%d" , appMaxConcurrency ), annotations [daprAppMaxConcurrencyKey ])
435+ assert .Equal (t , strconv . Itoa ( appMaxConcurrency ), annotations [daprAppMaxConcurrencyKey ])
435436 assert .Equal (t , "true" , annotations [daprEnableMetricsKey ])
436- assert .Equal (t , fmt . Sprintf ( "%d" , metricsPort ), annotations [daprMetricsPortKey ])
437+ assert .Equal (t , strconv . Itoa ( metricsPort ), annotations [daprMetricsPortKey ])
437438 assert .Equal (t , "true" , annotations [daprEnableDebugKey ])
438- assert .Equal (t , fmt . Sprintf ( "%d" , debugPort ), annotations [daprDebugPortKey ])
439+ assert .Equal (t , strconv . Itoa ( debugPort ), annotations [daprDebugPortKey ])
439440 assert .Equal (t , env , annotations [daprEnvKey ])
440441 assert .Equal (t , cpuLimit , annotations [daprCPULimitKey ])
441442 assert .Equal (t , memoryLimit , annotations [daprMemoryLimitKey ])
442443 assert .Equal (t , cpuRequest , annotations [daprCPURequestKey ])
443444 assert .Equal (t , memoryRequest , annotations [daprMemoryRequestKey ])
444445 assert .Equal (t , listenAddresses , annotations [daprListenAddressesKey ])
445- assert .Equal (t , fmt . Sprintf ( "%d" , livenessProbeDelay ), annotations [daprLivenessProbeDelayKey ])
446- assert .Equal (t , fmt . Sprintf ( "%d" , livenessProbeTimeout ), annotations [daprLivenessProbeTimeoutKey ])
447- assert .Equal (t , fmt . Sprintf ( "%d" , livenessProbePeriod ), annotations [daprLivenessProbePeriodKey ])
448- assert .Equal (t , fmt . Sprintf ( "%d" , livenessProbeThreshold ), annotations [daprLivenessProbeThresholdKey ])
449- assert .Equal (t , fmt . Sprintf ( "%d" , readinessProbeDelay ), annotations [daprReadinessProbeDelayKey ])
450- assert .Equal (t , fmt . Sprintf ( "%d" , readinessProbeTimeout ), annotations [daprReadinessProbeTimeoutKey ])
451- assert .Equal (t , fmt . Sprintf ( "%d" , readinessProbePeriod ), annotations [daprReadinessProbePeriodKey ])
452- assert .Equal (t , fmt . Sprintf ( "%d" , readinessProbeThreshold ), annotations [daprReadinessProbeThresholdKey ])
446+ assert .Equal (t , strconv . Itoa ( livenessProbeDelay ), annotations [daprLivenessProbeDelayKey ])
447+ assert .Equal (t , strconv . Itoa ( livenessProbeTimeout ), annotations [daprLivenessProbeTimeoutKey ])
448+ assert .Equal (t , strconv . Itoa ( livenessProbePeriod ), annotations [daprLivenessProbePeriodKey ])
449+ assert .Equal (t , strconv . Itoa ( livenessProbeThreshold ), annotations [daprLivenessProbeThresholdKey ])
450+ assert .Equal (t , strconv . Itoa ( readinessProbeDelay ), annotations [daprReadinessProbeDelayKey ])
451+ assert .Equal (t , strconv . Itoa ( readinessProbeTimeout ), annotations [daprReadinessProbeTimeoutKey ])
452+ assert .Equal (t , strconv . Itoa ( readinessProbePeriod ), annotations [daprReadinessProbePeriodKey ])
453+ assert .Equal (t , strconv . Itoa ( readinessProbeThreshold ), annotations [daprReadinessProbeThresholdKey ])
453454 assert .Equal (t , daprImage , annotations [daprImageKey ])
454455 assert .Equal (t , "true" , annotations [daprAppSSLKey ])
455- assert .Equal (t , fmt . Sprintf ( "%d" , maxRequestBodySize ), annotations [daprMaxRequestBodySizeKey ])
456- assert .Equal (t , fmt . Sprintf ( "%d" , readBufferSize ), annotations [daprReadBufferSizeKey ])
456+ assert .Equal (t , strconv . Itoa ( maxRequestBodySize ), annotations [daprMaxRequestBodySizeKey ])
457+ assert .Equal (t , strconv . Itoa ( readBufferSize ), annotations [daprReadBufferSizeKey ])
457458 assert .Equal (t , "true" , annotations [daprHTTPStreamRequestBodyKey ])
458- assert .Equal (t , fmt . Sprintf ( "%d" , gracefulShutdownSeconds ), annotations [daprGracefulShutdownSecondsKey ])
459+ assert .Equal (t , strconv . Itoa ( gracefulShutdownSeconds ), annotations [daprGracefulShutdownSecondsKey ])
459460 assert .Equal (t , "true" , annotations [daprEnableAPILoggingKey ])
460461 assert .Equal (t , unixDomainSocketPath , annotations [daprUnixDomainSocketPathKey ])
461462 assert .Equal (t , volumeMountsReadOnly , annotations [daprVolumeMountsReadOnlyKey ])
0 commit comments