Skip to content

Commit

Permalink
cilium: Print valid label prefixes into log
Browse files Browse the repository at this point in the history
Signed-off-by:  <thomas@cilium.io>
  • Loading branch information
tgraf committed Mar 17, 2017
1 parent dc53ba4 commit 433871d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions daemon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ func initEnv() {
config.ValidLabelPrefixes.Append(labels.ParseLabelPrefix(label))
}

log.Infof("Valid label prefix configuration:")
for _, l := range config.ValidLabelPrefixes.LabelPrefixes {
log.Infof(" - %s", l)
}

config.ValidLabelPrefixesMU.Unlock()

_, r, err := net.ParseCIDR(nat46prefix)
Expand Down
4 changes: 4 additions & 0 deletions pkg/labels/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ type LabelPrefix struct {
Source string `json:"source"`
}

func (p LabelPrefix) String() string {
return fmt.Sprintf("%s:%s", p.Source, p.Prefix)
}

func ParseLabelPrefix(label string) *LabelPrefix {
labelPrefix := LabelPrefix{}
t := strings.SplitN(label, ":", 2)
Expand Down

0 comments on commit 433871d

Please sign in to comment.