From e5f44eee09478e8c003eb066b791b5c3209d6731 Mon Sep 17 00:00:00 2001 From: Daniele Rondina Date: Sat, 7 Nov 2020 11:39:13 +0100 Subject: [PATCH] ConfigProtect: support annotation without initial / --- pkg/config/config_protect.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/config/config_protect.go b/pkg/config/config_protect.go index 27ddc51e..228488c3 100644 --- a/pkg/config/config_protect.go +++ b/pkg/config/config_protect.go @@ -48,6 +48,9 @@ type ConfigProtect struct { } func NewConfigProtect(annotationDir string) *ConfigProtect { + if len(annotationDir) > 0 && annotationDir[0:1] != "/" { + annotationDir = "/" + annotationDir + } return &ConfigProtect{ AnnotationDir: annotationDir, MapProtected: make(map[string]bool, 0),