Skip to content

Commit

Permalink
fix: initialize idps configmap.Data field if empty
Browse files Browse the repository at this point in the history
fixes #392
  • Loading branch information
shipperizer committed Aug 30, 2024
1 parent 6c986b8 commit fba4479
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/idp/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ func (s *Service) CreateResource(ctx context.Context, data *Configuration) ([]*C
return nil, err
}

// catch if configmap is empty and initialize
if cm.Data == nil {
cm.Data = make(map[string]string)
}

cm.Data[s.keyName] = string(rawIdps)

if _, err = s.k8s.ConfigMaps(s.cmNamespace).Update(ctx, cm, metaV1.UpdateOptions{}); err != nil {
Expand Down

0 comments on commit fba4479

Please sign in to comment.