Repository: code-ready/crc
Pull request #2275 (2021-04-27 09:02:49)

Remove podman preflight check. Podman is already included in the bundle.
There is no need to download it separately.
Included in code-ready/snc#318

openshift-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/code-ready/crc/pull/2275#" title="Author self-approved">guillaumerose</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=code-ready%2Fcrc).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/code-ready/crc/blob/master/OWNERS)~~ [guillaumerose]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
openshift-ci[bot]: @guillaumerose: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
ci/prow/integration-crc | 5f682716abf47a629f375c781ffadc9880ca15b6 | [link](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/code-ready_crc/2275/pull-ci-code-ready-crc-master-integration-crc/1386969075518803968) | `/test integration-crc`

[Full PR test history](https://prow.ci.openshift.org/pr-history?org=code-ready&repo=crc&pr=2275). [Your PR dashboard](https://prow.ci.openshift.org/pr?query=is:pr+state:open+author:guillaumerose).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
guillaumerose: /retest
openshift-ci[bot]: @guillaumerose: PR needs rebase.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>
openshift-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/code-ready/crc/pull/2275#pullrequestreview-646546321" title="Approved">gbraad</a>*, *<a href="https://github.com/code-ready/crc/pull/2275#" title="Author self-approved">guillaumerose</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=code-ready%2Fcrc).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/code-ready/crc/blob/master/OWNERS)~~ [gbraad,guillaumerose]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
praveenkumar: /need-rebase
gbraad: > /need-rebase

That was already added by the @openshift-ci-robot ;-)
openshift-ci-robot: New changes are detected. LGTM label has been removed.
praveenkumar: /lgtm

Patch:
diff --git a/pkg/crc/cache/cache.go b/pkg/crc/cache/cache.go
index 8b6ca6051..ca9612a4e 100644
--- a/pkg/crc/cache/cache.go
+++ b/pkg/crc/cache/cache.go
@@ -65,10 +65,6 @@ func getVersionGeneric(executablePath string, args ...string) (string, error) {
 	return strings.TrimSpace(parsedOutput[1]), nil
 }
 
-func NewPodmanCache() *Cache {
-	return New(constants.PodmanExecutableName, constants.GetPodmanURL(), constants.CrcBinDir, "", nil)
-}
-
 func NewAdminHelperCache() *Cache {
 	url := constants.GetAdminHelperURL()
 	version := path.Base(path.Dir(url))
diff --git a/pkg/crc/constants/constants.go b/pkg/crc/constants/constants.go
index 01c8e8479..3d034d347 100644
--- a/pkg/crc/constants/constants.go
+++ b/pkg/crc/constants/constants.go
@@ -42,20 +42,6 @@ const (
 	AppsDomain    = ".apps-crc.testing"
 )
 
-var podmanURLForOs = map[string]string{
-	"darwin":  fmt.Sprintf("%s/%s", DefaultPodmanURLBase, "podman-remote-latest-master-darwin-amd64.zip"),
-	"linux":   fmt.Sprintf("%s/%s", DefaultPodmanURLBase, "podman-remote-latest-master-linux---amd64.zip"),
-	"windows": fmt.Sprintf("%s/%s", DefaultPodmanURLBase, "podman-remote-latest-master-windows-amd64.zip"),
-}
-
-func GetPodmanURLForOs(os string) string {
-	return podmanURLForOs[os]
-}
-
-func GetPodmanURL() string {
-	return podmanURLForOs[runtime.GOOS]
-}
-
 var adminHelperURLForOs = map[string]string{
 	"darwin":  fmt.Sprintf("%s/%s", DefaultAdminHelperCliBase, "admin-helper-darwin"),
 	"linux":   fmt.Sprintf("%s/%s", DefaultAdminHelperCliBase, "admin-helper-linux"),
diff --git a/pkg/crc/constants/constants_darwin.go b/pkg/crc/constants/constants_darwin.go
index 29cac35c0..f8e306116 100644
--- a/pkg/crc/constants/constants_darwin.go
+++ b/pkg/crc/constants/constants_darwin.go
@@ -8,7 +8,6 @@ import (
 
 const (
 	OcExecutableName          = "oc"
-	PodmanExecutableName      = "podman"
 	TrayExecutableName        = "CodeReady Containers.app"
 	AdminHelperExecutableName = "admin-helper-darwin"
 )
diff --git a/pkg/crc/constants/constants_linux.go b/pkg/crc/constants/constants_linux.go
index d6152b678..8aa5ea5f0 100644
--- a/pkg/crc/constants/constants_linux.go
+++ b/pkg/crc/constants/constants_linux.go
@@ -6,7 +6,6 @@ import (
 
 const (
 	OcExecutableName          = "oc"
-	PodmanExecutableName      = "podman"
 	AdminHelperExecutableName = "admin-helper-linux"
 	TapSocketPath             = ""
 )
diff --git a/pkg/crc/constants/constants_windows.go b/pkg/crc/constants/constants_windows.go
index 60891fb33..7fd8270e2 100644
--- a/pkg/crc/constants/constants_windows.go
+++ b/pkg/crc/constants/constants_windows.go
@@ -7,7 +7,6 @@ import (
 
 const (
 	OcExecutableName            = "oc.exe"
-	PodmanExecutableName        = "podman.exe"
 	AdminHelperExecutableName   = "admin-helper-windows.exe"
 	TrayExecutableName          = "tray-windows.exe"
 	TrayShortcutName            = "tray-windows.lnk"
diff --git a/pkg/crc/preflight/preflight_checks_common.go b/pkg/crc/preflight/preflight_checks_common.go
index efd0ee713..99c5f8a3a 100644
--- a/pkg/crc/preflight/preflight_checks_common.go
+++ b/pkg/crc/preflight/preflight_checks_common.go
@@ -30,13 +30,6 @@ var bundleCheck = Check{
 }
 
 var genericPreflightChecks = [...]Check{
-	{
-		configKeySuffix:  "check-podman-cached",
-		checkDescription: "Checking if podman remote executable is cached",
-		check:            checkPodmanExecutableCached,
-		fixDescription:   "Caching podman remote executable",
-		fix:              fixPodmanExecutableCached,
-	},
 	{
 		configKeySuffix:  "check-admin-helper-cached",
 		checkDescription: "Checking if admin-helper executable is cached",
@@ -140,22 +133,6 @@ func fixBundleExtracted() error {
 	return nil
 }
 
-// Check if podman executable is cached or not
-func checkPodmanExecutableCached() error {
-	// Disable the podman cache until further notice
-	logging.Debug("Currently podman remote is not supported")
-	return nil
-}
-
-func fixPodmanExecutableCached() error {
-	podman := cache.NewPodmanCache()
-	if err := podman.EnsureIsCached(); err != nil {
-		return fmt.Errorf("Unable to download podman remote executable %v", err)
-	}
-	logging.Debug("podman remote executable cached")
-	return nil
-}
-
 // Check if helper executable is cached or not
 func checkAdminHelperExecutableCached() error {
 	if version.IsMacosInstallPathSet() {


Test patch:
diff --git a/pkg/crc/preflight/preflight_darwin_test.go b/pkg/crc/preflight/preflight_darwin_test.go
index 3d7d6847a..fbb35915e 100644
--- a/pkg/crc/preflight/preflight_darwin_test.go
+++ b/pkg/crc/preflight/preflight_darwin_test.go
@@ -12,13 +12,13 @@ import (
 func TestCountConfigurationOptions(t *testing.T) {
 	cfg := config.New(config.NewEmptyInMemoryStorage())
 	RegisterSettings(cfg)
-	assert.Len(t, cfg.AllConfigs(), 11)
+	assert.Len(t, cfg.AllConfigs(), 10)
 }
 
 func TestCountPreflights(t *testing.T) {
-	assert.Len(t, getPreflightChecks(true, false, network.DefaultMode), 17)
-	assert.Len(t, getPreflightChecks(true, true, network.DefaultMode), 17)
+	assert.Len(t, getPreflightChecks(true, false, network.DefaultMode), 16)
+	assert.Len(t, getPreflightChecks(true, true, network.DefaultMode), 16)
 
-	assert.Len(t, getPreflightChecks(true, false, network.VSockMode), 16)
-	assert.Len(t, getPreflightChecks(true, true, network.VSockMode), 16)
+	assert.Len(t, getPreflightChecks(true, false, network.VSockMode), 15)
+	assert.Len(t, getPreflightChecks(true, true, network.VSockMode), 15)
 }
diff --git a/pkg/crc/preflight/preflight_linux_test.go b/pkg/crc/preflight/preflight_linux_test.go
index d12b340f3..f49dd3184 100644
--- a/pkg/crc/preflight/preflight_linux_test.go
+++ b/pkg/crc/preflight/preflight_linux_test.go
@@ -63,7 +63,6 @@ var checkListForDistros = []checkListForDistro{
 		systemdResolved: true,
 		checks: []Check{
 			{check: checkIfRunningAsNormalUser},
-			{check: checkPodmanExecutableCached},
 			{check: checkAdminHelperExecutableCached},
 			{check: checkSupportedCPUArch},
 			{configKeySuffix: "check-ram"},
@@ -97,7 +96,6 @@ var checkListForDistros = []checkListForDistro{
 		systemdResolved: false,
 		checks: []Check{
 			{check: checkIfRunningAsNormalUser},
-			{check: checkPodmanExecutableCached},
 			{check: checkAdminHelperExecutableCached},
 			{check: checkSupportedCPUArch},
 			{configKeySuffix: "check-ram"},
@@ -130,7 +128,6 @@ var checkListForDistros = []checkListForDistro{
 		systemdResolved: false,
 		checks: []Check{
 			{check: checkIfRunningAsNormalUser},
-			{check: checkPodmanExecutableCached},
 			{check: checkAdminHelperExecutableCached},
 			{check: checkSupportedCPUArch},
 			{configKeySuffix: "check-ram"},
@@ -157,7 +154,6 @@ var checkListForDistros = []checkListForDistro{
 		systemdResolved: true,
 		checks: []Check{
 			{check: checkIfRunningAsNormalUser},
-			{check: checkPodmanExecutableCached},
 			{check: checkAdminHelperExecutableCached},
 			{check: checkSupportedCPUArch},
 			{configKeySuffix: "check-ram"},
@@ -191,7 +187,6 @@ var checkListForDistros = []checkListForDistro{
 		systemdResolved: false,
 		checks: []Check{
 			{check: checkIfRunningAsNormalUser},
-			{check: checkPodmanExecutableCached},
 			{check: checkAdminHelperExecutableCached},
 			{check: checkSupportedCPUArch},
 			{configKeySuffix: "check-ram"},
@@ -224,7 +219,6 @@ var checkListForDistros = []checkListForDistro{
 		systemdResolved: false,
 		checks: []Check{
 			{check: checkIfRunningAsNormalUser},
-			{check: checkPodmanExecutableCached},
 			{check: checkAdminHelperExecutableCached},
 			{check: checkSupportedCPUArch},
 			{configKeySuffix: "check-ram"},
@@ -251,7 +245,6 @@ var checkListForDistros = []checkListForDistro{
 		systemdResolved: true,
 		checks: []Check{
 			{check: checkIfRunningAsNormalUser},
-			{check: checkPodmanExecutableCached},
 			{check: checkAdminHelperExecutableCached},
 			{check: checkSupportedCPUArch},
 			{configKeySuffix: "check-ram"},
@@ -285,7 +278,6 @@ var checkListForDistros = []checkListForDistro{
 		systemdResolved: false,
 		checks: []Check{
 			{check: checkIfRunningAsNormalUser},
-			{check: checkPodmanExecutableCached},
 			{check: checkAdminHelperExecutableCached},
 			{check: checkSupportedCPUArch},
 			{configKeySuffix: "check-ram"},
@@ -318,7 +310,6 @@ var checkListForDistros = []checkListForDistro{
 		systemdResolved: false,
 		checks: []Check{
 			{check: checkIfRunningAsNormalUser},
-			{check: checkPodmanExecutableCached},
 			{check: checkAdminHelperExecutableCached},
 			{check: checkSupportedCPUArch},
 			{configKeySuffix: "check-ram"},
@@ -345,7 +336,6 @@ var checkListForDistros = []checkListForDistro{
 		systemdResolved: true,
 		checks: []Check{
 			{check: checkIfRunningAsNormalUser},
-			{check: checkPodmanExecutableCached},
 			{check: checkAdminHelperExecutableCached},
 			{check: checkSupportedCPUArch},
 			{configKeySuffix: "check-ram"},
@@ -380,7 +370,6 @@ var checkListForDistros = []checkListForDistro{
 		systemdResolved: false,
 		checks: []Check{
 			{check: checkIfRunningAsNormalUser},
-			{check: checkPodmanExecutableCached},
 			{check: checkAdminHelperExecutableCached},
 			{check: checkSupportedCPUArch},
 			{configKeySuffix: "check-ram"},
@@ -414,7 +403,6 @@ var checkListForDistros = []checkListForDistro{
 		systemdResolved: false,
 		checks: []Check{
 			{check: checkIfRunningAsNormalUser},
-			{check: checkPodmanExecutableCached},
 			{check: checkAdminHelperExecutableCached},
 			{check: checkSupportedCPUArch},
 			{configKeySuffix: "check-ram"},
diff --git a/pkg/crc/preflight/preflight_windows_test.go b/pkg/crc/preflight/preflight_windows_test.go
index da9068383..40ba6336c 100644
--- a/pkg/crc/preflight/preflight_windows_test.go
+++ b/pkg/crc/preflight/preflight_windows_test.go
@@ -11,13 +11,13 @@ import (
 func TestCountConfigurationOptions(t *testing.T) {
 	cfg := config.New(config.NewEmptyInMemoryStorage())
 	RegisterSettings(cfg)
-	assert.Len(t, cfg.AllConfigs(), 13)
+	assert.Len(t, cfg.AllConfigs(), 12)
 }
 
 func TestCountPreflights(t *testing.T) {
-	assert.Len(t, getPreflightChecks(false, false, network.DefaultMode), 18)
-	assert.Len(t, getPreflightChecks(true, true, network.DefaultMode), 21)
+	assert.Len(t, getPreflightChecks(false, false, network.DefaultMode), 17)
+	assert.Len(t, getPreflightChecks(true, true, network.DefaultMode), 20)
 
-	assert.Len(t, getPreflightChecks(false, false, network.VSockMode), 19)
-	assert.Len(t, getPreflightChecks(true, true, network.VSockMode), 22)
+	assert.Len(t, getPreflightChecks(false, false, network.VSockMode), 18)
+	assert.Len(t, getPreflightChecks(true, true, network.VSockMode), 21)
 }