Skip to content

Commit

Permalink
chore: add unit tests to pod webhook (#419)
Browse files Browse the repository at this point in the history
Signed-off-by: realanna <anna.reale@dynatrace.com>
Co-authored-by: Todd Baert <toddbaert@gmail.com>
  • Loading branch information
RealAnna and toddbaert committed Mar 28, 2023
1 parent abe56e1 commit 4290978
Show file tree
Hide file tree
Showing 3 changed files with 1,237 additions and 597 deletions.
7 changes: 5 additions & 2 deletions webhooks/pod_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
FlagDImagePullPolicy corev1.PullPolicy = "Always"
clusterRoleBindingName string = "open-feature-operator-flagd-kubernetes-sync"
rootFileSyncMountPath string = "/etc/flagd"
OpenFeatureAnnotationPath = "metadata.annotations.openfeature.dev/openfeature.dev"
OpenFeatureAnnotationPath = "metadata.annotations.openfeature.dev"
OpenFeatureAnnotationPrefix = "openfeature.dev"
AllowKubernetesSyncAnnotation = "allowkubernetessync"
FlagSourceConfigurationAnnotation = "flagsourceconfiguration"
Expand Down Expand Up @@ -377,7 +377,10 @@ func parseList(s string) []string {
out := []string{}
ss := strings.Split(s, ",")
for i := 0; i < len(ss); i++ {
out = append(out, strings.TrimSpace(ss[i]))
newS := strings.TrimSpace(ss[i])
if newS != "" { //function should not add empty values
out = append(out, newS)
}
}
return out
}
Expand Down
Loading

0 comments on commit 4290978

Please sign in to comment.