-
Notifications
You must be signed in to change notification settings - Fork 566
CNTRLPLANE-3646: wire up AWS v2 e2e lifecycle test coverage #9174
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| //go:build e2ev2 | ||
|
|
||
| package lifecycle | ||
|
|
||
| import ( | ||
| "context" | ||
| "fmt" | ||
| "log" | ||
| "os" | ||
| "strings" | ||
| "time" | ||
|
|
||
| crclient "sigs.k8s.io/controller-runtime/pkg/client" | ||
| ) | ||
|
|
||
| type AWSPlatformConfig struct { | ||
| region string | ||
| zones []string | ||
| additionalTags []string | ||
| sharedDir string | ||
| } | ||
|
|
||
| type AWSPlatformOptions struct { | ||
| Region string | ||
| Zones string | ||
| } | ||
|
|
||
| func NewAWSPlatformConfig(opts AWSPlatformOptions, sharedDir string) *AWSPlatformConfig { | ||
| zones := strings.Split(opts.Zones, ",") | ||
|
|
||
| // TODO: this is currently just to satisfy an assumption made by EnsureInfrastructureResourceTagsTest | ||
| // and should probably be handled another way. That test assumes there is at least one pre-existing | ||
| // non-kubernetes-namespaced tag on the infra. | ||
| tags := []string{fmt.Sprintf("expirationDate=%s", time.Now().Add(4*time.Hour).UTC().Format(time.RFC3339))} | ||
|
|
||
| cfg := &AWSPlatformConfig{ | ||
| region: opts.Region, | ||
| sharedDir: sharedDir, | ||
| additionalTags: tags, | ||
| zones: zones, | ||
| } | ||
|
|
||
| log.Printf("AWS platform config: region=%s, zones=%v, additionalTags=%v", cfg.region, cfg.zones, cfg.additionalTags) | ||
| return cfg | ||
|
ironcladlou marked this conversation as resolved.
|
||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| func (a *AWSPlatformConfig) Name() string { return "aws" } | ||
|
|
||
| func (a *AWSPlatformConfig) DefaultBaseDomain() string { | ||
| return "ci.hypershift.devcluster.openshift.com" | ||
| } | ||
|
|
||
| func (a *AWSPlatformConfig) ClusterSpecs(releaseImage, n1Image string) []ClusterSpec { | ||
| // Parse EXTRA_ARGS from environment if provided | ||
| var extraArgs []string | ||
| if envArgs := os.Getenv("EXTRA_ARGS"); envArgs != "" { | ||
| extraArgs = strings.Fields(envArgs) | ||
|
ironcladlou marked this conversation as resolved.
|
||
| } | ||
| return []ClusterSpec{ | ||
| { | ||
| Variant: "public", | ||
| OutputFile: "cluster-name-public", | ||
| ExtraArgs: extraArgs, | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| func (a *AWSPlatformConfig) CreateArgs() []string { | ||
| args := []string{ | ||
| "--region=" + a.region, | ||
| "--zones=" + strings.Join(a.zones, ","), | ||
| "--root-volume-size=64", | ||
| "--root-volume-type=gp3", | ||
| "--public-only", | ||
| "--pods-labels=hypershift-e2e-test-label=test", | ||
| "--toleration=key=hypershift-e2e-test-toleration,operator=Equal,value=true,effect=NoSchedule", | ||
| "--annotations=hypershift.openshift.io/cleanup-cloud-resources=true", | ||
| "--annotations=hypershift.openshift.io/skip-release-image-validation=true", | ||
| "--feature-set=TechPreviewNoUpgrade", | ||
| } | ||
| for _, tag := range a.additionalTags { | ||
| args = append(args, "--additional-tags="+tag) | ||
| } | ||
| return args | ||
| } | ||
|
|
||
| func (a *AWSPlatformConfig) PreCreate(ctx context.Context, cl crclient.WithWatch, namespace string) error { | ||
| return nil | ||
| } | ||
|
|
||
| func (a *AWSPlatformConfig) PostCreate(ctx context.Context, cl crclient.WithWatch, namespace string, clusterNames map[string]string) error { | ||
| return nil | ||
| } | ||
|
|
||
| func (a *AWSPlatformConfig) PostAvailable(ctx context.Context, cl crclient.WithWatch, namespace string, clusterNames map[string]string) error { | ||
| return nil | ||
| } | ||
|
|
||
| func (a *AWSPlatformConfig) PostVersionRollout(ctx context.Context, cl crclient.WithWatch, namespace string, clusterNames map[string]string) error { | ||
| return nil | ||
| } | ||
|
|
||
| func (a *AWSPlatformConfig) TestMatrix(releaseImage string) TestMatrix { | ||
| return TestMatrix{ | ||
| Parallel: []TestGroup{ | ||
| { | ||
| Name: "aws-public", | ||
| ClusterFile: "cluster-name-public", | ||
| LabelFilter: "!lifecycle || hosted-cluster-aws", | ||
| JUnitFile: "junit_aws_public.xml", | ||
| }, | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| func (a *AWSPlatformConfig) SetupTestEnv(sharedDir string) {} | ||
|
|
||
| func (a *AWSPlatformConfig) DestroyArgs() []string { | ||
| return []string{ | ||
| "--region=" + a.region, | ||
| } | ||
| } | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.