Skip to content

Commit

Permalink
Improve names for discovered apps
Browse files Browse the repository at this point in the history
- Rename DiscoveredApps to DiscoveredApp for consistency with other
  deployers names.
- Rename deployers/discoveredapps.go to deployers/discoveredapp.go to
  match the new type name.
- Rename dractions/actionsdiscoveredapps.go to dractions/discovered.go -
  this name was too long, hard to read, and breaks log formatting.
- Rename util.RamenOpsNS to util.RamenOpsNamespace for consistency
  with other constants.

Signed-off-by: Nir Soffer <[email protected]>
  • Loading branch information
nirs committed Dec 11, 2024
1 parent 662e659 commit 75b4652
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ import (
"github.com/ramendr/ramen/e2e/util"
)

type DiscoveredApps struct{}
type DiscoveredApp struct{}

func (d DiscoveredApps) GetName() string {
func (d DiscoveredApp) GetName() string {
return "Disapp"
}

func (d DiscoveredApps) GetNamespace() string {
return util.RamenOpsNs
func (d DiscoveredApp) GetNamespace() string {
return util.RamenOpsNamespace
}

func (d DiscoveredApps) Deploy(ctx types.Context) error {
func (d DiscoveredApp) Deploy(ctx types.Context) error {
name := ctx.Name()
log := ctx.Logger()
namespace := name
Expand Down Expand Up @@ -71,7 +71,7 @@ func (d DiscoveredApps) Deploy(ctx types.Context) error {
return nil
}

func (d DiscoveredApps) Undeploy(ctx types.Context) error {
func (d DiscoveredApp) Undeploy(ctx types.Context) error {
name := ctx.Name()
log := ctx.Logger()
namespace := name // this namespace is in dr clusters
Expand Down Expand Up @@ -114,10 +114,10 @@ func (d DiscoveredApps) Undeploy(ctx types.Context) error {
return nil
}

func (d DiscoveredApps) IsWorkloadSupported(w types.Workload) bool {
func (d DiscoveredApp) IsWorkloadSupported(w types.Workload) bool {
return w.GetName() != "Deploy-cephfs"
}

func (d DiscoveredApps) IsDiscovered() bool {
func (d DiscoveredApp) IsDiscovered() bool {
return true
}
File renamed without changes.
2 changes: 1 addition & 1 deletion e2e/exhaustive_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var (
Workloads = []types.Workload{}
subscription = &deployers.Subscription{}
appset = &deployers.ApplicationSet{}
discoveredApps = &deployers.DiscoveredApps{}
discoveredApps = &deployers.DiscoveredApp{}
Deployers = []types.Deployer{subscription, appset, discoveredApps}
)

Expand Down
4 changes: 2 additions & 2 deletions e2e/util/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ const (
defaultChannelNamespace = "ramen-samples"
defaultGitURL = "https://github.com/RamenDR/ocm-ramen-samples.git"

ArgocdNamespace = "argocd"
RamenOpsNs = "ramen-ops"
ArgocdNamespace = "argocd"
RamenOpsNamespace = "ramen-ops"
)

0 comments on commit 75b4652

Please sign in to comment.