File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
deploy/cloud/operator/internal/dynamo Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -166,12 +166,16 @@ func GenerateDynamoComponentsDeployments(ctx context.Context, parentDynamoGraphD
166166 labels [commonconsts .KubeLabelDynamoComponent ] = componentName
167167 labels [commonconsts .KubeLabelDynamoNamespace ] = dynamoNamespace
168168 if component .ComponentType == commonconsts .ComponentTypePlanner {
169+ // ensure that the extraPodSpec is not nil
169170 if deployment .Spec .ExtraPodSpec == nil {
170- deployment .Spec .ExtraPodSpec = & common.ExtraPodSpec {
171- PodSpec : & corev1.PodSpec {},
172- }
171+ deployment .Spec .ExtraPodSpec = & common.ExtraPodSpec {}
172+ }
173+ // ensure that the embedded PodSpec struct is not nil
174+ if deployment .Spec .ExtraPodSpec .PodSpec == nil {
175+ deployment .Spec .ExtraPodSpec .PodSpec = & corev1.PodSpec {}
173176 }
174- deployment .Spec .ExtraPodSpec .ServiceAccountName = commonconsts .PlannerServiceAccountName
177+ // finally set the service account name
178+ deployment .Spec .ExtraPodSpec .PodSpec .ServiceAccountName = commonconsts .PlannerServiceAccountName
175179 }
176180 if deployment .IsMainComponent () && defaultIngressSpec != nil && deployment .Spec .Ingress == nil {
177181 deployment .Spec .Ingress = defaultIngressSpec
You can’t perform that action at this time.
0 commit comments