Repository: code-ready/crc
Pull request #3045 (2022-03-03 07:36:08)

Doc Deploy: Use main branch instead master
This allow us to publish the docs from main branch instead of master.


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

This pull-request has been approved by: *<a href="https://github.com/code-ready/crc/pull/3045#" title="Author self-approved">praveenkumar</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/main/OWNERS)~~ [praveenkumar]

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":[]} -->

Patch:
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 7c63edd16..531998792 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -131,4 +131,4 @@ workflows:
             - build_docs
           filters:
             branches:
-              only: master
+              only: main
diff --git a/Makefile b/Makefile
index bc2669f25..c815f8009 100644
--- a/Makefile
+++ b/Makefile
@@ -3,11 +3,11 @@ SHELL := /bin/bash
 OPENSHIFT_VERSION ?= 4.9.18
 PODMAN_VERSION ?= 3.4.4
 BUNDLE_EXTENSION = crcbundle
-CRC_VERSION = 1.99.3
+CRC_VERSION = 1.99.4
 COMMIT_SHA=$(shell git rev-parse --short HEAD)
 MACOS_INSTALL_PATH = /Applications/CodeReady Containers.app/Contents/Resources
 CONTAINER_RUNTIME ?= podman
-GOLANGCI_LINT_VERSION = v1.44.0
+GOLANGCI_LINT_VERSION = v1.44.2
 
 ifdef OKD_VERSION
     OPENSHIFT_VERSION = $(OKD_VERSION)
diff --git a/centos_ci.sh b/centos_ci.sh
index 0b717f944..983eb26cb 100644
--- a/centos_ci.sh
+++ b/centos_ci.sh
@@ -2,7 +2,7 @@
 
 # bundle location
 BUNDLE_VERSION=4.9.15
-BUNDLE=crc_libvirt_$BUNDLE_VERSION.crcbundle
+BUNDLE=crc_libvirt_$BUNDLE_VERSION_amd64.crcbundle
 GO_VERSION=1.16.10
 
 # Output command before executing
@@ -51,7 +51,6 @@ function install_required_packages() {
     libvirt-devel \
     jq \
     gcc \
-    unzip \
     podman
 
   # Install the required version of golang
@@ -111,8 +110,7 @@ function perform_artifacts_upload() {
 
 function get_bundle() {
   mkdir $HOME/Downloads
-  curl -L "https://storage.googleapis.com/crc-bundle-github-ci/crc_libvirt_$BUNDLE_VERSION.zip" -o $HOME/Downloads/bundle.zip
-  unzip -P $CRC_BUNDLE_PASSWORD $HOME/Downloads/bundle.zip -d $HOME/Downloads/
+  curl -L "https://storage.googleapis.com/crc-bundle-github-ci/${BUNDLE}" -o $HOME/Downloads/${BUNDLE}
 }
 
 function upload_logs() {
diff --git a/cmd/crc/cmd/version.go b/cmd/crc/cmd/version.go
index fdaa24e32..0f0fa21b5 100644
--- a/cmd/crc/cmd/version.go
+++ b/cmd/crc/cmd/version.go
@@ -6,7 +6,6 @@ import (
 	"os"
 
 	crcConfig "github.com/code-ready/crc/pkg/crc/config"
-	"github.com/code-ready/crc/pkg/crc/constants"
 	"github.com/code-ready/crc/pkg/crc/logging"
 	crcversion "github.com/code-ready/crc/pkg/crc/version"
 	"github.com/spf13/cobra"
@@ -34,22 +33,18 @@ func runPrintVersion(writer io.Writer, version *version, outputFormat string) er
 }
 
 type version struct {
-	Version             string `json:"version"`
-	Commit              string `json:"commit"`
-	OpenshiftVersion    string `json:"openshiftVersion"`
-	InstalledBundlePath string `json:"installedBundlePath,omitempty"`
+	Version          string `json:"version"`
+	Commit           string `json:"commit"`
+	OpenshiftVersion string `json:"openshiftVersion"`
+	PodmanVersion    string `json:"podmanVersion"`
 }
 
 func defaultVersion() *version {
-	var installedBundlePath string
-	if crcversion.IsInstaller() {
-		installedBundlePath = constants.GetDefaultBundlePath(crcConfig.GetPreset(config))
-	}
 	return &version{
-		Version:             crcversion.GetCRCVersion(),
-		Commit:              crcversion.GetCommitSha(),
-		OpenshiftVersion:    crcversion.GetBundleVersion(),
-		InstalledBundlePath: installedBundlePath,
+		Version:          crcversion.GetCRCVersion(),
+		Commit:           crcversion.GetCommitSha(),
+		OpenshiftVersion: crcversion.GetBundleVersion(),
+		PodmanVersion:    crcversion.GetPodmanVersion(),
 	}
 }
 
@@ -63,15 +58,9 @@ func (v *version) prettyPrintTo(writer io.Writer) error {
 }
 
 func (v *version) lines() []string {
-	var bundleStatus string
-	switch {
-	case v.InstalledBundlePath != "":
-		bundleStatus = fmt.Sprintf("bundle installed at %s", v.InstalledBundlePath)
-	default:
-		bundleStatus = "not embedded in executable"
-	}
 	return []string{
 		fmt.Sprintf("CodeReady Containers version: %s+%s\n", v.Version, v.Commit),
-		fmt.Sprintf("OpenShift version: %s (%s)\n", v.OpenshiftVersion, bundleStatus),
+		fmt.Sprintf("OpenShift version: %s\n", v.OpenshiftVersion),
+		fmt.Sprintf("Podman version: %s\n", v.PodmanVersion),
 	}
 }
diff --git a/images/rpmbuild/Containerfile.in b/images/rpmbuild/Containerfile.in
index 4b5f54335..ae34061ed 100644
--- a/images/rpmbuild/Containerfile.in
+++ b/images/rpmbuild/Containerfile.in
@@ -1,8 +1,8 @@
 FROM quay.io/centos/centos:stream8
 WORKDIR $APP_ROOT/src
 RUN yum -y install git-core rpm-build dnf-plugins-core 'dnf-command(builddep)' \
-        https://github.com/code-ready/admin-helper/releases/download/v0.0.9/crc-admin-helper-0.0.9-1.el8.x86_64.rpm \
-	https://github.com/code-ready/machine-driver-libvirt/releases/download/0.13.1/crc-driver-libvirt-0.13.1-1.el8.x86_64.rpm
+        https://github.com/code-ready/admin-helper/releases/download/0.0.10/crc-admin-helper-0.0.10-1.el8.x86_64.rpm \
+	https://github.com/code-ready/machine-driver-libvirt/releases/download/0.13.2/crc-driver-libvirt-0.13.2-1.el8.x86_64.rpm
 COPY . .
 RUN mkdir -p ~/rpmbuild/SOURCES/ && \
     git archive --format=tar --prefix=crc-__VERSION__-__OPENSHIFT_VERSION__/ HEAD | gzip >~/rpmbuild/SOURCES/crc-__VERSION__.tar.gz
diff --git a/pkg/crc/api/client/types.go b/pkg/crc/api/client/types.go
index 07f751bf6..5d78050e9 100644
--- a/pkg/crc/api/client/types.go
+++ b/pkg/crc/api/client/types.go
@@ -9,6 +9,7 @@ type VersionResult struct {
 	CrcVersion       string
 	CommitSha        string
 	OpenshiftVersion string
+	PodmanVersion    string
 }
 
 type StartResult struct {
diff --git a/pkg/crc/api/handlers.go b/pkg/crc/api/handlers.go
index 6521c02e5..d356b5afa 100644
--- a/pkg/crc/api/handlers.go
+++ b/pkg/crc/api/handlers.go
@@ -124,6 +124,7 @@ func (h *Handler) GetVersion(c *context) error {
 		CrcVersion:       version.GetCRCVersion(),
 		CommitSha:        version.GetCommitSha(),
 		OpenshiftVersion: version.GetBundleVersion(),
+		PodmanVersion:    version.GetPodmanVersion(),
 	})
 }
 
diff --git a/pkg/crc/constants/constants.go b/pkg/crc/constants/constants.go
index 6f393f0fc..3b7fccc66 100644
--- a/pkg/crc/constants/constants.go
+++ b/pkg/crc/constants/constants.go
@@ -24,7 +24,7 @@ const (
 	DaemonLogFile             = "crcd.log"
 	CrcLandingPageURL         = "https://cloud.redhat.com/openshift/create/local" // #nosec G101
 	DefaultPodmanURLBase      = "https://storage.googleapis.com/libpod-master-releases"
-	DefaultAdminHelperCliBase = "https://github.com/code-ready/admin-helper/releases/download/v0.0.8"
+	DefaultAdminHelperCliBase = "https://github.com/code-ready/admin-helper/releases/download/0.0.10"
 	CRCMacTrayDownloadURL     = "https://github.com/code-ready/tray-electron/releases/download/%s/crc-tray-macos.tar.gz"
 	CRCWindowsTrayDownloadURL = "https://github.com/code-ready/tray-electron/releases/download/%s/crc-tray-windows.zip"
 	DefaultContext            = "admin"
diff --git a/pkg/crc/machine/libvirt/constants.go b/pkg/crc/machine/libvirt/constants.go
index 22e59857f..6cddcddf5 100644
--- a/pkg/crc/machine/libvirt/constants.go
+++ b/pkg/crc/machine/libvirt/constants.go
@@ -17,7 +17,7 @@ const (
 
 const (
 	MachineDriverCommand = "crc-driver-libvirt"
-	MachineDriverVersion = "0.13.1"
+	MachineDriverVersion = "0.13.2"
 )
 
 var (
diff --git a/pkg/crc/version/version.go b/pkg/crc/version/version.go
index ab30251ee..d5c5532e8 100644
--- a/pkg/crc/version/version.go
+++ b/pkg/crc/version/version.go
@@ -43,7 +43,7 @@ var (
 const (
 	releaseInfoLink = "https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/latest/release-info.json"
 	// Tray version to be embedded in executable
-	crcTrayElectronVersion = "1.1.2"
+	crcTrayElectronVersion = "1.1.3"
 )
 
 type CrcReleaseInfo struct {


Test patch:
diff --git a/cmd/crc/cmd/version_test.go b/cmd/crc/cmd/version_test.go
index de449fb98..059893ba3 100644
--- a/cmd/crc/cmd/version_test.go
+++ b/cmd/crc/cmd/version_test.go
@@ -10,25 +10,26 @@ import (
 func TestPlainVersion(t *testing.T) {
 	out := new(bytes.Buffer)
 	assert.NoError(t, runPrintVersion(out, &version{
-		Version:             "1.13",
-		Commit:              "aabbcc",
-		OpenshiftVersion:    "4.5.4",
-		InstalledBundlePath: "",
+		Version:          "1.13",
+		Commit:           "aabbcc",
+		OpenshiftVersion: "4.5.4",
+		PodmanVersion:    "3.4.4",
 	}, ""))
 	assert.Equal(t, `CodeReady Containers version: 1.13+aabbcc
-OpenShift version: 4.5.4 (not embedded in executable)
+OpenShift version: 4.5.4
+Podman version: 3.4.4
 `, out.String())
 }
 
 func TestJsonVersion(t *testing.T) {
 	out := new(bytes.Buffer)
 	assert.NoError(t, runPrintVersion(out, &version{
-		Version:             "1.13",
-		Commit:              "aabbcc",
-		OpenshiftVersion:    "4.5.4",
-		InstalledBundlePath: "",
+		Version:          "1.13",
+		Commit:           "aabbcc",
+		OpenshiftVersion: "4.5.4",
+		PodmanVersion:    "3.4.4",
 	}, "json"))
 
-	expected := `{"version": "1.13", "commit": "aabbcc", "openshiftVersion": "4.5.4"}`
+	expected := `{"version": "1.13", "commit": "aabbcc", "openshiftVersion": "4.5.4", "podmanVersion": "3.4.4"}`
 	assert.JSONEq(t, expected, out.String())
 }
diff --git a/pkg/crc/api/api_client_test.go b/pkg/crc/api/api_client_test.go
index 497e53f50..696d8da0e 100644
--- a/pkg/crc/api/api_client_test.go
+++ b/pkg/crc/api/api_client_test.go
@@ -52,6 +52,7 @@ func TestVersion(t *testing.T) {
 			CrcVersion:       version.GetCRCVersion(),
 			OpenshiftVersion: version.GetBundleVersion(),
 			CommitSha:        version.GetCommitSha(),
+			PodmanVersion:    version.GetPodmanVersion(),
 		},
 		vr,
 	)
diff --git a/pkg/crc/api/api_http_test.go b/pkg/crc/api/api_http_test.go
index 38aef659a..a3637981d 100644
--- a/pkg/crc/api/api_http_test.go
+++ b/pkg/crc/api/api_http_test.go
@@ -265,7 +265,7 @@ var testCases = []testCase{
 	// version
 	{
 		request:  get("version"),
-		response: jSon(fmt.Sprintf(`{"CrcVersion":"%s","CommitSha":"%s","OpenshiftVersion":"%s"}`, version.GetCRCVersion(), version.GetCommitSha(), version.GetBundleVersion())),
+		response: jSon(fmt.Sprintf(`{"CrcVersion":"%s","CommitSha":"%s","OpenshiftVersion":"%s","PodmanVersion":"%s"}`, version.GetCRCVersion(), version.GetCommitSha(), version.GetBundleVersion(), version.GetPodmanVersion())),
 	},
 
 	// version never fails
diff --git a/test/e2e/crcsuite/crcsuite.go b/test/e2e/crcsuite/crcsuite.go
index 768a8d087..3a9c699b7 100644
--- a/test/e2e/crcsuite/crcsuite.go
+++ b/test/e2e/crcsuite/crcsuite.go
@@ -23,13 +23,13 @@ import (
 )
 
 var (
-	CRCHome        string
-	CRCExecutable  string
-	bundleEmbedded bool
-	bundleName     string
-	bundleLocation string
-	pullSecretFile string
-	cleanupHome    bool
+	CRCHome            string
+	CRCExecutable      string
+	userProvidedBundle bool
+	bundleName         string
+	bundleLocation     string
+	pullSecretFile     string
+	cleanupHome        bool
 )
 
 func usingPreexistingCluster() bool {
@@ -113,11 +113,11 @@ func FeatureContext(s *godog.Suite) {
 		}
 
 		if bundleLocation == "" {
-			fmt.Println("Expecting the bundle to be embedded in the CRC executable.")
-			bundleEmbedded = true
+			fmt.Println("Expecting the bundle provided by the user")
+			userProvidedBundle = false
 			bundleName = constants.GetDefaultBundle(preset.OpenShift)
 		} else {
-			bundleEmbedded = false
+			userProvidedBundle = true
 			_, bundleName = filepath.Split(bundleLocation)
 		}
 
@@ -135,7 +135,7 @@ func FeatureContext(s *godog.Suite) {
 			}
 		}
 
-		if !bundleEmbedded {
+		if userProvidedBundle {
 			if _, err := os.Stat(bundleLocation); err != nil {
 				if !os.IsNotExist(err) {
 					fmt.Printf("Unexpected error obtaining the bundle %v.\n", bundleLocation)
@@ -365,7 +365,7 @@ func StartCRCWithDefaultBundleSucceedsOrFails(expected string) error {
 	var cmd string
 	var extraBundleArgs string
 
-	if !bundleEmbedded {
+	if userProvidedBundle {
 		extraBundleArgs = fmt.Sprintf("-b %s", bundleLocation)
 	}
 	crcStart := crcCmd.CRC("start").ToString()
@@ -380,7 +380,7 @@ func StartCRCWithDefaultBundleWithStopNetworkTimeSynchronizationSucceedsOrFails(
 	var cmd string
 	var extraBundleArgs string
 
-	if !bundleEmbedded {
+	if userProvidedBundle {
 		extraBundleArgs = fmt.Sprintf("-b %s", bundleLocation)
 	}
 	crcStart := crcCmd.CRC("start").WithDisableNTP().ToString()
@@ -399,7 +399,7 @@ func StartCRCWithCustomBundleSucceedsOrFails(expected string) error {
 func StartCRCWithDefaultBundleAndNameServerSucceedsOrFails(nameserver string, expected string) error {
 
 	var extraBundleArgs string
-	if !bundleEmbedded {
+	if userProvidedBundle {
 		extraBundleArgs = fmt.Sprintf("-b %s", bundleLocation)
 	}
 
@@ -410,7 +410,7 @@ func StartCRCWithDefaultBundleAndNameServerSucceedsOrFails(nameserver string, ex
 
 func SetConfigPropertyToValueSucceedsOrFails(property string, value string, expected string) error {
 	if value == "current bundle" {
-		if bundleEmbedded {
+		if !userProvidedBundle {
 			value = filepath.Join(CRCHome, "cache", bundleName)
 		} else {
 			value = bundleLocation
@@ -424,5 +424,8 @@ func ExecuteCommand(command string) error {
 }
 
 func ExecuteCommandWithExpectedExitStatus(command string, expectedExitStatus string) error {
+	if command == "setup" && userProvidedBundle {
+		command = fmt.Sprintf("%s -b %s", command, bundleLocation)
+	}
 	return crcCmd.CRC(command).ExecuteWithExpectedExit(expectedExitStatus)
 }
diff --git a/test/e2e/features/basic.feature b/test/e2e/features/basic.feature
index 54daab137..44201a3ba 100644
--- a/test/e2e/features/basic.feature
+++ b/test/e2e/features/basic.feature
@@ -62,7 +62,7 @@ Feature: Basic test
         Then executing "crc setup --check-only" fails
         And starting CRC with default bundle fails
 	And stderr should contain "Preflight checks failed during `crc start`, please try to run `crc setup` first in case you haven't done so yet"
-	And executing "crc setup" succeeds
+	And executing crc setup command succeeds
 
     @darwin
     Scenario: CRC setup on Mac
diff --git a/test/e2e/features/cert_rotation.feature b/test/e2e/features/cert_rotation.feature
index a45f8807a..beb7376bb 100644
--- a/test/e2e/features/cert_rotation.feature
+++ b/test/e2e/features/cert_rotation.feature
@@ -6,7 +6,7 @@ Feature: Certificate rotation test
     an app and check its accessibility.
 
     Scenario: Setup CRC
-        Given execute crc setup command succeeds
+        Given executing crc setup command succeeds
 
     Scenario: Set clock to 3 months ahead on the host
         Given executing "sudo timedatectl set-ntp off" succeeds
diff --git a/test/e2e/features/story_health.feature b/test/e2e/features/story_health.feature
index 6b5d1012b..be38f0088 100644
--- a/test/e2e/features/story_health.feature
+++ b/test/e2e/features/story_health.feature
@@ -8,7 +8,7 @@ Feature: End-to-end health check
 
     @linux @darwin @startstop
     Scenario: Start CRC
-        Given execute crc setup command succeeds
+        Given executing crc setup command succeeds
         When setting config property "memory" to value "12000" succeeds
         When starting CRC with default bundle succeeds
         Then stdout should contain "Started the OpenShift cluster"
@@ -21,7 +21,7 @@ Feature: End-to-end health check
 
     @windows @startstop
     Scenario: Start CRC on Windows
-        Given execute crc setup command succeeds
+        Given executing crc setup command succeeds
         When setting config property "memory" to value "12000" succeeds
         When starting CRC with default bundle and nameserver "10.75.5.25" succeeds
         Then stdout should contain "Started the OpenShift cluster"
diff --git a/test/e2e/features/story_marketplace.feature b/test/e2e/features/story_marketplace.feature
index 80ba248ee..a4492ec7f 100644
--- a/test/e2e/features/story_marketplace.feature
+++ b/test/e2e/features/story_marketplace.feature
@@ -6,7 +6,7 @@ Feature: Operator from marketplace
 
     @linux @darwin @startstop
     Scenario: Start CRC
-        Given execute crc setup command succeeds
+        Given executing crc setup command succeeds
         When starting CRC with default bundle succeeds
         Then stdout should contain "Started the OpenShift cluster"
 
diff --git a/test/e2e/features/story_registry.feature b/test/e2e/features/story_registry.feature
index 4e9b8e54d..acc6467b5 100644
--- a/test/e2e/features/story_registry.feature
+++ b/test/e2e/features/story_registry.feature
@@ -7,7 +7,7 @@ Feature: Local image to image-registry
 
     @startstop
     Scenario: Start CRC
-        Given execute crc setup command succeeds
+        Given executing crc setup command succeeds
         When starting CRC with default bundle succeeds
         Then stdout should contain "Started the OpenShift cluster"
 
diff --git a/test/integration/resize_test.go b/test/integration/resize_test.go
index a2867b06a..a535ba3ee 100644
--- a/test/integration/resize_test.go
+++ b/test/integration/resize_test.go
@@ -12,12 +12,16 @@ var _ = Describe("vary VM parameters: memory cpus, disk", func() {
 	Describe("use default values", func() {
 
 		It("setup CRC", func() {
-			Expect(RunCRCExpectSuccess("setup")).To(ContainSubstring("Your system is correctly setup for using CodeReady Containers"))
+			if bundlePath == "" {
+				Expect(RunCRCExpectSuccess("setup")).To(ContainSubstring("Your system is correctly setup for using CodeReady Containers"))
+			} else {
+				Expect(RunCRCExpectSuccess("setup", "-b", bundlePath)).To(ContainSubstring("Your system is correctly setup for using CodeReady Containers"))
+			}
 		})
 
 		It("start CRC", func() {
 			// default values: "--memory", "9216", "--cpus", "4", "disk-size", "31"
-			if bundlePath == "embedded" {
+			if bundlePath == "" {
 				Expect(RunCRCExpectSuccess("start", "-p", pullSecretPath)).To(ContainSubstring("Started the OpenShift cluster"))
 			} else {
 				Expect(RunCRCExpectSuccess("start", "-b", bundlePath, "-p", pullSecretPath)).To(ContainSubstring("Started the OpenShift cluster"))
diff --git a/test/integration/testsuite_test.go b/test/integration/testsuite_test.go
index a425889d4..099c68446 100644
--- a/test/integration/testsuite_test.go
+++ b/test/integration/testsuite_test.go
@@ -17,7 +17,6 @@ type VersionAnswer struct {
 	Version          string `json:"version"`
 	Commit           string `json:"commit"`
 	OpenshiftVersion string `json:"openshiftVersion"`
-	Embedded         bool   `json:"embedded"`
 }
 
 var credPath string
@@ -54,13 +53,9 @@ var _ = BeforeSuite(func() {
 
 	Expect(err).NotTo(HaveOccurred())
 
-	// bundle location
-	bundlePath = "embedded"
-	if !versionInfo.Embedded {
-		bundlePath = os.Getenv("BUNDLE_PATH") // this env var should contain location of bundle or string "embedded"
-		if bundlePath != "embedded" {         // if real bundle
-			Expect(bundlePath).To(BeAnExistingFile())
-		}
+	bundlePath = os.Getenv("BUNDLE_PATH") // this env var should contain location of bundle
+	if bundlePath != "" {
+		Expect(bundlePath).To(BeAnExistingFile())
 	}
 
 	// pull-secret location