Skip to content

Commit

Permalink
fix(service_intergration): empty user config to API convertion
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-savciuc committed Nov 10, 2023
1 parent 7a74eaf commit bcf6c47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions controllers/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func getSecretPrefix(o objWithSecret) string {
// userConfigurationToAPI converts user config into a map
func userConfigurationToAPI(c any, groups ...string) (map[string]any, error) {
if c == nil || (reflect.ValueOf(c).Kind() == reflect.Ptr && reflect.ValueOf(c).IsNil()) {
return nil, nil
return map[string]any{}, nil
}

o := &sheriff.Options{
Expand All @@ -192,7 +192,7 @@ func userConfigurationToAPI(c any, groups ...string) (map[string]any, error) {
if !ok {
// It is an empty pointer
// sheriff just returned the very same object
return nil, nil
return map[string]any{}, nil
}

return m, nil
Expand Down
2 changes: 1 addition & 1 deletion controllers/serviceintegration_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (h ServiceIntegrationHandler) createOrUpdate(ctx context.Context, avn *aive
)
reason = "Updated"
if err != nil {
if strings.Contains(err.Error(), "user config not changed") {
if strings.Contains(strings.ToLower(err.Error()), "user config not changed") {
return nil
}
return err
Expand Down

0 comments on commit bcf6c47

Please sign in to comment.