Skip to content

Commit

Permalink
Add test to confirm that pversion.Get() returns something that utilve…
Browse files Browse the repository at this point in the history
…rsion.NewEffectiveVersion can consume
  • Loading branch information
joshuatcasey committed Aug 27, 2024
1 parent f7f25a8 commit 9b3bcca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/pversion/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/stretchr/testify/require"
apimachineryversion "k8s.io/apimachinery/pkg/version"
utilversion "k8s.io/apiserver/pkg/util/version"
)

func TestGet(t *testing.T) {
Expand Down Expand Up @@ -132,3 +133,10 @@ func TestGet(t *testing.T) {
})
}
}

func TestThatPVersionIsCompatibleWithEffectiveVersion(t *testing.T) {
version := Get().String()
effectiveVersion := utilversion.NewEffectiveVersion(version)
require.NotNil(t, effectiveVersion)
require.Equal(t, version, "v"+effectiveVersion.BinaryVersion().String())
}

0 comments on commit 9b3bcca

Please sign in to comment.