mirror of https://github.com/kubernetes/kops.git
Remap IRSA for DaemonSets too
This commit is contained in:
parent
76727cb4a0
commit
2042912a5b
|
|
@ -87,10 +87,7 @@ func addServiceAccountRole(context *model.KopsModelContext, objects kubemanifest
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, object := range objects {
|
for _, object := range objects {
|
||||||
if object.Kind() != "Deployment" {
|
if !hasPodSpecTemplate(object) {
|
||||||
continue
|
|
||||||
}
|
|
||||||
if object.APIVersion() != "apps/v1" {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
podSpec := &corev1.PodSpec{}
|
podSpec := &corev1.PodSpec{}
|
||||||
|
|
@ -160,3 +157,12 @@ func addLabels(addon *addonsapi.AddonSpec, objects kubemanifest.ObjectList) erro
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func hasPodSpecTemplate(object *kubemanifest.Object) bool {
|
||||||
|
if object.Kind() == "Deployment" || object.Kind() == "DaemonSet" {
|
||||||
|
if object.APIVersion() == "apps/v1" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue