Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit 5d4c87e

Browse files
Adding generated code for templated repo name
Signed-off-by: Christopher Hein <[email protected]>
1 parent 2b52f3a commit 5d4c87e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pkg/apis/operator.aws/v1alpha1/ecrrepository.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ type ECRRepositorySpec struct {
2828
// ECRRepositoryOutput defines the output resource for ECRRepository
2929
type ECRRepositoryOutput struct {
3030
RepositoryName string `json:"repositoryName"`
31+
RepositoryARN string `json:"repositoryARN"`
32+
RepositoryURL string `json:"repositoryURL"`
3133
}
3234

3335
// ECRRepositoryStatus holds the status of the Cloudformation template

pkg/operator/ecrrepository/controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ func updateStatus(config *config.Config, name string, namespace string, stackID
172172
logger.WithError(err).Error("error getting outputs")
173173
}
174174
resourceCopy.Output.RepositoryName = outputs["RepositoryName"]
175+
resourceCopy.Output.RepositoryARN = outputs["RepositoryARN"]
176+
repositoryURL, _ := helpers.Templatize("{{.Config.AccountID}}.dkr.ecr.{{.Config.Region}}.amazonaws.com/{{.Obj.Name}}", helpers.Data{Obj: resourceCopy, Config: config})
177+
resourceCopy.Output.RepositoryURL = repositoryURL
175178
}
176179

177180
_, err = clientSet.ECRRepositories(namespace).Update(resourceCopy)

0 commit comments

Comments
 (0)