Commit e3bcf44 1 parent d82cf81 commit e3bcf44 Copy full SHA for e3bcf44
File tree 2 files changed +32
-0
lines changed
internal/controller/install
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,16 @@ func (cc *CommonComponents) ReconcileComponents(newComponents *CommonComponents)
152
152
cc .Service = nil
153
153
}
154
154
155
+ if newComponents .ServiceAccount != nil {
156
+ cc .ServiceAccount .Labels = newComponents .ServiceAccount .Labels
157
+ cc .ServiceAccount .Annotations = newComponents .ServiceAccount .Annotations
158
+ cc .ServiceAccount .ImagePullSecrets = newComponents .ServiceAccount .ImagePullSecrets
159
+ cc .ServiceAccount .Secrets = newComponents .ServiceAccount .Secrets
160
+ cc .ServiceAccount .AutomountServiceAccountToken = newComponents .ServiceAccount .AutomountServiceAccountToken
161
+ } else {
162
+ cc .ServiceAccount = nil
163
+ }
164
+
155
165
if newComponents .ClusterRole != nil {
156
166
cc .ClusterRole .Rules = newComponents .ClusterRole .Rules
157
167
cc .ClusterRole .Labels = newComponents .ClusterRole .Labels
Original file line number Diff line number Diff line change @@ -759,6 +759,27 @@ func makeCommonComponents() CommonComponents {
759
759
},
760
760
}
761
761
762
+ automountServiceAccountToken := true
763
+ serviceAccount := corev1.ServiceAccount {
764
+ ObjectMeta : metav1.ObjectMeta {
765
+ Name : "some-name" ,
766
+ Namespace : "some-namespace" ,
767
+ Labels : map [string ]string {"some-label-key" : "some-label-value" },
768
+ Annotations : map [string ]string {"some-annotation-key" : "some-annotation-value" },
769
+ },
770
+ ImagePullSecrets : []corev1.LocalObjectReference {
771
+ {
772
+ Name : "some-image-pull-secret" ,
773
+ },
774
+ },
775
+ Secrets : []corev1.ObjectReference {
776
+ {
777
+ Name : "some-secret" ,
778
+ },
779
+ },
780
+ AutomountServiceAccountToken : & automountServiceAccountToken ,
781
+ }
782
+
762
783
pc := schedulingv1.PriorityClass {
763
784
Value : 1000 ,
764
785
}
@@ -768,6 +789,7 @@ func makeCommonComponents() CommonComponents {
768
789
}
769
790
return CommonComponents {
770
791
Deployment : & deployment ,
792
+ ServiceAccount : & serviceAccount ,
771
793
PriorityClasses : []* schedulingv1.PriorityClass {& pc },
772
794
Secret : & secret ,
773
795
}
You can’t perform that action at this time.
0 commit comments