Skip to content

fix: allow wildcard channel version #582

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ekitagawa
Copy link
Contributor

@ekitagawa ekitagawa commented Jun 20, 2025

Description

  • fix: allow wildcard channel version

We would like to install MCR 25.0.x with a wildcard channel like this in launchpad.yaml

  "mcr":
    "channel": "stable-25.0"
    "installURLLinux": "https://get.mirantis.com/"
    "installURLWindows": "https://get.mirantis.com/install.ps1"
    "repoURL": "https://repos.mirantis.com"
    "version": "25.0.8"

Related Links

Testing

1. Before the change, it fails at Validate Facts phase.

▶ launchpad version
version: 1.5.13-tp2
commit: fd80698b975657d1a0729bedd07e6e8e7696d962

▶ launchpad apply --debug
.
.
.
INFO ==> Running phase: Validate Facts
DEBU [ssh] 18.224.153.30:22: executing `sudo -- getenforce | grep -iq enforcing 2> /dev/null`
DEBU [ssh] 18.224.153.30:22: sudo: getenforce: command not found
DEBU [ssh] 3.131.157.182:22: executing `sudo -- getenforce | grep -iq enforcing 2> /dev/null`
DEBU [ssh] 3.131.157.182:22: sudo: getenforce: command not found
DEBU [ssh] 3.21.232.53:22: executing `sudo -- getenforce | grep -iq enforcing 2> /dev/null`
DEBU [ssh] 3.21.232.53:22: sudo: getenforce: command not found
DEBU phase 'Validate Facts' took 0s
DEBU tracking analytics event 'Validate Facts'
DEBU tracking analytics event 'Gather Facts'
DEBU tracking analytics event 'Detect host operating systems'
DEBU tracking analytics event 'Check For Upgrades'
DEBU tracking analytics event 'Cluster Apply Failed'
INFO See /Users/eiichi.kitagawa/.mirantis-launchpad/cluster/25YAJ9/apply.log for more logs
FATA failed to apply cluster: failed to apply MKE: phase failure: Validate Facts => validation failed
MCR version and channel don't match, which is required for versions >= 25.0.0; MCR version does not match channel-version '25.0' vs '25.0.8'

2. Test run with the proposed fix.

Validation works out and Launchpad moves onto next phase.

▶ launchpad version
version: 1.5.13-tp2-SNAPSHOT-cbc6a37
commit: cbc6a37eb01b98b172b86e0f929ac7ac07ea8160

▶ launchpad apply --debug
.
.
.
INFO ==> Running phase: Validate Facts
DEBU [ssh] 18.224.153.30:22: executing `sudo -- getenforce | grep -iq enforcing 2> /dev/null`
DEBU [ssh] 18.224.153.30:22: sudo: getenforce: command not found
DEBU [ssh] 3.131.157.182:22: executing `sudo -- getenforce | grep -iq enforcing 2> /dev/null`
DEBU [ssh] 3.131.157.182:22: sudo: getenforce: command not found
DEBU [ssh] 3.21.232.53:22: executing `sudo -- getenforce | grep -iq enforcing 2> /dev/null`
DEBU [ssh] 3.21.232.53:22: sudo: getenforce: command not found
DEBU did not find a MSR installation, falling back to the first MSR host
DEBU validating data plane settings
DEBU phase 'Validate Facts' took 0s
DEBU phase 'Validate Facts' completed successfully
DEBU preparing phase 'Validate Hosts'

3. This change breaks the unit test

▶ go test -v pkg/product/common/api/mcr_config_validate_test.go
=== RUN   Test_ValidateNil
--- PASS: Test_ValidateNil (0.00s)
=== RUN   Test_ValidateNilFIPS
--- PASS: Test_ValidateNilFIPS (0.00s)
=== RUN   Test_ValidateEmptyVersion
--- PASS: Test_ValidateEmptyVersion (0.00s)
=== RUN   Test_ValidateInvalidVersion
--- PASS: Test_ValidateInvalidVersion (0.00s)
=== RUN   Test_ValidateMissingChannelVersion
--- PASS: Test_ValidateMissingChannelVersion (0.00s)
=== RUN   Test_ValidateWrongChannelVersion
--- PASS: Test_ValidateWrongChannelVersion (0.00s)
=== RUN   Test_ValidateWrongChannelVersionFIPS
--- PASS: Test_ValidateWrongChannelVersionFIPS (0.00s)
=== RUN   Test_ValidateIncompleteChannelVersion
    mcr_config_validate_test.go:104:
        	Error Trace:	/Users/eiichi.kitagawa/repos/launchpad/pkg/product/common/api/mcr_config_validate_test.go:104
        	Error:      	Target error should be in err chain:
        	            	expected: "MCR version and channel don't match, which is required for versions >= 25.0.0"
        	            	in chain:
        	Test:       	Test_ValidateIncompleteChannelVersion
        	Messages:   	did not receive expected error from invalid MCR config which is missing an incomplete channel version
--- FAIL: Test_ValidateIncompleteChannelVersion (0.00s)
=== RUN   Test_ValidateIncompleteChannelVersionFIPS
    mcr_config_validate_test.go:128:
        	Error Trace:	/Users/eiichi.kitagawa/repos/launchpad/pkg/product/common/api/mcr_config_validate_test.go:128
        	Error:      	Target error should be in err chain:
        	            	expected: "MCR version and channel don't match, which is required for versions >= 25.0.0"
        	            	in chain:
        	Test:       	Test_ValidateIncompleteChannelVersionFIPS
        	Messages:   	did not receive expected error from invalid MCR config which is missing an incomplete channel version
--- FAIL: Test_ValidateIncompleteChannelVersionFIPS (0.00s)
=== RUN   Test_ValidateWildcardChannelVersion
    mcr_config_validate_test.go:137:
        	Error Trace:	/Users/eiichi.kitagawa/repos/launchpad/pkg/product/common/api/mcr_config_validate_test.go:137
        	Error:      	Expected nil, but got: &fmt.wrapError{msg:"MCR version and channel don't match, which is required for versions >= 25.0.0; MCR version does not match channel-version '25.0.9' vs '25.0'", err:(*errors.errorString)(0x104a7a410)}
        	Test:       	Test_ValidateWildcardChannelVersion
        	Messages:   	received unexpected error for valid MCR config which uses a wildcard version and specific channel
--- FAIL: Test_ValidateWildcardChannelVersion (0.00s)
=== RUN   Test_ValidateWildcardChannelVersionFIPS
    mcr_config_validate_test.go:146:
        	Error Trace:	/Users/eiichi.kitagawa/repos/launchpad/pkg/product/common/api/mcr_config_validate_test.go:146
        	Error:      	Expected nil, but got: &fmt.wrapError{msg:"MCR version and channel don't match, which is required for versions >= 25.0.0; MCR version does not match channel-version '25.0.9' vs '25.0'", err:(*errors.errorString)(0x104a7a410)}
        	Test:       	Test_ValidateWildcardChannelVersionFIPS
        	Messages:   	received unexpected error for valid MCR config which uses a wildcard version and specific channel w/ FIPS
--- FAIL: Test_ValidateWildcardChannelVersionFIPS (0.00s)
FAIL
FAIL	command-line-arguments	0.429s
FAIL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant