Skip to content

Commit

Permalink
backing out changes requested by PR review - will squash
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislovecnm committed Oct 19, 2017
1 parent c8eea0d commit d452e8f
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions pkg/model/components/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,17 @@ var _ loader.OptionsBuilder = &EtcdOptionsBuilder{}
func (b *EtcdOptionsBuilder) BuildOptions(o interface{}) error {
spec := o.(*kops.ClusterSpec)

imageVersion := ""
// @check the version are set and if not preset the defaults
for _, x := range spec.EtcdClusters {
// @TODO if nothing is set, set the defaults. At a late date once we have a way of detecting a 'new' cluster
// we can default all clusters to v3
if x.Version == "" {
x.Version = "2.2.1"
}

if imageVersion != "" {
if imageVersion != x.Version {
return fmt.Errorf("you cannot have two different versions of etcd %q and %q set", x.Version, imageVersion)
}
} else {
imageVersion = x.Version
}
}

// TODO we do not have a API place to put this. Do we use version or get another
// TODO API value?
// TODO code is duplicated in nodeup
image := fmt.Sprintf("gcr.io/google_containers/etcd:%s", imageVersion)
// TODO put this into API values. Do that in another PR?
image := fmt.Sprintf("gcr.io/google_containers/etcd:%s", spec.EtcdClusters[0].Version)
image, err := b.Context.AssetBuilder.RemapImage(image)
if err != nil {
return fmt.Errorf("unable to remap container %q: %v", image, err)
Expand Down

0 comments on commit d452e8f

Please sign in to comment.