Skip to content

Commit 45110b9

Browse files
authored
fix: mixed the minioJob/policybinding/sts namespace (#2291)
1 parent 4624a08 commit 45110b9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/controller/job-controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func (c *JobController) SyncHandler(key string) (_ Result, err error) {
248248
}
249249
// check sa
250250
pbs := &stsv1beta1.PolicyBindingList{}
251-
err = c.k8sClient.List(ctx, pbs, client.InNamespace(namespace))
251+
err = c.k8sClient.List(ctx, pbs, client.InNamespace(tenant.Namespace))
252252
if err != nil {
253253
return WrapResult(Result{}, fmt.Errorf("list policybinding error: %w", err))
254254
}
@@ -257,7 +257,7 @@ func (c *JobController) SyncHandler(key string) (_ Result, err error) {
257257
}
258258
saFound := false
259259
for _, pb := range pbs.Items {
260-
if pb.Spec.Application.Namespace == namespace && pb.Spec.Application.ServiceAccount == jobCR.Spec.ServiceAccountName {
260+
if pb.Spec.Application.Namespace == jobCR.Namespace && pb.Spec.Application.ServiceAccount == jobCR.Spec.ServiceAccountName {
261261
saFound = true
262262
}
263263
}

pkg/utils/miniojob/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func (jobCommand *MinIOIntervalJobCommand) createJob(_ context.Context, _ client
200200
},
201201
StringData: map[string]string{
202202
"MC_HOST_myminio": fmt.Sprintf("%s://$(ACCESS_KEY):$(SECRET_KEY)@minio.%s.svc.%s", scheme, jobCR.Namespace, miniov2.GetClusterDomain()),
203-
"MC_STS_ENDPOINT_myminio": fmt.Sprintf("https://sts.%s.svc.%s:%d/sts/%s", miniov2.GetNSFromFile(), miniov2.GetClusterDomain(), stsPort, jobCR.Namespace),
203+
"MC_STS_ENDPOINT_myminio": fmt.Sprintf("https://sts.%s.svc.%s:%d/sts/%s", miniov2.GetNSFromFile(), miniov2.GetClusterDomain(), stsPort, t.Namespace),
204204
"MC_WEB_IDENTITY_TOKEN_FILE_myminio": "/var/run/secrets/kubernetes.io/serviceaccount/token",
205205
},
206206
}

0 commit comments

Comments
 (0)