Skip to content

Commit

Permalink
Merge pull request kubernetes#32020 from euank/version-twiddling
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

rkt: Update kube-up rkt version to v1.14.0

cc @kubernetes/sig-rktnetes 

This should have been included in kubernetes#31286 (whoops).

This is a bugfix that I propose for v1.4 inclusion.
  • Loading branch information
Kubernetes Submit Queue authored Sep 7, 2016
2 parents 93f7cbd + a2a324b commit 243959c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 31 deletions.
2 changes: 1 addition & 1 deletion cluster/aws/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ NODE_OS_DISTRIBUTION="${KUBE_OS_DISTRIBUTION}"
KUBE_NODE_IMAGE="${KUBE_NODE_IMAGE:-}"
COREOS_CHANNEL="${COREOS_CHANNEL:-alpha}"
CONTAINER_RUNTIME="${KUBE_CONTAINER_RUNTIME:-docker}"
RKT_VERSION="${KUBE_RKT_VERSION:-0.5.5}"
RKT_VERSION="${KUBE_RKT_VERSION:-1.14.0}"

# OpenContrail networking plugin specific settings
NETWORK_PROVIDER="${NETWORK_PROVIDER:-none}" # opencontrail
Expand Down
2 changes: 1 addition & 1 deletion cluster/aws/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ NODE_OS_DISTRIBUTION="${KUBE_OS_DISTRIBUTION}"
KUBE_NODE_IMAGE="${KUBE_NODE_IMAGE:-}"
COREOS_CHANNEL="${COREOS_CHANNEL:-alpha}"
CONTAINER_RUNTIME="${KUBE_CONTAINER_RUNTIME:-docker}"
RKT_VERSION="${KUBE_RKT_VERSION:-0.5.5}"
RKT_VERSION="${KUBE_RKT_VERSION:-1.14.0}"

# Optional: if set to true, kube-up will configure the cluster to run e2e tests.
E2E_STORAGE_TEST_ENVIRONMENT=${KUBE_E2E_STORAGE_TEST_ENVIRONMENT:-false}
2 changes: 1 addition & 1 deletion cluster/gce/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ MASTER_IMAGE_PROJECT=${KUBE_GCE_MASTER_PROJECT:-google-containers}
NODE_IMAGE=${KUBE_GCE_NODE_IMAGE:-${CVM_VERSION}}
NODE_IMAGE_PROJECT=${KUBE_GCE_NODE_PROJECT:-google-containers}
CONTAINER_RUNTIME=${KUBE_CONTAINER_RUNTIME:-docker}
RKT_VERSION=${KUBE_RKT_VERSION:-1.9.1}
RKT_VERSION=${KUBE_RKT_VERSION:-1.14.0}
RKT_STAGE1_IMAGE=${KUBE_RKT_STAGE1_IMAGE:-coreos.com/rkt/stage1-coreos}

NETWORK=${KUBE_GCE_NETWORK:-default}
Expand Down
2 changes: 1 addition & 1 deletion cluster/gce/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ NODE_IMAGE=${KUBE_GCE_NODE_IMAGE:-${CVM_VERSION}}
NODE_IMAGE_PROJECT=${KUBE_GCE_NODE_PROJECT:-google-containers}
CONTAINER_RUNTIME=${KUBE_CONTAINER_RUNTIME:-docker}
GCI_DOCKER_VERSION=${KUBE_GCI_DOCKER_VERSION:-}
RKT_VERSION=${KUBE_RKT_VERSION:-1.9.1}
RKT_VERSION=${KUBE_RKT_VERSION:-1.14.0}
RKT_STAGE1_IMAGE=${KUBE_RKT_STAGE1_IMAGE:-coreos.com/rkt/stage1-coreos}

NETWORK=${KUBE_GCE_NETWORK:-e2e}
Expand Down
5 changes: 2 additions & 3 deletions pkg/kubelet/rkt/rkt.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ const (
RktType = "rkt"
DefaultRktAPIServiceEndpoint = "localhost:15441"

minimumRktBinVersion = "1.13.0"
recommendedRktBinVersion = "1.13.0"
minimumRktBinVersion = "1.13.0"

minimumRktApiVersion = "1.0.0-alpha"
minimumSystemdVersion = "219"
Expand Down Expand Up @@ -1679,7 +1678,7 @@ func (r *Runtime) APIVersion() (kubecontainer.Version, error) {

// Status returns error if rkt is unhealthy, nil otherwise.
func (r *Runtime) Status() error {
return r.checkVersion(minimumRktBinVersion, recommendedRktBinVersion, minimumRktApiVersion, minimumSystemdVersion)
return r.checkVersion(minimumRktBinVersion, minimumRktApiVersion, minimumSystemdVersion)
}

// SyncPod syncs the running pod to match the specified desired pod.
Expand Down
21 changes: 7 additions & 14 deletions pkg/kubelet/rkt/rkt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,15 @@ func TestCheckVersion(t *testing.T) {
}
fs.version = "100"
tests := []struct {
minimumRktBinVersion string
recommendedRktBinVersion string
minimumRktApiVersion string
minimumSystemdVersion string
err error
calledGetInfo bool
calledSystemVersion bool
minimumRktBinVersion string
minimumRktApiVersion string
minimumSystemdVersion string
err error
calledGetInfo bool
calledSystemVersion bool
}{
// Good versions.
{
"1.2.3",
"1.2.3",
"1.2.5",
"99",
Expand All @@ -198,7 +196,6 @@ func TestCheckVersion(t *testing.T) {
},
// Good versions.
{
"1.2.3+git",
"1.2.3+git",
"1.2.6-alpha",
"100",
Expand All @@ -208,7 +205,6 @@ func TestCheckVersion(t *testing.T) {
},
// Requires greater binary version.
{
"1.2.4",
"1.2.4",
"1.2.6-alpha",
"100",
Expand All @@ -218,7 +214,6 @@ func TestCheckVersion(t *testing.T) {
},
// Requires greater API version.
{
"1.2.3",
"1.2.3",
"1.2.6",
"100",
Expand All @@ -228,7 +223,6 @@ func TestCheckVersion(t *testing.T) {
},
// Requires greater API version.
{
"1.2.3",
"1.2.3",
"1.2.7",
"100",
Expand All @@ -238,7 +232,6 @@ func TestCheckVersion(t *testing.T) {
},
// Requires greater systemd version.
{
"1.2.3",
"1.2.3",
"1.2.7",
"101",
Expand All @@ -250,7 +243,7 @@ func TestCheckVersion(t *testing.T) {

for i, tt := range tests {
testCaseHint := fmt.Sprintf("test case #%d", i)
err := r.checkVersion(tt.minimumRktBinVersion, tt.recommendedRktBinVersion, tt.minimumRktApiVersion, tt.minimumSystemdVersion)
err := r.checkVersion(tt.minimumRktBinVersion, tt.minimumRktApiVersion, tt.minimumSystemdVersion)
assert.Equal(t, tt.err, err, testCaseHint)

if tt.calledGetInfo {
Expand Down
11 changes: 1 addition & 10 deletions pkg/kubelet/rkt/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

"github.com/coreos/go-semver/semver"
rktapi "github.com/coreos/rkt/api/v1alpha"
"github.com/golang/glog"
"golang.org/x/net/context"
)

Expand Down Expand Up @@ -98,7 +97,7 @@ func (r *Runtime) getVersions() error {

// checkVersion tests whether the rkt/systemd/rkt-api-service that meet the version requirement.
// If all version requirements are met, it returns nil.
func (r *Runtime) checkVersion(minimumRktBinVersion, recommendedRktBinVersion, minimumRktApiVersion, minimumSystemdVersion string) error {
func (r *Runtime) checkVersion(minimumRktBinVersion, minimumRktApiVersion, minimumSystemdVersion string) error {
if err := r.getVersions(); err != nil {
return err
}
Expand All @@ -123,14 +122,6 @@ func (r *Runtime) checkVersion(minimumRktBinVersion, recommendedRktBinVersion, m
if result < 0 {
return fmt.Errorf("rkt: binary version is too old(%v), requires at least %v", r.versions.binVersion, minimumRktBinVersion)
}
result, err = r.versions.binVersion.Compare(recommendedRktBinVersion)
if err != nil {
return err
}
if result != 0 {
// TODO(yifan): Record an event to expose the information.
glog.Warningf("rkt: current binary version %q is not recommended (recommended version %q)", r.versions.binVersion, recommendedRktBinVersion)
}

// Check rkt API version.
result, err = r.versions.apiVersion.Compare(minimumRktApiVersion)
Expand Down

0 comments on commit 243959c

Please sign in to comment.