Skip to content

Commit

Permalink
removed app from component identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
xadhatter committed Jan 22, 2024
1 parent 073a184 commit 085c60d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
3 changes: 0 additions & 3 deletions efs/hello-world/hack/environments/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ metadata:
name: qa
spec:
environment: qa
data:
secrets:
this: thisisatest
1 change: 0 additions & 1 deletion internal/repo/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions internal/repo/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
4 changes: 1 addition & 3 deletions internal/repo/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),

Check failure on line 46 in internal/repo/release.go

View workflow job for this annotation

GitHub Actions / Build binary

appDep.Validate undefined (type *"github.com/xigxog/kubefox/api/kubernetes/v1alpha1".AppDeployment has no field or method Validate)

Check failure on line 46 in internal/repo/release.go

View workflow job for this annotation

GitHub Actions / Analyze (go)

appDep.Validate undefined (type *"github.com/xigxog/kubefox/api/kubernetes/v1alpha1".AppDeployment has no field or method Validate)
func(name string, typ api.ComponentType) (api.Adapter, error) {
switch typ {
case api.ComponentTypeHTTPAdapter:
Expand Down
6 changes: 5 additions & 1 deletion internal/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 085c60d

Please sign in to comment.