hcpctl: prefer provision-environment config over write-config#5387
Open
mmazur wants to merge 1 commit into
Open
hcpctl: prefer provision-environment config over write-config#5387mmazur wants to merge 1 commit into
mmazur wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mmazur The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates hcpctl’s Prow artifact parsing to prefer the newer aro-hcp-provision-environment job artifact config as the primary source of truth, while retaining compatibility with older jobs by falling back to the previous aro-hcp-write-config artifact path.
Changes:
- Switch config download to try
aro-hcp-provision-environment/artifacts/config.yamlfirst. - Add fallback to
aro-hcp-write-config/artifacts/config.yamlwhen the primary config is unavailable.
Comment on lines
172
to
+176
| configData, err := downloadObject(ctx, gcsClient, configGCSPath) | ||
| if err != nil { | ||
| return nil, nil, fmt.Errorf("failed to download config.yaml: %w", err) | ||
| logger.V(1).Info("Primary config path not found, trying fallback", "primary", configGCSPath, "err", err) | ||
| configGCSPath = fmt.Sprintf("%s/%s", artifactPrefix, configPathFallback) | ||
| configData, err = downloadObject(ctx, gcsClient, configGCSPath) |
ec7c41d to
66635a6
Compare
The aro-hcp-provision-environment/artifacts/config.yaml is more accurate than aro-hcp-write-config/artifacts/config.yaml. Try the provision-environment path first and fall back to write-config when it is not present. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
66635a6 to
94cb303
Compare
Comment on lines
+176
to
+182
| return nil, nil, fmt.Errorf("failed to download config.yaml: %w", err) | ||
| } | ||
| logger.V(1).Info("Primary config not present, trying fallback", "primary", configGCSPath) | ||
| configGCSPath = fmt.Sprintf("%s/%s", artifactPrefix, configPathFallback) | ||
| configData, err = downloadObject(ctx, gcsClient, configGCSPath) | ||
| if err != nil { | ||
| return nil, nil, fmt.Errorf("failed to download config.yaml: %w", err) |
Comment on lines
173
to
184
| configData, err := downloadObject(ctx, gcsClient, configGCSPath) | ||
| if err != nil { | ||
| return nil, nil, fmt.Errorf("failed to download config.yaml: %w", err) | ||
| if !errors.Is(err, storage.ErrObjectNotExist) { | ||
| return nil, nil, fmt.Errorf("failed to download config.yaml: %w", err) | ||
| } | ||
| logger.V(1).Info("Primary config not present, trying fallback", "primary", configGCSPath) | ||
| configGCSPath = fmt.Sprintf("%s/%s", artifactPrefix, configPathFallback) | ||
| configData, err = downloadObject(ctx, gcsClient, configGCSPath) | ||
| if err != nil { | ||
| return nil, nil, fmt.Errorf("failed to download config.yaml: %w", err) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
aro-hcp-provision-environment/artifacts/config.yamlas the primary config source when fetching Prow job data, cause the provisioning job makes modifications on top of the baseconfig/config.yamlwhen running (like generating custom resource group names), which makes the config it generates more accuratearo-hcp-write-config/artifacts/config.yamlpath when the prov job config isn't there – it doesn't have all the data (it's just a renderedconfig/config.yaml), but it is always available no matter the environment🤖 Generated with Claude Code