Skip to content

Commit 7daf07c

Browse files
committed
fix
Signed-off-by: Sinelnikov Michail <mikhail.sinelnikov@flant.com>
1 parent ad08d4b commit 7daf07c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pkg/linters/rbac/rules/placement.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ func objectRBACPlacementServiceAccount(m *module.Module, object storage.StoreObj
142142
return
143143
}
144144

145+
if strings.HasPrefix(objectName, "istiod") && namespace == "d8-istio" {
146+
// istiod Deployment is rendered by istio-operator with serviceAccountName according to its
147+
// naming conventions we can't change (i.e. istiod-v1x19).
148+
// In our convention it has to be named as "iop" according to template folder, but within the folder we render
149+
// not a single istiod instance, but several for different versions and can't use the shared ServiceAccount for them.
150+
return
151+
}
152+
145153
if isDeckhouseSystemNamespace(namespace) {
146154
if objectName != expectedServiceAccountName {
147155
errorList.Errorf("Name of ServiceAccount in %q in namespace %q should be equal to %q. If the name is correct, change the namespace to %q", shortPath, namespace, expectedServiceAccountName, m.GetNamespace())
@@ -158,14 +166,6 @@ func objectRBACPlacementServiceAccount(m *module.Module, object storage.StoreObj
158166
}
159167
}
160168

161-
if strings.HasPrefix(objectName, "istiod") && namespace == "d8-istio" {
162-
// istiod Deployment is rendered by istio-operator with serviceAccountName according to its
163-
// naming conventions we can't change (i.e. istiod-v1x19).
164-
// In our convention it has to be named as "iop" according to template folder, but within the folder we render
165-
// not a single istiod instance, but several for different versions and can't use the shared ServiceAccount for them.
166-
return
167-
}
168-
169169
return
170170
}
171171

0 commit comments

Comments
 (0)