mirror of
https://github.com/1Password/onepassword-operator.git
synced 2025-10-22 07:28:06 +00:00
Merge pull request #3 from 1Password/ignore_restart_annotation
Ignore restart annotation when looking for 1Password annotations
This commit is contained in:
@@ -99,7 +99,7 @@ func (r *ReconcileDeployment) Reconcile(request reconcile.Request) (reconcile.Re
|
|||||||
|
|
||||||
annotations, annotationsFound := op.GetAnnotationsForDeployment(deployment, r.opAnnotationRegExp)
|
annotations, annotationsFound := op.GetAnnotationsForDeployment(deployment, r.opAnnotationRegExp)
|
||||||
if !annotationsFound {
|
if !annotationsFound {
|
||||||
reqLogger.Info("No One Password Annotations found")
|
reqLogger.Info("No 1Password Annotations found")
|
||||||
return reconcile.Result{}, nil
|
return reconcile.Result{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ func GetAnnotationsForDeployment(deployment *appsv1.Deployment, regex *regexp.Re
|
|||||||
func FilterAnnotations(annotations map[string]string, regex *regexp.Regexp) map[string]string {
|
func FilterAnnotations(annotations map[string]string, regex *regexp.Regexp) map[string]string {
|
||||||
filteredAnnotations := make(map[string]string)
|
filteredAnnotations := make(map[string]string)
|
||||||
for key, value := range annotations {
|
for key, value := range annotations {
|
||||||
if regex.MatchString(key) {
|
if regex.MatchString(key) && key != RestartAnnotation {
|
||||||
filteredAnnotations[key] = value
|
filteredAnnotations[key] = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user