-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: provider an entrypoint to the infra provider meta handlers (#…
…554) **What problem does this PR solve?**: This aligns the structure to how the lifecycle handlers are created. More importantly it enables us to pass globalOptions to those infra handlers that need it. The goal of this is to use for the eventual refactor to support a more generic kube-vip implementation. But for that I need to be able to read a ConfigMap from the "default" namespace where all of these CMs are created. Again similar to how its done for the CAAPH addons https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/blob/33b29dc368622777d8dbea004077532c2a84d27a/pkg/handlers/generic/lifecycle/nfd/strategy_helmaddon.go#L56-L61 **Which issue(s) this PR fixes**: Refactor to support work for https://jira.nutanix.com/browse/D2IQ-100364 **How Has This Been Tested?**: <!-- Please describe the tests that you ran to verify your changes. Provide output from the tests and any manual steps needed to replicate the tests. --> **Special notes for your reviewer**: <!-- Use this to provide any additional information to the reviewers. This may include: - Best way to review the PR. - Where the author wants the most review attention on. - etc. -->
- Loading branch information
Showing
4 changed files
with
123 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2023 D2iQ, Inc. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package aws | ||
|
||
import ( | ||
"github.com/spf13/pflag" | ||
"sigs.k8s.io/controller-runtime/pkg/manager" | ||
|
||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers" | ||
awsclusterconfig "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/clusterconfig" | ||
awsmutation "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/mutation" | ||
awsworkerconfig "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/workerconfig" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/options" | ||
) | ||
|
||
type Handlers struct{} | ||
|
||
func New( | ||
_ *options.GlobalOptions, | ||
) *Handlers { | ||
return &Handlers{} | ||
} | ||
|
||
func (h *Handlers) AllHandlers(mgr manager.Manager) []handlers.Named { | ||
return []handlers.Named{ | ||
awsclusterconfig.NewVariable(), | ||
awsworkerconfig.NewVariable(), | ||
awsmutation.MetaPatchHandler(mgr), | ||
awsmutation.MetaWorkerPatchHandler(mgr), | ||
} | ||
} | ||
|
||
func (h *Handlers) AddFlags(_ *pflag.FlagSet) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2023 D2iQ, Inc. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package docker | ||
|
||
import ( | ||
"github.com/spf13/pflag" | ||
"sigs.k8s.io/controller-runtime/pkg/manager" | ||
|
||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers" | ||
dockerclusterconfig "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/docker/clusterconfig" | ||
dockermutation "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/docker/mutation" | ||
dockerworkerconfig "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/docker/workerconfig" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/options" | ||
) | ||
|
||
type Handlers struct{} | ||
|
||
func New( | ||
_ *options.GlobalOptions, | ||
) *Handlers { | ||
return &Handlers{} | ||
} | ||
|
||
func (h *Handlers) AllHandlers(mgr manager.Manager) []handlers.Named { | ||
return []handlers.Named{ | ||
dockerclusterconfig.NewVariable(), | ||
dockerworkerconfig.NewVariable(), | ||
dockermutation.MetaPatchHandler(mgr), | ||
dockermutation.MetaWorkerPatchHandler(mgr), | ||
} | ||
} | ||
|
||
func (h *Handlers) AddFlags(_ *pflag.FlagSet) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2023 D2iQ, Inc. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package nutanix | ||
|
||
import ( | ||
"github.com/spf13/pflag" | ||
"sigs.k8s.io/controller-runtime/pkg/manager" | ||
|
||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers" | ||
nutanixclusterconfig "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/nutanix/clusterconfig" | ||
nutanixmutation "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/nutanix/mutation" | ||
nutanixworkerconfig "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/nutanix/workerconfig" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/options" | ||
) | ||
|
||
type Handlers struct{} | ||
|
||
func New( | ||
_ *options.GlobalOptions, | ||
) *Handlers { | ||
return &Handlers{} | ||
} | ||
|
||
func (h *Handlers) AllHandlers(mgr manager.Manager) []handlers.Named { | ||
return []handlers.Named{ | ||
nutanixclusterconfig.NewVariable(), | ||
nutanixworkerconfig.NewVariable(), | ||
nutanixmutation.MetaPatchHandler(mgr), | ||
nutanixmutation.MetaWorkerPatchHandler(mgr), | ||
} | ||
} | ||
|
||
func (h *Handlers) AddFlags(_ *pflag.FlagSet) {} |