Skip to content

Commit

Permalink
Revert "Version: Add podman bundle version to version command/api"
Browse files Browse the repository at this point in the history
This reverts commit 181954f.
  • Loading branch information
praveenkumar committed May 21, 2024
1 parent 482ba87 commit c0be0bd
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 9 deletions.
3 changes: 0 additions & 3 deletions cmd/crc/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ type version struct {
Version string `json:"version"`
Commit string `json:"commit"`
OpenshiftVersion string `json:"openshiftVersion"`
PodmanVersion string `json:"podmanVersion"`
}

func defaultVersion() *version {
return &version{
Version: crcversion.GetCRCVersion(),
Commit: crcversion.GetCommitSha(),
OpenshiftVersion: crcversion.GetBundleVersion(crcPreset.OpenShift),
PodmanVersion: crcversion.GetBundleVersion(crcPreset.Podman),
}
}

Expand All @@ -62,6 +60,5 @@ func (v *version) lines() []string {
return []string{
fmt.Sprintf("CRC version: %s+%s\n", v.Version, v.Commit),
fmt.Sprintf("OpenShift version: %s\n", v.OpenshiftVersion),
fmt.Sprintf("Podman version: %s\n", v.PodmanVersion),
}
}
3 changes: 1 addition & 2 deletions cmd/crc/cmd/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ func TestJsonVersion(t *testing.T) {
Version: "1.13",
Commit: "aabbcc",
OpenshiftVersion: "4.5.4",
PodmanVersion: "3.4.4",
}, "json"))

expected := `{"version": "1.13", "commit": "aabbcc", "openshiftVersion": "4.5.4", "podmanVersion": "3.4.4"}`
expected := `{"version": "1.13", "commit": "aabbcc", "openshiftVersion": "4.5.4"}`
assert.JSONEq(t, expected, out.String())
}
1 change: 0 additions & 1 deletion pkg/crc/api/api_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func TestVersion(t *testing.T) {
CrcVersion: version.GetCRCVersion(),
OpenshiftVersion: version.GetBundleVersion(preset.OpenShift),
CommitSha: version.GetCommitSha(),
PodmanVersion: version.GetBundleVersion(preset.Podman),
},
vr,
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/crc/api/api_http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ var testCases = []testCase{
// version
{
request: get("version"),
response: jSon(fmt.Sprintf(`{"CrcVersion":"%s","CommitSha":"%s","OpenshiftVersion":"%s","PodmanVersion":"%s"}`, version.GetCRCVersion(), version.GetCommitSha(), version.GetBundleVersion(preset.OpenShift), version.GetBundleVersion(preset.Podman))),
response: jSon(fmt.Sprintf(`{"CrcVersion":"%s","CommitSha":"%s","OpenshiftVersion":"%s"}`, version.GetCRCVersion(), version.GetCommitSha(), version.GetBundleVersion(preset.OpenShift))),
},

// version never fails
Expand Down
1 change: 0 additions & 1 deletion pkg/crc/api/client/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ type VersionResult struct {
CrcVersion string
CommitSha string
OpenshiftVersion string
PodmanVersion string
}

type StartResult struct {
Expand Down
1 change: 0 additions & 1 deletion pkg/crc/api/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ func (h *Handler) GetVersion(c *context) error {
CrcVersion: version.GetCRCVersion(),
CommitSha: version.GetCommitSha(),
OpenshiftVersion: version.GetBundleVersion(preset.OpenShift),
PodmanVersion: version.GetBundleVersion(preset.Podman),
})
}

Expand Down

0 comments on commit c0be0bd

Please sign in to comment.