Skip to content

Commit

Permalink
fix nil pointer issue when restart pod
Browse files Browse the repository at this point in the history
  • Loading branch information
linglingye001 committed Mar 5, 2025
1 parent 72ccd76 commit f2a0582
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 2 additions & 1 deletion internal/controller/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ func (processor *AppConfigurationProviderProcessor) shouldReconcile(
}

for name, secret := range existingSecrets {
if processor.ReconciliationState.ExistingK8sSecrets[name].SecretResourceVersion != secret.ResourceVersion {
if processor.ReconciliationState.ExistingK8sSecrets[name] != nil &&
processor.ReconciliationState.ExistingK8sSecrets[name].SecretResourceVersion != secret.ResourceVersion {
return true
}
}
Expand Down
4 changes: 0 additions & 4 deletions internal/controller/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,6 @@ func shouldCreateOrUpdateSecret(processor *AppConfigurationProviderProcessor, se
return true
}

if processor.ReconciliationState.ExistingK8sSecrets[secretName].SecretResourceVersion != existingK8sSecrets[secretName].ResourceVersion {
return true
}

return !reflect.DeepEqual(processor.Settings.SecretSettings[secretName].Data, existingK8sSecrets[secretName].Data)
}

Expand Down

0 comments on commit f2a0582

Please sign in to comment.