diff --git a/pkg/agent/kube.go b/pkg/agent/kube.go index 11781a5bc..b2cce3f22 100644 --- a/pkg/agent/kube.go +++ b/pkg/agent/kube.go @@ -35,6 +35,7 @@ import ( ) const AnnotationGitRepository = "gimlet.io/git-repository" +const AnnotationApp = "gimlet.io/app" const AnnotationGitSha = "gimlet.io/git-sha" const AnnotationGitBranch = "gimlet.io/git-branch" const AnnotationDocsLink = "v1alpha1.opensca.dev/documentation" @@ -125,6 +126,7 @@ func (e *KubeEnv) Services(repo string) ([]*api.Stack, error) { stacks = append(stacks, &api.Stack{ Repo: service.ObjectMeta.GetAnnotations()[AnnotationGitRepository], + App: service.ObjectMeta.GetAnnotations()[AnnotationApp], Osca: getOpenServiceCatalogAnnotations(service), Service: &api.Service{Name: service.Name, Namespace: service.Namespace}, Deployment: deployment, diff --git a/pkg/dashboard/api/types.go b/pkg/dashboard/api/types.go index 0209bc8ea..d3bba94de 100644 --- a/pkg/dashboard/api/types.go +++ b/pkg/dashboard/api/types.go @@ -188,6 +188,7 @@ type AgentState struct { type Stack struct { Repo string `json:"repo"` Env string `json:"env"` + App string `json:"app"` Osca *Osca `json:"osca"` Service *Service `json:"service"` Deployment *Deployment `json:"deployment,omitempty"` diff --git a/web/src/components/env/env.jsx b/web/src/components/env/env.jsx index 27a402c28..eac1c750a 100644 --- a/web/src/components/env/env.jsx +++ b/web/src/components/env/env.jsx @@ -74,32 +74,31 @@ function renderServices( let configsWeDeployed = []; // render services that are deployed on k8s services = filteredStacks.map((stack) => { - configsWeDeployed.push(stack.service.name); - const configExists = configsWeHave.includes(stack.service.name) - let config = undefined; - if (configExists) { + let config = envConfigs.find((config) => config.app === stack.app); + if (!config) { config = envConfigs.find((config) => config.app === stack.service.name) } + configsWeDeployed.push(config.app); let deployment = ""; if (stack.deployment) { deployment = stack.deployment.namespace + "/" + stack.deployment.name } + const appOrServiceName = config ? config.app : stack.service.name return ( -
Deploy History