Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions tooling/hcpctl/pkg/snapshot/prow.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"compress/gzip"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/url"
Expand All @@ -41,7 +42,8 @@ import (

const (
gcsBucket = "test-platform-results"
configPath = "aro-hcp-write-config/artifacts/config.yaml"
configPathPrimary = "aro-hcp-provision-environment/artifacts/config.yaml"
configPathFallback = "aro-hcp-write-config/artifacts/config.yaml"
testStepPersistent = "aro-hcp-test-persistent"
testStepLocal = "aro-hcp-test-local"
prKustoRegion = "eastus2"
Expand Down Expand Up @@ -166,11 +168,19 @@ func FetchProwJobData(ctx context.Context, info *ProwJobInfo) (*ProwJobConfig, [

artifactPrefix := fmt.Sprintf("%s/artifacts/%s", info.GCSPrefix, artifactDir)

// Download and parse config.yaml.
configGCSPath := fmt.Sprintf("%s/%s", artifactPrefix, configPath)
// Download and parse config.yaml, trying the primary path first.
configGCSPath := fmt.Sprintf("%s/%s", artifactPrefix, configPathPrimary)
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)
Comment on lines 173 to +180
if err != nil {
return nil, nil, fmt.Errorf("failed to download config.yaml: %w", err)
Comment on lines +176 to +182
}
}
Comment on lines 173 to 184

jobConfig, err := parseConfig(configData, info.JobName)
Expand Down