diff --git a/kubectl-minio/cmd/resources/common.go b/kubectl-minio/cmd/resources/common.go index a3010db7a86..d5848d0e733 100644 --- a/kubectl-minio/cmd/resources/common.go +++ b/kubectl-minio/cmd/resources/common.go @@ -173,9 +173,14 @@ func LoadConsoleUI(emfs http.FileSystem, decode func(data []byte, defaults *sche } case *rbacv1.ClusterRoleBinding: if resourceObj, ok := obj.(*rbacv1.ClusterRoleBinding); ok { + updatedSubjects := []rbacv1.Subject{} for _, sub := range resourceObj.Subjects { sub.Namespace = opts.Namespace + // store modified subject + updatedSubjects = append(updatedSubjects, sub) } + // update subjects with modified array + resourceObj.Subjects = updatedSubjects } default: // fmt.Println("Unhandled kind:", obj.GetObjectKind()) diff --git a/kubectl-minio/go.sum b/kubectl-minio/go.sum index db3e0962e3f..fcc20b49a82 100644 --- a/kubectl-minio/go.sum +++ b/kubectl-minio/go.sum @@ -690,8 +690,6 @@ github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyex github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/minio/cli v1.22.0/go.mod h1:bYxnK0uS629N3Bq+AOZZ+6lwF77Sodk4+UL9vNuXhOY= -github.com/minio/controller-tools v0.4.5/go.mod h1:xES4iNis9dGrLQuP6nquTZZNg2T0/EM8wduC4/GWfZ0= -github.com/minio/controller-tools v0.4.6/go.mod h1:xES4iNis9dGrLQuP6nquTZZNg2T0/EM8wduC4/GWfZ0= github.com/minio/controller-tools v0.4.7/go.mod h1:xES4iNis9dGrLQuP6nquTZZNg2T0/EM8wduC4/GWfZ0= github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=