openshift-snc: pick the latest published version when --version is not set (AWS and IBM Cloud)
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 57/100
Hướng nghiên cứu
Start with the AWS version flag in cmd/mapt/cmd/aws/services/snc.go, the AMI listing in pkg/provider/aws/data/ami.go, and the AWS and IBM SNC provider paths named in the issue. Trace how the resolved version reaches amiName and apiSNC.CommandCaServiceRan, then compare the IBM lookup. Done means both providers meet the listed lookup, logging, pinned-version, empty-result, Tekton, documentation, and version-ordering test criteria.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
The two SNC providers do not behave the same when the user omits --version.
- IBM Cloud resolves the latest published version at run time. The flag default is empty
(cmd/mapt/cmd/ibmcloud/services/snc.go:19). The code calls
GetLatestCatalogOfferingVersionCRN(pkg/provider/ibmcloud/action/snc/snc.go:79-88).
The IBM Tekton task default is empty (tkn/template/infra-ibmcloud-ocp-snc.yaml:175). - AWS uses a hard-coded version (
cmd/mapt/cmd/aws/services/snc.go:20:
ocpDefaultVersion = "4.21.0"). The AWS Tekton task default is the literal string
''(tkn/template/infra-aws-ocp-snc.yaml:148).
The AWS version selects the AMI through the name pattern
openshift-local-<version>-<arch>* (pkg/provider/aws/action/snc/constants.go:11).
When that AMI is not published, the create call fails:
AMI openshift-local-4.21.0-x86_64* could not be found in region: us-east-1
Expected
One contract for both providers: when --version is empty, mapt uses the latest
published OpenShift Local version for the requested architecture, logs the value, and
continues. A pinned version always wins.
Actual
AWS
- The CLI flag default
4.21.0applies when the user omits--version. When the AMI
for that version is gone, the run fails. Only a source change and a new mapt release
can move the default. - The Tekton task declares
default: "''"at line 148. The value is the string'',
not an empty value. The guard at line 291,[[ $(params.version) != "" ]], is true,
so the task runs--version ''. The AMI pattern becomes
openshift-local--x86_64*, and the run fails. The parameter description already
says "If not version set it will pick the latest stable", so the task contract is
broken. pkg/target/service/snc/api.go:40compares the version with
ContextAdminStarterVersion(line 31) to select the admin command. An empty version
changes that comparison. The resolved version must reach this code.
IBM Cloud
The resolution works. These points differ from the contract above:
- The code logs the detected version at debug level only
(logging.Debugf("Auto-detected latest version: ...")). A user who omits the flag
cannot see the selected version at the default log level. docs/ibmcloud/openshift-snc.md:5documents the behaviour.docs/aws/openshift-snc.md
does not.
Proposal
- Write the contract in one place: an empty
--versionmeans "latest published
version for this architecture". - AWS: set the flag default to
"". Keep the flag description and state the
auto-detection, as the IBM flag does. - AWS: add
data.GetLatestSNCVersion(ctx, arch) (string, error)in
pkg/provider/aws/data. It must useListAMIs(pkg/provider/aws/data/ami.go:111)
with owner391597328979and nameopenshift-local-*-<arch>, keep the maximum
semantic version, and return a clear error on an empty list. The IBM
GetLatestCatalogOfferingVersionCRNis the model. - AWS: resolve the version before
amiNameand before the cluster stack. Pass the
resolved value toapiSNC.CommandCaServiceRan. - Both providers: log the resolved version at info level with the same wording, for
exampleversion not set, use latest published version 4.22.14. Raise the IBM
message from debug to info. - Both providers: use the same error shape when the lookup finds no version.
- AWS: change
tkn/template/infra-aws-ocp-snc.yamltodefault: "". - Both providers: state the behaviour in
docs/aws/openshift-snc.mdand
docs/ibmcloud/openshift-snc.md. Add one example without--version. - Keep the pinned path for both providers:
--version 4.20.8must use4.20.8and
must not run the latest-version lookup. A pinned IBM version still resolves its
catalog CRN, and a pinned AWS version still checks that the AMI exists.
Acceptance criteria
| Criterion | AWS | IBM Cloud |
|---|---|---|
No --version selects the highest published version |
needed | present |
| The resolved version appears at info level | needed | needed (debug today) |
The Tekton task without a version value passes no --version |
needed (default is '') |
present |
| A pinned version uses exactly that version and skips the latest-version lookup | needed | present |
| A clear error when no version is published | needed | present |
| The docs state the behaviour | needed | present |
Add unit tests for the version extraction and the order for both providers: 4.21.9 is
lower than 4.21.10, and a pre-release suffix does not win over a release.
Notes
The AWS AMIs come from https://github.com/devtools-qe-incubator/cloud-importer. The IBM
images come from the IBM Cloud catalog. Both publishers can add or remove a version at
any time. A fixed default cannot follow that change.
An AWS run-time lookup costs one DescribeImages listing, on top of the AMI check that
the create path already does. An IBM run-time lookup costs one catalog listing call,
which the IBM path already pays.
- Ngôn ngữ chính
- Go
- Star
- 26
- Fork
- 41
- Merge trung bình
- 3 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 27
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của redhat-developer/mapt
-
kind: v0.14.7 control-plane readiness block reads the wrong kubeconfig path (provision always fails)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
redhat-developer/mapt#997 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Host/username secret values contain trailing newlines, sanitization fix breaks SSH keyCó thể làm lại được @abdulazeem-tk4vr đã nhận 167 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
redhat-developer/mapt#817 · 12 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
redhat-developer/mapt#991 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
redhat-developer/mapt#974 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
openshift-snc: align cluster ingress domain with the nip.io access domain (crc.testing split-brain)Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
redhat-developer/mapt#968 · 1 reaction ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của redhat-developer/mapt
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
stefanpejcic/OpenPanel#1415 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
status:needs-review type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Gentleman-Programming/engram#2512 ·
Maintainer thường phản hồi trong vòng 1 ngày