Skip to content

Commit

Permalink
fix: mixed the minioJob/policybinding/sts namespace (#2291)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuker authored Aug 26, 2024
1 parent 4624a08 commit 45110b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/job-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func (c *JobController) SyncHandler(key string) (_ Result, err error) {
}
// check sa
pbs := &stsv1beta1.PolicyBindingList{}
err = c.k8sClient.List(ctx, pbs, client.InNamespace(namespace))
err = c.k8sClient.List(ctx, pbs, client.InNamespace(tenant.Namespace))
if err != nil {
return WrapResult(Result{}, fmt.Errorf("list policybinding error: %w", err))
}
Expand All @@ -257,7 +257,7 @@ func (c *JobController) SyncHandler(key string) (_ Result, err error) {
}
saFound := false
for _, pb := range pbs.Items {
if pb.Spec.Application.Namespace == namespace && pb.Spec.Application.ServiceAccount == jobCR.Spec.ServiceAccountName {
if pb.Spec.Application.Namespace == jobCR.Namespace && pb.Spec.Application.ServiceAccount == jobCR.Spec.ServiceAccountName {
saFound = true
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/miniojob/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (jobCommand *MinIOIntervalJobCommand) createJob(_ context.Context, _ client
},
StringData: map[string]string{
"MC_HOST_myminio": fmt.Sprintf("%s://$(ACCESS_KEY):$(SECRET_KEY)@minio.%s.svc.%s", scheme, jobCR.Namespace, miniov2.GetClusterDomain()),
"MC_STS_ENDPOINT_myminio": fmt.Sprintf("https://sts.%s.svc.%s:%d/sts/%s", miniov2.GetNSFromFile(), miniov2.GetClusterDomain(), stsPort, jobCR.Namespace),
"MC_STS_ENDPOINT_myminio": fmt.Sprintf("https://sts.%s.svc.%s:%d/sts/%s", miniov2.GetNSFromFile(), miniov2.GetClusterDomain(), stsPort, t.Namespace),
"MC_WEB_IDENTITY_TOKEN_FILE_myminio": "/var/run/secrets/kubernetes.io/serviceaccount/token",
},
}
Expand Down

0 comments on commit 45110b9

Please sign in to comment.