Skip to content

Commit

Permalink
[ACM-6913] Add SubmarinerAddon as sub-component to MCH (stolostron#1090)
Browse files Browse the repository at this point in the history
* add submariner-addon as sub-component to MCH

Signed-off-by: Disaiah Bennett <[email protected]>

* updated console enable logic

Signed-off-by: Disaiah Bennett <[email protected]>

* updated multiclusterhub_controller.go

Signed-off-by: Disaiah Bennett <[email protected]>

---------

Signed-off-by: Disaiah Bennett <[email protected]>
  • Loading branch information
dislbenn committed Sep 5, 2023
1 parent 25fda6b commit ddeeea1
Show file tree
Hide file tree
Showing 16 changed files with 1,022 additions and 281 deletions.
42 changes: 42 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Description

Please provide a brief description of the purpose of this pull request.

## Related Issue

If applicable, please reference the issue(s) that this pull request addresses.

## Changes Made

Provide a clear and concise overview of the changes made in this pull request.

## Screenshots (if applicable)

Add screenshots or GIFs that demonstrate the changes visually, if relevant.

## Checklist

- [ ] I have tested the changes locally and they are functioning as expected.
- [ ] I have updated the documentation (if necessary) to reflect the changes.
- [ ] I have added/updated relevant unit tests (if applicable).
- [ ] I have ensured that my code follows the project's coding standards.
- [ ] I have checked for any potential security issues and addressed them.
- [ ] I have added necessary comments to the code, especially in complex or unclear sections.
- [ ] I have rebased my branch on top of the latest main/master branch.

## Additional Notes

Add any additional notes, context, or information that might be helpful for reviewers.

## Reviewers

Tag the appropriate reviewers who should review this pull request. To add reviewers, please add the following line: `/cc @reviewer1 @reviewer2`

## Definition of Done

- [ ] Code is reviewed.
- [ ] Code is tested.
- [ ] Documentation is updated.
- [ ] All checks and tests pass.
- [ ] Approved by at least one reviewer.
- [ ] Merged into the main/master branch.
4 changes: 2 additions & 2 deletions api/v1/methods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ var _ = Describe("V1 API Methods", func() {
Expect(api.ValidComponent(config("invalid", true))).To(BeFalse())
})

It("gets the correct number of default enabled components", func() {
It("gets the correct number of default enabled components", func() {
components, err := api.GetDefaultEnabledComponents()

Expect(len(components)).To(Equal(10))
Expect(len(components)).To(Equal(11))
Expect(err).To(BeNil())
})
})
95 changes: 57 additions & 38 deletions api/v1/multiclusterhub_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,93 +8,112 @@ import (
const (
// MCH
Appsub string = "app-lifecycle"
Search string = "search"
ClusterBackup string = "cluster-backup"
ClusterLifecycle string = "cluster-lifecycle"
ClusterPermission string = "cluster-permission"
ManagementIngress string = "management-ingress"
Console string = "console"
Insights string = "insights"
GRC string = "grc"
ClusterLifecycle string = "cluster-lifecycle"
ClusterBackup string = "cluster-backup"
Repo string = "multiclusterhub-repo"
Insights string = "insights"
ManagementIngress string = "management-ingress"
MultiClusterEngine string = "multicluster-engine"
MultiClusterObservability string = "multicluster-observability"
Repo string = "multiclusterhub-repo"
Search string = "search"
SubmarinerAddon string = "submariner-addon"
Volsync string = "volsync"
MultiClusterObservability string = "observability"

// MCE
MCEManagedServiceAccount string = "managedserviceaccount-preview"
MCEConsole string = "console-mce"
MCEDiscovery string = "discovery"
MCEHive string = "hive"
MCEAssistedService string = "assisted-service"
MCEClusterLifecycle string = "cluster-lifecycle-mce"
MCEClusterManager string = "cluster-manager"
MCEServerFoundation string = "server-foundation"
MCEHypershift string = "hypershift"
MCEHypershiftPreview string = "hypershift-preview"
MCEHypershiftLocalHosting string = "hypershift-local-hosting"
MCEClusterProxyAddon string = "cluster-proxy-addon"
MCEConsole string = "console-mce"
MCEDiscovery string = "discovery"
MCEHive string = "hive"
MCEHypershiftLocalHosting string = "hypershift-local-hosting"
MCEHypershiftPreview string = "hypershift-preview"
MCEHypershift string = "hypershift"
MCELocalCluster string = "local-cluster"
MCEManagedServiceAccount string = "managedserviceaccount-preview"
MCEServerFoundation string = "server-foundation"
)

var allComponents = []string{
// MCH
Repo,
Search,
ClusterPermission,
Appsub,
ManagementIngress,
ClusterBackup,
ClusterLifecycle,
ClusterPermission,
Console,
Insights,
GRC,
ClusterLifecycle,
ClusterBackup,
Volsync,
Insights,
ManagementIngress,
MultiClusterEngine,
MultiClusterObservability,
Repo,
Search,
SubmarinerAddon,
Volsync,

// MCE
MCEAssistedService,
MCEClusterLifecycle,
MCEClusterManager,
MCEClusterProxyAddon,
MCEConsole,
MCEDiscovery,
MCEHive,
MCEServerFoundation,
MCEConsole,
MCEManagedServiceAccount,
MCEHypershift,
MCEHypershiftPreview,
MCEHypershiftLocalHosting,
MCEClusterProxyAddon,
MCEHypershiftPreview,
MCEManagedServiceAccount,
MCEServerFoundation,
}

var MCHComponents = []string{
Appsub,
ClusterBackup,
ClusterLifecycle,
ClusterPermission,
Console,
GRC,
Insights,
// MultiClusterEngine,
MultiClusterObservability,
//Repo,
Search,
SubmarinerAddon,
Volsync,
}

var MCEComponents = []string{
MCEAssistedService,
MCEClusterLifecycle,
MCEClusterManager,
MCEConsole,
MCEDiscovery,
MCEHive,
MCEServerFoundation,
MCEConsole,
MCEManagedServiceAccount,
MCEHypershift,
MCEHypershiftPreview,
MCEHypershiftLocalHosting,
MCEHypershiftPreview,
MCEManagedServiceAccount,
MCEServerFoundation,
}

func GetDefaultEnabledComponents() ([]string, error) {
var defaultEnabledComponents = []string{
//Repo,
Appsub,
ClusterLifecycle,
ClusterPermission,
Console,
Insights,
GRC,
ClusterLifecycle,
Volsync,
Insights,
MultiClusterEngine,
Search,
Appsub,
MultiClusterObservability,
ClusterPermission,
Search,
SubmarinerAddon,
Volsync,
}

return defaultEnabledComponents, nil
Expand Down
4 changes: 2 additions & 2 deletions controllers/finalizers.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (r *MultiClusterHubReconciler) cleanupMultiClusterEngine(log logr.Logger, m

return nil
}
func (r *MultiClusterHubReconciler) cleanupNamespaces(reqLogger logr.Logger) error {
func (r *MultiClusterHubReconciler) cleanupNamespaces(reqLogger logr.Logger, m *operatorsv1.MultiClusterHub) error {
ctx := context.Background()
clusterBackupNamespace := &corev1.Namespace{}
err := r.Client.Get(ctx, types.NamespacedName{Name: utils.ClusterSubscriptionNamespace}, clusterBackupNamespace)
Expand Down Expand Up @@ -274,7 +274,7 @@ func (r *MultiClusterHubReconciler) cleanupAppSubscriptions(reqLogger logr.Logge
return nil
}

func (r *MultiClusterHubReconciler) orphanOwnedMultiClusterEngine(m *operatorsv1.MultiClusterHub) error {
func (r *MultiClusterHubReconciler) orphanOwnedMultiClusterEngine(reqLogger logr.Logger, m *operatorsv1.MultiClusterHub) error {
ctx := context.Background()

mce, err := multiclusterengine.GetManagedMCE(ctx, r.Client)
Expand Down
Loading

0 comments on commit ddeeea1

Please sign in to comment.