-
Notifications
You must be signed in to change notification settings - Fork 7
fix: Use new patch handler for AWS and Docker ClusterClasses #1050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
43 changes: 43 additions & 0 deletions
43
pkg/handlers/deleteinv0280/aws/mutation/metapatch_handler.go
This file contains hidden or 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,43 @@ | ||
// Copyright 2023 Nutanix. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package mutation | ||
|
||
import ( | ||
"sigs.k8s.io/controller-runtime/pkg/manager" | ||
|
||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers/mutation" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/mutation/ami" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/mutation/cni/calico" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/mutation/controlplaneloadbalancer" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/mutation/iaminstanceprofile" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/mutation/instancetype" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/mutation/network" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/mutation/region" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/mutation/securitygroups" | ||
deleteinv0280genericmutation "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/deleteinv0280/generic/mutation" | ||
genericmutation "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/mutation" | ||
) | ||
|
||
// MetaPatchHandler returns a meta patch handler for mutating CAPA clusters. | ||
func MetaPatchHandler(mgr manager.Manager) handlers.Named { | ||
patchHandlers := []mutation.MetaMutator{ | ||
calico.NewPatch(), | ||
region.NewPatch(), | ||
network.NewPatch(), | ||
controlplaneloadbalancer.NewPatch(), | ||
iaminstanceprofile.NewControlPlanePatch(), | ||
instancetype.NewControlPlanePatch(), | ||
ami.NewControlPlanePatch(), | ||
securitygroups.NewControlPlanePatch(), | ||
} | ||
patchHandlers = append(patchHandlers, deleteinv0280genericmutation.MetaMutators(mgr)...) | ||
patchHandlers = append(patchHandlers, genericmutation.ControlPlaneMetaMutators()...) | ||
|
||
return mutation.NewMetaGeneratePatchesHandler( | ||
"awsClusterConfigPatch", | ||
mgr.GetClient(), | ||
patchHandlers..., | ||
) | ||
} |
29 changes: 29 additions & 0 deletions
29
pkg/handlers/deleteinv0280/docker/mutation/metapatch_handler.go
This file contains hidden or 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,29 @@ | ||
// Copyright 2023 Nutanix. All rights reserved. | ||
jimmidyson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package mutation | ||
|
||
import ( | ||
"sigs.k8s.io/controller-runtime/pkg/manager" | ||
|
||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers/mutation" | ||
deleteinv0280genericmutation "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/deleteinv0280/generic/mutation" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/docker/mutation/customimage" | ||
genericmutation "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/mutation" | ||
) | ||
|
||
// MetaPatchHandler returns a meta patch handler for mutating CAPD clusters. | ||
func MetaPatchHandler(mgr manager.Manager) handlers.Named { | ||
patchHandlers := []mutation.MetaMutator{ | ||
customimage.NewControlPlanePatch(), | ||
} | ||
patchHandlers = append(patchHandlers, deleteinv0280genericmutation.MetaMutators(mgr)...) | ||
patchHandlers = append(patchHandlers, genericmutation.ControlPlaneMetaMutators()...) | ||
|
||
return mutation.NewMetaGeneratePatchesHandler( | ||
"dockerClusterConfigPatch", | ||
mgr.GetClient(), | ||
patchHandlers..., | ||
) | ||
} |
23 changes: 23 additions & 0 deletions
23
pkg/handlers/deleteinv0280/generic/mutation/metapatch_handler.go
This file contains hidden or 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,23 @@ | ||
// Copyright 2024 Nutanix. All rights reserved. | ||
jimmidyson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package mutation | ||
|
||
import ( | ||
"sigs.k8s.io/controller-runtime/pkg/manager" | ||
|
||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers" | ||
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers/mutation" | ||
genericmutation "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/mutation" | ||
) | ||
|
||
// MetaPatchHandler returns a meta patch handler for mutating generic Kubernetes clusters. | ||
func MetaPatchHandler(mgr manager.Manager) handlers.Named { | ||
patchHandlers := MetaMutators(mgr) | ||
patchHandlers = append(patchHandlers, genericmutation.ControlPlaneMetaMutators()...) | ||
return mutation.NewMetaGeneratePatchesHandler( | ||
"genericClusterConfigPatch", | ||
mgr.GetClient(), | ||
patchHandlers..., | ||
) | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.