Skip to content

Commit

Permalink
Sets version image to use vMajor.Minor b/c we don't match all the rel…
Browse files Browse the repository at this point in the history
…eased version tags. (#486)

Signed-off-by: Timothy St. Clair <[email protected]>
  • Loading branch information
timothysc authored Jul 13, 2018
1 parent 786ff49 commit b1d3b9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cmd/sonobuoy/app/imageversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package app

import (
"fmt"
"strings"

version "github.com/hashicorp/go-version"
Expand Down Expand Up @@ -79,7 +80,10 @@ func (c *ConformanceImageVersion) Get(client discovery.ServerVersionInterface) (
return "", err
}

return version.GitVersion, nil
// NOTE: Until the kube-conformance container is pushed upstream we can't
// guarantee alignment with exact versioning see https://github.com/heptio/kube-conformance/issues/25
// for more details
return fmt.Sprintf("v%s.%s", version.Major, version.Minor), nil
}
return string(*c), nil
}
Expand Down
6 changes: 5 additions & 1 deletion cmd/sonobuoy/app/imageversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,16 @@ func TestSetConformanceImageVersion(t *testing.T) {
func TestGetConformanceImageVersion(t *testing.T) {
workingServerVersion := &fakeServerVersionInterface{
version: version.Info{
Major: "1",
Minor: "11",
GitVersion: "v1.11.0",
},
}

betaServerVersion := &fakeServerVersionInterface{
version: version.Info{
Major: "1",
Minor: "11",
GitVersion: "v1.11.0-beta.2.78+e0b33dbc2bde88",
},
}
Expand All @@ -109,7 +113,7 @@ func TestGetConformanceImageVersion(t *testing.T) {
name: "auto retrieves server version",
version: "auto",
serverVersion: workingServerVersion,
expected: "v1.11.0",
expected: "v1.11",
},
{
name: "auto returns error if upstream fails",
Expand Down

0 comments on commit b1d3b9a

Please sign in to comment.