bugfix
This commit is contained in:
parent
00e4585ce5
commit
1408c3fde8
|
@ -36,13 +36,17 @@ func (c *ImageConfig) Prepare(ctx *interpolate.Context) []error {
|
||||||
// ImageVisibility values
|
// ImageVisibility values
|
||||||
// https://wiki.openstack.org/wiki/Glance-v2-community-image-visibility-design
|
// https://wiki.openstack.org/wiki/Glance-v2-community-image-visibility-design
|
||||||
if c.ImageVisibility != "" {
|
if c.ImageVisibility != "" {
|
||||||
valid := []string{"public", "private", "shared", "community"}
|
validVals := []string{"public", "private", "shared", "community"}
|
||||||
for _, val := range valid {
|
valid := false
|
||||||
|
for _, val := range validVals {
|
||||||
if string(c.ImageVisibility) == val {
|
if string(c.ImageVisibility) == val {
|
||||||
|
valid = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errs = append(errs, fmt.Errorf("Unknown visibility value %s", c.ImageVisibility))
|
if !valid {
|
||||||
|
errs = append(errs, fmt.Errorf("Unknown visibility value %s", c.ImageVisibility))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(errs) > 0 {
|
if len(errs) > 0 {
|
||||||
|
|
Loading…
Reference in New Issue