Skip to content

Commit

Permalink
fix: handle nil maps in flagd-standalone
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Baert <[email protected]>
  • Loading branch information
toddbaert committed Jul 17, 2024
1 parent c6ccfc1 commit 59686ce
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions controllers/core/flagd/resources/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ func (r *FlagdDeployment) GetResource(ctx context.Context, flagd *api.Flagd) (cl
},
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: labels,
Labels: labels,
Annotations: annotations,
},
Spec: corev1.PodSpec{
ServiceAccountName: flagd.Spec.ServiceAccountName,
Expand Down Expand Up @@ -110,14 +111,7 @@ func (r *FlagdDeployment) GetResource(ctx context.Context, flagd *api.Flagd) (cl

// override settings for the injected container for flagd standalone deployment mode
deployment.Spec.Template.Spec.ImagePullSecrets = imagePullSecrets
if len(r.FlagdConfig.Labels) > 0 {
maps.Copy(deployment.Spec.Template.ObjectMeta.Labels, r.FlagdConfig.Labels)
}
if len(r.FlagdConfig.Annotations) > 0 {
maps.Copy(deployment.Spec.Template.ObjectMeta.Annotations, r.FlagdConfig.Annotations)
}
deployment.Spec.Template.Spec.Containers[0].Image = fmt.Sprintf("%s:%s", r.FlagdConfig.Image, r.FlagdConfig.Tag)

deployment.Spec.Template.Spec.Containers[0].Ports = []corev1.ContainerPort{
{
Name: "management",
Expand Down

0 comments on commit 59686ce

Please sign in to comment.