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

Commit

Permalink
Adding generated code for templated repo name
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hein <me@christopherhein.com>
  • Loading branch information
christopherhein committed Aug 25, 2018
1 parent 2b52f3a commit 5d4c87e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/apis/operator.aws/v1alpha1/ecrrepository.go
Expand Up @@ -28,6 +28,8 @@ type ECRRepositorySpec struct {
// ECRRepositoryOutput defines the output resource for ECRRepository
type ECRRepositoryOutput struct {
RepositoryName string `json:"repositoryName"`
RepositoryARN string `json:"repositoryARN"`
RepositoryURL string `json:"repositoryURL"`
}

// ECRRepositoryStatus holds the status of the Cloudformation template
Expand Down
3 changes: 3 additions & 0 deletions pkg/operator/ecrrepository/controller.go
Expand Up @@ -172,6 +172,9 @@ func updateStatus(config *config.Config, name string, namespace string, stackID
logger.WithError(err).Error("error getting outputs")
}
resourceCopy.Output.RepositoryName = outputs["RepositoryName"]
resourceCopy.Output.RepositoryARN = outputs["RepositoryARN"]
repositoryURL, _ := helpers.Templatize("{{.Config.AccountID}}.dkr.ecr.{{.Config.Region}}.amazonaws.com/{{.Obj.Name}}", helpers.Data{Obj: resourceCopy, Config: config})
resourceCopy.Output.RepositoryURL = repositoryURL
}

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

0 comments on commit 5d4c87e

Please sign in to comment.