Skip to content

Commit

Permalink
chore: fix e2e by moving artifactkey parameter to wkld method (#5553)
Browse files Browse the repository at this point in the history
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
  • Loading branch information
KollaAdithya authored Dec 12, 2023
1 parent f1eeb3a commit 98bacee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
11 changes: 8 additions & 3 deletions internal/pkg/deploy/cloudformation/stack/rd_web_svc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ func TestRequestDrivenWebService_Parameters(t *testing.T) {
}, {
ParameterKey: aws.String("AddonsTemplateURL"),
ParameterValue: aws.String(""),
}, {
ParameterKey: aws.String(WorkloadArtifactKeyARNParamKey),
ParameterValue: aws.String(""),
}, {
ParameterKey: aws.String(RDWkldImageRepositoryType),
ParameterValue: aws.String("ECR_PUBLIC"),
Expand Down Expand Up @@ -491,9 +494,10 @@ func TestRequestDrivenWebService_SerializedParameters(t *testing.T) {
c := &RequestDrivenWebService{
appRunnerWkld: &appRunnerWkld{
wkld: &wkld{
name: aws.StringValue(testRDWebServiceManifest.Name),
env: testEnvName,
app: testAppName,
name: aws.StringValue(testRDWebServiceManifest.Name),
env: testEnvName,
app: testAppName,
artifactKey: "arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab",
rc: RuntimeConfig{
PushedImages: map[string]ECRImage{
aws.StringValue(testRDWebServiceManifest.Name): {
Expand All @@ -515,6 +519,7 @@ func TestRequestDrivenWebService_SerializedParameters(t *testing.T) {
"Parameters": {
"AddonsTemplateURL": "",
"AppName": "phonetool",
"ArtifactKeyARN": "arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab",
"ContainerImage": "111111111111.dkr.ecr.us-west-2.amazonaws.com/phonetool/frontend:manual-bf3678c",
"ContainerPort": "80",
"EnvName": "test",
Expand Down
8 changes: 4 additions & 4 deletions internal/pkg/deploy/cloudformation/stack/workload.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ func (w *wkld) Parameters() ([]*cloudformation.Parameter, error) {
ParameterKey: aws.String(WorkloadAddonsTemplateURLParamKey),
ParameterValue: aws.String(w.rc.AddonsTemplateURL),
},
{
ParameterKey: aws.String(WorkloadArtifactKeyARNParamKey),
ParameterValue: aws.String(w.artifactKey),
},
}, nil
}

Expand Down Expand Up @@ -376,10 +380,6 @@ func (w *ecsWkld) envFileParams() []*cloudformation.Parameter {
ParameterKey: aws.String(WorkloadEnvFileARNParamKey),
ParameterValue: aws.String(w.rc.EnvFileARNs[w.name]),
},
{
ParameterKey: aws.String(WorkloadArtifactKeyARNParamKey),
ParameterValue: aws.String(w.wkld.artifactKey),
},
}
// Decide whether to inject a Log container env file. If there is log configuration
// in the manifest, we should inject either an empty string or the configured env file arn,
Expand Down

0 comments on commit 98bacee

Please sign in to comment.