Skip to content

Commit

Permalink
Add envName to cdappconfig metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
bsquizz authored and kylape committed Oct 26, 2021
1 parent bf43cd2 commit f97f673
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/cloud.redhat.com/clowdapp_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ func updateMetadata(app *crd.ClowdApp, appConfig *config.AppConfig) {
}

appConfig.Metadata = &metadata

appConfig.Metadata.Name = &app.Name
appConfig.Metadata.EnvName = &app.Spec.EnvName
}

func (r *ClowdAppReconciler) runProviders(log logr.Logger, provider *providers.Provider, a *crd.ClowdApp) error {
Expand Down
4 changes: 4 additions & 0 deletions controllers/cloud.redhat.com/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@
"description": "Name of the ClowdApp",
"type": "string"
},
"envName": {
"description": "Name of the ClowdEnvironment this ClowdApp runs in",
"type": "string"
},
"deployments": {
"description": "Metadata pertaining to an application's deployments",
"type": "array",
Expand Down
3 changes: 3 additions & 0 deletions controllers/cloud.redhat.com/config/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions controllers/cloud.redhat.com/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ func TestCreateClowdApp(t *testing.T) {

func metadataValidation(t *testing.T, app *crd.ClowdApp, jsonContent *config.AppConfig) {
assert.Equal(t, *jsonContent.Metadata.Name, app.Name)
assert.Equal(t, *jsonContent.Metadata.EnvName, app.Spec.EnvName)

for _, deployment := range app.Spec.Deployments {
expected := config.DeploymentMetadata{
Expand Down

0 comments on commit f97f673

Please sign in to comment.