Convert controller-manager to hyperkube.

This commit is contained in:
Joe Beda
2015-01-30 15:31:36 -08:00
parent 9a867f8311
commit bbb4479166
5 changed files with 192 additions and 98 deletions

View File

@@ -411,6 +411,12 @@ func (qf qFlag) Type() string {
// Will panic if defaultValue is not a valid quantity.
func QuantityFlag(flagName, defaultValue, description string) *Quantity {
q := MustParse(defaultValue)
flag.Var(qFlag{&q}, flagName, description)
flag.Var(NewQuantityFlagValue(&q), flagName, description)
return &q
}
// NewQuantityFlagValue returns an object that can be used to back a flag,
// pointing at the given Quantity variable.
func NewQuantityFlagValue(q *Quantity) flag.Value {
return qFlag{q}
}