Skip to content

Commit 322950d

Browse files
committed
change type
change type
1 parent bb4e2e1 commit 322950d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

pkg/controller/sts.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/xml"
66
"errors"
7+
"fmt"
78
"net/http"
89
"os"
910
"sync"
@@ -34,8 +35,8 @@ const (
3435

3536
// STS API constants
3637
const (
37-
STSDefaultPort = "4223"
38-
STSEndpoint = "/sts"
38+
STSDefaultPort int = 4223
39+
STSEndpoint = "/sts"
3940
)
4041

4142
const (
@@ -263,7 +264,7 @@ func configureSTSServer(c *Controller) *http.Server {
263264
router.NotFoundHandler = http.NotFoundHandler()
264265

265266
s := &http.Server{
266-
Addr: ":" + STSDefaultPort,
267+
Addr: fmt.Sprintf(":%d", STSDefaultPort),
267268
Handler: router,
268269
ReadTimeout: time.Minute,
269270
WriteTimeout: time.Minute,

pkg/utils/miniojob/types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (jobCommand *MinIOIntervalJobCommand) Success() bool {
120120
}
121121

122122
// createJob - create job
123-
func (jobCommand *MinIOIntervalJobCommand) createJob(ctx context.Context, k8sClient client.Client, jobCR *v1alpha1.MinIOJob, stsPort string) (objs []client.Object) {
123+
func (jobCommand *MinIOIntervalJobCommand) createJob(ctx context.Context, k8sClient client.Client, jobCR *v1alpha1.MinIOJob, stsPort int) (objs []client.Object) {
124124
if jobCommand == nil {
125125
return nil
126126
}
@@ -178,7 +178,7 @@ func (jobCommand *MinIOIntervalJobCommand) createJob(ctx context.Context, k8sCli
178178
},
179179
StringData: map[string]string{
180180
"MC_HOST_myminio": fmt.Sprintf("https://$(ACCESS_KEY):$(SECRET_KEY)@minio.%s.svc.cluster.local", jobCR.Namespace),
181-
"MC_STS_ENDPOINT_myminio": fmt.Sprintf("https://sts.%s.svc.cluster.local:%s/sts/%s", miniov2.GetNSFromFile(), stsPort, jobCR.Namespace),
181+
"MC_STS_ENDPOINT_myminio": fmt.Sprintf("https://sts.%s.svc.cluster.local:%d/sts/%s", miniov2.GetNSFromFile(), stsPort, jobCR.Namespace),
182182
"MC_WEB_IDENTITY_TOKEN_FILE_myminio": "/var/run/secrets/kubernetes.io/serviceaccount/token",
183183
},
184184
}
@@ -233,7 +233,7 @@ func (jobCommand *MinIOIntervalJobCommand) createJob(ctx context.Context, k8sCli
233233
}
234234

235235
// CreateJob - create job
236-
func (jobCommand *MinIOIntervalJobCommand) CreateJob(ctx context.Context, k8sClient client.Client, jobCR *v1alpha1.MinIOJob, stsPort string) error {
236+
func (jobCommand *MinIOIntervalJobCommand) CreateJob(ctx context.Context, k8sClient client.Client, jobCR *v1alpha1.MinIOJob, stsPort int) error {
237237
for _, obj := range jobCommand.createJob(ctx, k8sClient, jobCR, stsPort) {
238238
if obj == nil {
239239
continue
@@ -308,7 +308,7 @@ func (intervalJob *MinIOIntervalJob) GetMinioJobStatus(ctx context.Context) v1al
308308
}
309309

310310
// CreateCommandJob - create command job
311-
func (intervalJob *MinIOIntervalJob) CreateCommandJob(ctx context.Context, k8sClient client.Client, stsPort string) error {
311+
func (intervalJob *MinIOIntervalJob) CreateCommandJob(ctx context.Context, k8sClient client.Client, stsPort int) error {
312312
for _, command := range intervalJob.Command {
313313
if len(command.CommandSpec.DependsOn) == 0 {
314314
err := command.CreateJob(ctx, k8sClient, intervalJob.JobCR, stsPort)

0 commit comments

Comments
 (0)