mirror of
https://github.com/stakater/Reloader.git
synced 2026-05-20 07:32:51 +00:00
feat: A lot of refactoring and CSI test cases
This commit is contained in:
@@ -20,6 +20,11 @@ const (
|
||||
// Value: comma-separated list of Secret names, e.g., "secret1,secret2"
|
||||
AnnotationSecretReload = "secret.reloader.stakater.com/reload"
|
||||
|
||||
// AnnotationSecretProviderClassReload triggers reload when specified SecretProviderClass(es) change.
|
||||
// Value: comma-separated list of SecretProviderClass names, e.g., "spc1,spc2"
|
||||
// Note: Reloader actually watches SecretProviderClassPodStatus resources, not SecretProviderClass.
|
||||
AnnotationSecretProviderClassReload = "secretproviderclass.reloader.stakater.com/reload"
|
||||
|
||||
// ============================================================
|
||||
// Auto-reload annotations
|
||||
// ============================================================
|
||||
@@ -36,6 +41,10 @@ const (
|
||||
// Value: "true" or "false"
|
||||
AnnotationSecretAuto = "secret.reloader.stakater.com/auto"
|
||||
|
||||
// AnnotationSecretProviderClassAuto enables auto-reload for all referenced SecretProviderClasses only.
|
||||
// Value: "true" or "false"
|
||||
AnnotationSecretProviderClassAuto = "secretproviderclass.reloader.stakater.com/auto"
|
||||
|
||||
// ============================================================
|
||||
// Exclude annotations (used with auto=true to exclude specific resources)
|
||||
// ============================================================
|
||||
@@ -48,6 +57,10 @@ const (
|
||||
// Value: comma-separated list of Secret names
|
||||
AnnotationSecretExclude = "secrets.exclude.reloader.stakater.com/reload"
|
||||
|
||||
// AnnotationSecretProviderClassExclude excludes specified SecretProviderClasses from auto-reload.
|
||||
// Value: comma-separated list of SecretProviderClass names
|
||||
AnnotationSecretProviderClassExclude = "secretproviderclasses.exclude.reloader.stakater.com/reload"
|
||||
|
||||
// ============================================================
|
||||
// Search annotations (for regex matching)
|
||||
// ============================================================
|
||||
@@ -117,6 +130,13 @@ func BuildSecretReloadAnnotation(secretNames ...string) map[string]string {
|
||||
}
|
||||
}
|
||||
|
||||
// BuildSecretProviderClassReloadAnnotation creates an annotation map for SecretProviderClass reload.
|
||||
func BuildSecretProviderClassReloadAnnotation(spcNames ...string) map[string]string {
|
||||
return map[string]string{
|
||||
AnnotationSecretProviderClassReload: joinNames(spcNames),
|
||||
}
|
||||
}
|
||||
|
||||
// BuildAutoTrueAnnotation creates an annotation map with auto=true.
|
||||
func BuildAutoTrueAnnotation() map[string]string {
|
||||
return map[string]string{
|
||||
@@ -145,6 +165,13 @@ func BuildSecretAutoAnnotation() map[string]string {
|
||||
}
|
||||
}
|
||||
|
||||
// BuildSecretProviderClassAutoAnnotation creates an annotation map with secretproviderclass auto=true.
|
||||
func BuildSecretProviderClassAutoAnnotation() map[string]string {
|
||||
return map[string]string{
|
||||
AnnotationSecretProviderClassAuto: AnnotationValueTrue,
|
||||
}
|
||||
}
|
||||
|
||||
// BuildSearchAnnotation creates an annotation map to enable search mode.
|
||||
func BuildSearchAnnotation() map[string]string {
|
||||
return map[string]string{
|
||||
@@ -187,6 +214,13 @@ func BuildSecretExcludeAnnotation(secretNames ...string) map[string]string {
|
||||
}
|
||||
}
|
||||
|
||||
// BuildSecretProviderClassExcludeAnnotation creates an annotation to exclude SecretProviderClasses from auto-reload.
|
||||
func BuildSecretProviderClassExcludeAnnotation(spcNames ...string) map[string]string {
|
||||
return map[string]string{
|
||||
AnnotationSecretProviderClassExclude: joinNames(spcNames),
|
||||
}
|
||||
}
|
||||
|
||||
// BuildPausePeriodAnnotation creates an annotation for deployment pause period.
|
||||
func BuildPausePeriodAnnotation(duration string) map[string]string {
|
||||
return map[string]string{
|
||||
|
||||
Reference in New Issue
Block a user