Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh enhancement #85

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Refresh enhancement #85

wants to merge 4 commits into from

Conversation

linglingye001
Copy link
Contributor

No description provided.

@linglingye001 linglingye001 marked this pull request as ready for review December 18, 2024 01:48
@@ -148,126 +160,6 @@ var _ = Describe("AppConfiguationProvider processor", func() {
}]).Should(Equal(&newFakeEtag2))
Expect(processor.ReconciliationState.NextKeyValueRefreshReconcileTime).Should(Equal(expectedNextKeyValueRefreshReconcileTime))
})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we remove this test?

_ = json.Unmarshal([]byte(existingConfigMap.Data[dataOptions.Key]), &existingSettings)
_ = json.Unmarshal([]byte(latestConfigMapSettings[dataOptions.Key]), &latestSettings)

return !reflect.DeepEqual(existingSettings, latestSettings)
}

return false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about return true by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any scenario that will use the default value? The check of configmap data will be returned before line354.

@linglingye001 linglingye001 force-pushed the linglingye/fixRefresh branch from 3f451eb to d4931fd Compare January 9, 2025 09:53
return !reflect.DeepEqual(processor.Settings.SecretSettings[secretName].Data, existingK8sSecrets[secretName].Data)
}

func shouldCreateOrUpdateConfigMap(existingConfigMap *corev1.ConfigMap, dataOptions *acpv1.ConfigMapDataOptions, latestConfigMapSettings map[string]string) bool {
Copy link
Contributor

@RichardChen820 RichardChen820 Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you change the argument order to (existingConfigMap, latestConfigMapSettings, dataOptions ) for more readable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants