feat(depends): add suffix on RBAC and SA
This commit is contained in:
@@ -651,7 +651,7 @@ func (d *Deployment) Yaml() ([]byte, error) {
|
|||||||
|
|
||||||
func (d *Deployment) SetServiceAccountName() {
|
func (d *Deployment) SetServiceAccountName() {
|
||||||
if d.needsServiceAccount {
|
if d.needsServiceAccount {
|
||||||
d.Spec.Template.Spec.ServiceAccountName = utils.TplName(d.service.Name, d.chart.Name)
|
d.Spec.Template.Spec.ServiceAccountName = utils.TplName(d.service.Name, d.chart.Name, "dependency")
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ func NewRBAC(service types.ServiceConfig, appName string) *RBAC {
|
|||||||
APIVersion: "rbac.authorization.k8s.io/v1",
|
APIVersion: "rbac.authorization.k8s.io/v1",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: utils.TplName(service.Name, appName),
|
Name: utils.TplName(service.Name, appName, "dependency"),
|
||||||
Labels: GetLabels(service.Name, appName),
|
Labels: GetLabels(service.Name, appName),
|
||||||
Annotations: Annotations,
|
Annotations: Annotations,
|
||||||
},
|
},
|
||||||
@@ -155,7 +155,7 @@ func NewRestrictedRole(service types.ServiceConfig, appName string) *Role {
|
|||||||
APIVersion: "rbac.authorization.k8s.io/v1",
|
APIVersion: "rbac.authorization.k8s.io/v1",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: utils.TplName(service.Name, appName),
|
Name: utils.TplName(service.Name, appName, "dependency"),
|
||||||
Labels: GetLabels(service.Name, appName),
|
Labels: GetLabels(service.Name, appName),
|
||||||
Annotations: Annotations,
|
Annotations: Annotations,
|
||||||
},
|
},
|
||||||
@@ -180,20 +180,20 @@ func NewRestrictedRoleBinding(service types.ServiceConfig, appName string) *Role
|
|||||||
APIVersion: "rbac.authorization.k8s.io/v1",
|
APIVersion: "rbac.authorization.k8s.io/v1",
|
||||||
},
|
},
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: utils.TplName(service.Name, appName),
|
Name: utils.TplName(service.Name, appName, "dependency"),
|
||||||
Labels: GetLabels(service.Name, appName),
|
Labels: GetLabels(service.Name, appName),
|
||||||
Annotations: Annotations,
|
Annotations: Annotations,
|
||||||
},
|
},
|
||||||
Subjects: []rbacv1.Subject{
|
Subjects: []rbacv1.Subject{
|
||||||
{
|
{
|
||||||
Kind: "ServiceAccount",
|
Kind: "ServiceAccount",
|
||||||
Name: utils.TplName(service.Name, appName),
|
Name: utils.TplName(service.Name, appName, "dependency"),
|
||||||
Namespace: "{{ .Release.Namespace }}",
|
Namespace: "{{ .Release.Namespace }}",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
RoleRef: rbacv1.RoleRef{
|
RoleRef: rbacv1.RoleRef{
|
||||||
Kind: "Role",
|
Kind: "Role",
|
||||||
Name: utils.TplName(service.Name, appName),
|
Name: utils.TplName(service.Name, appName, "dependency"),
|
||||||
APIGroup: "rbac.authorization.k8s.io",
|
APIGroup: "rbac.authorization.k8s.io",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user