mirror of
https://github.com/clastix/kamaji.git
synced 2026-02-14 18:10:03 +00:00
feat: support for custom service account
This commit is contained in:
@@ -77,6 +77,7 @@ func (d Deployment) Build(ctx context.Context, deployment *appsv1.Deployment, te
|
||||
d.setContainers(&deployment.Spec.Template.Spec, tenantControlPlane, address)
|
||||
d.setAdditionalVolumes(&deployment.Spec.Template.Spec, tenantControlPlane)
|
||||
d.setVolumes(&deployment.Spec.Template.Spec, tenantControlPlane)
|
||||
d.setServiceAccount(&deployment.Spec.Template.Spec, tenantControlPlane)
|
||||
d.Client.Scheme().Default(deployment)
|
||||
}
|
||||
|
||||
@@ -1071,3 +1072,13 @@ func (d Deployment) setToleration(spec *corev1.PodSpec, tcp kamajiv1alpha1.Tenan
|
||||
func (d Deployment) setAffinity(spec *corev1.PodSpec, tcp kamajiv1alpha1.TenantControlPlane) {
|
||||
spec.Affinity = tcp.Spec.ControlPlane.Deployment.Affinity
|
||||
}
|
||||
|
||||
func (d Deployment) setServiceAccount(spec *corev1.PodSpec, tcp kamajiv1alpha1.TenantControlPlane) {
|
||||
if len(tcp.Spec.ControlPlane.Deployment.ServiceAccountName) > 0 {
|
||||
spec.ServiceAccountName = tcp.Spec.ControlPlane.Deployment.ServiceAccountName
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
spec.ServiceAccountName = "default"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user