crc-org / crc

CRC is a tool to help you run containers. It manages a local OpenShift 4.x cluster, Microshift or a Podman VM optimized for testing and development purposes
https://crc.dev
Apache License 2.0
1.26k stars 242 forks source link

Return user networking mode as default on macOS and linux & Remove unused flags from goproxy integration test #4380

Closed vyasgun closed 1 month ago

vyasgun commented 1 month ago

Fixes: Issue #4335

Solution/Idea

This PR addresses two issues I encountered while running integration tests on my local machine

Proposed changes

  1. Removed the unused flags
  2. Modified the function for fetching the default networking mode

Testing

make GINKGO_OPTS="--ginkgo.label-filter='openshift-preset'" BUNDLE_PATH="--bundle-path=~/.crc/cache/crc_vfkit_4.16.7_arm64.crcbundle" PULL_SECRET_PATH="--pull-secret-path=~/Downloads/pull-secret.txt" integration
anjannath commented 1 month ago

No panics now..

% make GINKGO_OPTS="--ginkgo.label-filter='goproxy'" BUNDLE_PATH="--bundle-path=/Users/anath/.crc/cache/crc_vfkit_4.16.7_arm64.crcbundle" PULL_SECRET_PATH="--pull-secret-path=/Users/anath/Downloads/pull-secret" integration
Running Suite: Integration - /Users/anath/work/github.com/crc-org/crc/test/integration
======================================================================================
Random Seed: 1727768538

Will run 7 of 36 specs
•••••••SSSSSSSSSSSSSSSSSSSSSSSSSSSSS

Ran 7 of 36 Specs in 953.907 seconds
SUCCESS! -- 7 Passed | 0 Failed | 0 Pending | 29 Skipped
PASS
ok      github.com/crc-org/crc/v2/test/integration      955.429s

@vyasgun need to run make fmt; the CI tests are currently failing because of:

pkg/crc/network/types.go:5: File is not `goimports`-ed (goimports)
    "github.com/crc-org/crc/v2/pkg/crc/logging"
make: *** [cross-lint] Error 1
cfergeau commented 1 month ago

Looks good to me, though make lintwill need fixing as pointed out by Anjan.

vyasgun commented 1 month ago

Thanks @anjannath ! For some reason, make lint fails on my system with the following panics:

gvyas@Gunjans-MacBook-Pro crc % make lint
"/Users/gvyas/work/crc/tools/bin"/golangci-lint run
ERRO [linters_context/goanalysis] fact_purity: panic during analysis: interface conversion: interface {} is nil, not *buildir.IR, goroutine 12222 [running]:
runtime/debug.Stack()
        /opt/homebrew/Cellar/go/1.23.0/libexec/src/runtime/debug/stack.go:26 +0x64
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe.func1()
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:105 +0x4c
panic({0x101b30000?, 0x1400601d1a0?})
        /opt/homebrew/Cellar/go/1.23.0/libexec/src/runtime/panic.go:785 +0x124
honnef.co/go/tools/analysis/facts/purity.purity(0x1400c802380)
        /Users/gvyas/work/crc/tools/vendor/honnef.co/go/tools/analysis/facts/purity/purity.go:109 +0x270
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyze(0x14004249d10)
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:191 +0x8ac
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe.func2()
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:113 +0x20
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0x1400282c2d0, {0x10173ebc3, 0xb}, 0x1400370af30)
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:111 +0x44
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe(0x1010948e0?)
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:112 +0x70
github.com/golangci/golangci-lint/pkg/goanalysis.(*loadingPackage).analyze.func2(0x14004249d10)
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/goanalysis/runner_loadingpackage.go:80 +0xac
created by github.com/golangci/golangci-lint/pkg/goanalysis.(*loadingPackage).analyze in goroutine 3677
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/goanalysis/runner_loadingpackage.go:75 +0x174 
ERRO [linters_context/goanalysis] nilness: panic during analysis: interface conversion: interface {} is nil, not *buildir.IR, goroutine 12218 [running]:
runtime/debug.Stack()
        /opt/homebrew/Cellar/go/1.23.0/libexec/src/runtime/debug/stack.go:26 +0x64
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe.func1()
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:105 +0x4c
panic({0x101b30000?, 0x140060441e0?})
        /opt/homebrew/Cellar/go/1.23.0/libexec/src/runtime/panic.go:785 +0x124
honnef.co/go/tools/analysis/facts/nilness.run(0x1400c98a0e0)
        /Users/gvyas/work/crc/tools/vendor/honnef.co/go/tools/analysis/facts/nilness/nilness.go:65 +0x244
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyze(0x140043b65a0)
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:191 +0x8ac
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe.func2()
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:113 +0x20
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0x1400282c2d0, {0x1016ecf00, 0x7}, 0x1400326f730)
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:111 +0x44
github.com/golangci/golangci-lint/pkg/goanalysis.(*action).analyzeSafe(0x1010948e0?)
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/goanalysis/runner_action.go:112 +0x70
github.com/golangci/golangci-lint/pkg/goanalysis.(*loadingPackage).analyze.func2(0x140043b65a0)
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/goanalysis/runner_loadingpackage.go:80 +0xac
created by github.com/golangci/golangci-lint/pkg/goanalysis.(*loadingPackage).analyze in goroutine 3677
        /Users/gvyas/work/crc/tools/vendor/github.com/golangci/golangci-lint/pkg/goanalysis/runner_loadingpackage.go:75 +0x174 
ERRO [linters_context/goanalysis] typedness: panic during analysis: interface conversion: interface {} is nil, not *buildir.IR, goroutine 12220 [running]:
runtime/debug.Stack()

Figuring out what's wrong. I've updated the PR with the change that was mentioned in the logs so hope the CI tests pass

cfergeau commented 1 month ago

Thanks @anjannath ! For some reason, make lint fails on my system with the following panics:

This can happen when golangci-lint is built with a go version older than the one installed on your system. You can try removing ./tools/bin/golangci-lint and running make lint again.

openshift-ci[bot] commented 1 month ago

@vyasgun: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/integration-crc 0f9cca39ec00f1f1c4d912f031b5be5c502bd6ea link true /test integration-crc
ci/prow/e2e-crc 0f9cca39ec00f1f1c4d912f031b5be5c502bd6ea link true /test e2e-crc

Full PR test history. Your PR dashboard.

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-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
openshift-ci[bot] commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anjannath

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/crc-org/crc/blob/main/OWNERS)~~ [anjannath] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment