From 085c60df06b0dc601baf3b3c5121423fb9f9a561 Mon Sep 17 00:00:00 2001 From: John Long Date: Mon, 22 Jan 2024 12:18:50 -0500 Subject: [PATCH] removed app from component identifiers --- efs/hello-world/hack/environments/qa.yaml | 3 --- internal/repo/build.go | 1 - internal/repo/deploy.go | 6 +++--- internal/repo/release.go | 4 +--- internal/repo/repo.go | 6 +++++- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/efs/hello-world/hack/environments/qa.yaml b/efs/hello-world/hack/environments/qa.yaml index f9e4b5c..f448705 100644 --- a/efs/hello-world/hack/environments/qa.yaml +++ b/efs/hello-world/hack/environments/qa.yaml @@ -16,6 +16,3 @@ metadata: name: qa spec: environment: qa -data: - secrets: - this: thisisatest diff --git a/internal/repo/build.go b/internal/repo/build.go index fa293c6..6b9f7aa 100644 --- a/internal/repo/build.go +++ b/internal/repo/build.go @@ -94,7 +94,6 @@ func (r *repo) Build(compDirName string) string { log.Fatal("Error creating container tar: %v", err) } labels := map[string]string{ - api.LabelOCIApp: r.app.Name, api.LabelOCIComponent: compName, api.LabelOCICreated: now, api.LabelOCIRevision: compCommit, diff --git a/internal/repo/deploy.go b/internal/repo/deploy.go index 2ad3014..a95edf0 100644 --- a/internal/repo/deploy.go +++ b/internal/repo/deploy.go @@ -156,9 +156,9 @@ func (r *repo) buildAppDep() *v1alpha1.AppDeployment { log.Fatal("Error listing components dir '%s': %v", r.ComponentsDir(), err) } commit := r.GetCommit("") - reg := fmt.Sprintf("%s/%s", r.cfg.ContainerRegistry.Address, r.app.Name) - if r.app.ContainerRegistry != "" { - reg = r.app.ContainerRegistry + reg := r.app.ContainerRegistry + if reg == "" { + reg = r.cfg.ContainerRegistry.Address } appDep := &v1alpha1.AppDeployment{ diff --git a/internal/repo/release.go b/internal/repo/release.go index 460599c..df8ff0e 100644 --- a/internal/repo/release.go +++ b/internal/repo/release.go @@ -34,18 +34,16 @@ func (r *repo) Release(appDepId string) *v1alpha1.VirtualEnvironment { if err != nil { log.Fatal("Error finding AppDeployment: %v", err) } - ve := &v1alpha1.VirtualEnvironment{} if err := r.k8s.Get(ctx, k8s.Key(platform.Namespace, r.cfg.Flags.VirtEnv), ve); err != nil { log.Fatal("Error getting VirtualEnvironment: %v", err) } - env := &v1alpha1.Environment{} if err := r.k8s.Get(ctx, k8s.Key("", ve.Spec.Environment), env); err != nil { log.Fatal("Error getting Environment: %v", err) } - problems, err := appDep.Spec.Validate(appDep, ve.Data.MergeInto(&env.Data), + problems, err := appDep.Validate(ve.Data.MergeInto(&env.Data), func(name string, typ api.ComponentType) (api.Adapter, error) { switch typ { case api.ComponentTypeHTTPAdapter: diff --git a/internal/repo/repo.go b/internal/repo/repo.go index 9ba91f5..118810c 100644 --- a/internal/repo/repo.go +++ b/internal/repo/repo.go @@ -139,7 +139,7 @@ func (r *repo) GetCompImageFromDir(compDirName string) string { } func (r *repo) GetCompImage(name, commit string) string { - return fmt.Sprintf("%s/%s/%s:%s", r.cfg.ContainerRegistry.Address, r.app.Name, name, commit) + return fmt.Sprintf("%s/%s:%s", r.cfg.ContainerRegistry.Address, name, commit) } func (r *repo) GetRepoURL() string { @@ -246,6 +246,10 @@ func (r *repo) ComponentRepoSubpath(comp string) string { } func (r *repo) IsClean() bool { + if os.Getenv("FOX_DRAGON_IGNORE_UNCOMMITTED") == "true" { + return true + } + w, err := r.gitRepo.Worktree() if err != nil { log.Fatal("Error accessing git worktree: %v", err)