Warn on infrastructure-roles.yaml format violations (#177)

Emit a warning if there are unprocessed entries in the infrastructure-roles secret.
This commit is contained in:
zerg-junior
2017-12-15 17:21:41 +01:00
committed by Oleksii Kliukin
parent 5d5fa680a3
commit 3c178f68df
2 changed files with 12 additions and 0 deletions
+8
View File
@@ -137,6 +137,8 @@ Users:
c.logger.Warningf("unknown key %q", p)
}
}
delete(data, key)
}
if t.Name != "" {
@@ -144,6 +146,12 @@ Users:
}
}
if len(data) != 0 {
c.logger.Warningf("%d unprocessed entries in the infrastructure roles' secret", len(data))
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`)
c.logger.Debugf("unprocessed entries: %#v", data)
}
return result, nil
}