Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] crc setup panics when image tag is missing #4470

Closed
redbeam opened this issue Nov 20, 2024 · 1 comment
Closed

[BUG] crc setup panics when image tag is missing #4470

redbeam opened this issue Nov 20, 2024 · 1 comment
Labels
kind/bug Something isn't working status/need triage

Comments

@redbeam
Copy link
Contributor

redbeam commented Nov 20, 2024

General information

  • OS: Linux + macOS
  • Hypervisor: irrelevant
  • Did you run crc setup before starting it (Yes/No)? No
  • Running CRC on: Laptop

CRC version

$ crc version
CRC version: 2.43.0+b6ffde
OpenShift version: 4.17.3
MicroShift version: 4.17.3

CRC status

$ crc status --log-level debug
DEBU CRC version: 2.43.0+b6ffde                   
DEBU OpenShift version: 4.17.3                    
DEBU MicroShift version: 4.17.3                   
DEBU Running 'crc status'                         
Machine does not exist. Use 'crc start' to create it

CRC config

$ crc config view
- consent-telemetry                     : no

Host Operating System

$ sw_vers 
ProductName:		macOS
ProductVersion:		15.1
BuildVersion:		24B83

Steps to reproduce

  1. crc setup -b docker://quay.io/crcont/openshift-bundle

Expected

setup should warn user about the missing tag/end with an error/assume "latest" for the tag (or some other default value)

Actual

$ crc setup -b docker://quay.io/crcont/openshift-bundle
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/crc-org/crc/v2/pkg/crc/machine/bundle.GetBundleNameFromURI({0x16d2bb90d, 0x28})
	/Users/mskvarla/crc/pkg/crc/machine/bundle/metadata.go:247 +0x138
github.com/crc-org/crc/v2/pkg/crc/validation.ValidateBundle({0x16d2bb90d, 0x28}, {0x1043cde37, 0x9})
	/Users/mskvarla/crc/pkg/crc/validation/validation.go:92 +0x30
github.com/crc-org/crc/v2/cmd/crc/cmd.runSetup({0x32d7a000000c9c18?, 0x673db5bc?, 0x140000c9b88?})
	/Users/mskvarla/crc/cmd/crc/cmd/setup.go:63 +0x214
github.com/crc-org/crc/v2/cmd/crc/cmd.init.func10(0x1043d7913?, {0x140004a5080, 0x0, 0x2})
	/Users/mskvarla/crc/cmd/crc/cmd/setup.go:42 +0x60
github.com/crc-org/crc/v2/cmd/crc/cmd.attachMiddleware.executeWithLogging.func1(0x105ec68c0, {0x140004a5080, 0x0, 0x2})
	/Users/mskvarla/crc/cmd/crc/cmd/root.go:170 +0xb0
github.com/spf13/cobra.(*Command).execute(0x105ec68c0, {0x140004a5060, 0x2, 0x2})
	/Users/mskvarla/crc/vendor/github.com/spf13/cobra/command.go:985 +0x834
github.com/spf13/cobra.(*Command).ExecuteC(0x105ec65e0)
	/Users/mskvarla/crc/vendor/github.com/spf13/cobra/command.go:1117 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/mskvarla/crc/vendor/github.com/spf13/cobra/command.go:1041
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	/Users/mskvarla/crc/vendor/github.com/spf13/cobra/command.go:1034
github.com/crc-org/crc/v2/cmd/crc/cmd.Execute()
	/Users/mskvarla/crc/cmd/crc/cmd/root.go:106 +0xcc
main.main()
	/Users/mskvarla/crc/cmd/crc/main.go:8 +0x1c
@redbeam redbeam added kind/bug Something isn't working status/need triage labels Nov 20, 2024
A-725-K added a commit to A-725-K/crc that referenced this issue Nov 21, 2024
The "latest" tag is not supported, therefore it is necessary to stop
with an error in case it is not provided when using the -b flag command
line flag.

Add unit tests to reproduce the bug and verify the fix.

Closes issue crc-org#4470
A-725-K added a commit to A-725-K/crc that referenced this issue Nov 21, 2024
The "latest" tag is not supported, therefore it is necessary to stop
with an error in case it is not provided when using the -b flag command
line flag.

Add unit tests to reproduce the bug and verify the fix.

Closes issue crc-org#4470
A-725-K added a commit to A-725-K/crc that referenced this issue Nov 22, 2024
The "latest" tag is not supported, therefore it is necessary to stop
with an error in case it is not provided when using the -b flag command
line flag.

Add unit tests to reproduce the bug and verify the fix.

Closes issue crc-org#4470
A-725-K added a commit to A-725-K/crc that referenced this issue Nov 25, 2024
The "latest" tag is not supported, therefore it is necessary to stop
with an error in case it is not provided when using the -b flag command
line flag.

Add unit tests to reproduce the bug and verify the fix.

Closes issue crc-org#4470
A-725-K added a commit to A-725-K/crc that referenced this issue Nov 25, 2024
The "latest" tag is not supported, therefore it is necessary to stop
with an error in case it is not provided when using the -b flag command
line flag.

Add unit tests to reproduce the bug and verify the fix.

Closes issue crc-org#4470
praveenkumar pushed a commit that referenced this issue Nov 26, 2024
The "latest" tag is not supported, therefore it is necessary to stop
with an error in case it is not provided when using the -b flag command
line flag.

Add unit tests to reproduce the bug and verify the fix.

Closes issue #4470
@redbeam
Copy link
Contributor Author

redbeam commented Nov 26, 2024

Fixed in #4474

@redbeam redbeam closed this as completed Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/need triage
Projects
None yet
Development

No branches or pull requests

1 participant