Skip to content

Commit 3c178f6

Browse files
sdudoladovalexeyklyukin
authored andcommitted
Warn on infrastructure-roles.yaml format violations (zalando#177)
Emit a warning if there are unprocessed entries in the infrastructure-roles secret.
1 parent 5d5fa68 commit 3c178f6

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

manifests/infrastructure-roles.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
apiVersion: v1
22
data:
3+
# required format (w/o quotes): 'propertyNumber: value'
4+
# allowed properties: 'user', 'password', 'inrole'
5+
# numbers >= 1 are mandatory
6+
37
# robot_zmon_acid_monitoring
48
user1: cm9ib3Rfem1vbl9hY2lkX21vbml0b3Jpbmc=
59
# robot_zmon

pkg/controller/util.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,21 @@ Users:
137137
c.logger.Warningf("unknown key %q", p)
138138
}
139139
}
140+
141+
delete(data, key)
140142
}
141143

142144
if t.Name != "" {
143145
result[t.Name] = t
144146
}
145147
}
146148

149+
if len(data) != 0 {
150+
c.logger.Warningf("%d unprocessed entries in the infrastructure roles' secret", len(data))
151+
c.logger.Info(`infrastructure role entries should be in the {key}{id} format, where {key} can be either of "user", "password", "inrole" and the {id} a monotonically increasing integer starting with 1`)
152+
c.logger.Debugf("unprocessed entries: %#v", data)
153+
}
154+
147155
return result, nil
148156
}
149157

0 commit comments

Comments
 (0)