Skip to content

Commit c22b9e2

Browse files
committed
fixup! refactor: Satisfy pre-commit
1 parent 9955adb commit c22b9e2

File tree

12 files changed

+35
-28
lines changed

12 files changed

+35
-28
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ require (
1515
github.com/d2iq-labs/capi-runtime-extensions/api v0.0.0-00010101000000-000000000000
1616
github.com/d2iq-labs/capi-runtime-extensions/common v0.0.0-00010101000000-000000000000
1717
github.com/go-logr/logr v1.4.1
18+
github.com/nutanix-cloud-native/prism-go-client v0.3.4
1819
github.com/onsi/ginkgo/v2 v2.16.0
1920
github.com/onsi/gomega v1.31.1
2021
github.com/spf13/pflag v1.0.5
@@ -94,7 +95,6 @@ require (
9495
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
9596
github.com/modern-go/reflect2 v1.0.2 // indirect
9697
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
97-
github.com/nutanix-cloud-native/prism-go-client v0.3.4 // indirect
9898
github.com/opencontainers/go-digest v1.0.0 // indirect
9999
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
100100
github.com/pelletier/go-toml v1.9.5 // indirect

hack/examples/base/nutanix/clusterclass/kustomization.yaml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ patches:
3131
generateExtension: "nutanixworkerconfigpatch.capi-runtime-extensions"
3232
discoverVariablesExtension: "nutanixworkerconfigvars.capi-runtime-extensions"
3333
- op: "remove"
34-
path: "/spec/variables"
34+
path: "/spec/variables"

hack/examples/overlays/nutanix/calico/helm-addon/kustomization.yaml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ patches:
1717
value:
1818
cni:
1919
provider: Calico
20-
strategy: HelmAddon
20+
strategy: HelmAddon

hack/examples/overlays/nutanix/cilium/crs/kustomization.yaml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ patches:
1717
value:
1818
cni:
1919
provider: Cilium
20-
strategy: ClusterResourceSet
20+
strategy: ClusterResourceSet

hack/examples/overlays/nutanix/cilium/helm-addon/kustomization.yaml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ patches:
1717
value:
1818
cni:
1919
provider: Cilium
20-
strategy: HelmAddon
20+
strategy: HelmAddon

hack/examples/overlays/nutanix/clusterclass/kustomization.yaml.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ kind: Kustomization
66

77
resources:
88
- ../../../base/nutanix/clusterclass
9-

hack/examples/overlays/nutanix/kustomization.yaml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,4 @@ patches:
129129
generateExtension: "nutanixworkerconfigpatch.capi-runtime-extensions"
130130
discoverVariablesExtension: "nutanixworkerconfigvars.capi-runtime-extensions"
131131
- op: "remove"
132-
path: "/spec/variables"
132+
path: "/spec/variables"

hack/examples/sync.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ readonly EXAMPLE_CLUSTERS_DIR=examples/capi-quick-start
2020
mkdir -p "${EXAMPLE_CLUSTERS_DIR}"
2121

2222
# build nutanix overlays
23-
kustomize build ./hack/examples/overlays/nutanix/clusterclass > "${EXAMPLE_CLUSTERCLASSES_DIR}/nutanix-cluster-class.yaml"
24-
kustomize build ./hack/examples/overlays/nutanix/calico/crs > "${EXAMPLE_CLUSTERS_DIR}/nutanix-cluster-calico-crs.yaml"
25-
kustomize build ./hack/examples/overlays/nutanix/calico/helm-addon > "${EXAMPLE_CLUSTERS_DIR}/nutanix-cluster-calico-helm-addon.yaml"
26-
kustomize build ./hack/examples/overlays/nutanix/cilium/crs > "${EXAMPLE_CLUSTERS_DIR}/nutanix-cluster-cilium-crs.yaml"
27-
kustomize build ./hack/examples/overlays/nutanix/cilium/helm-addon > "${EXAMPLE_CLUSTERS_DIR}/nutanix-cluster-cilium-helm-addon.yaml"
28-
23+
kustomize build ./hack/examples/overlays/nutanix/clusterclass >"${EXAMPLE_CLUSTERCLASSES_DIR}/nutanix-cluster-class.yaml"
24+
kustomize build ./hack/examples/overlays/nutanix/calico/crs >"${EXAMPLE_CLUSTERS_DIR}/nutanix-cluster-calico-crs.yaml"
25+
kustomize build ./hack/examples/overlays/nutanix/calico/helm-addon >"${EXAMPLE_CLUSTERS_DIR}/nutanix-cluster-calico-helm-addon.yaml"
26+
kustomize build ./hack/examples/overlays/nutanix/cilium/crs >"${EXAMPLE_CLUSTERS_DIR}/nutanix-cluster-cilium-crs.yaml"
27+
kustomize build ./hack/examples/overlays/nutanix/cilium/helm-addon >"${EXAMPLE_CLUSTERS_DIR}/nutanix-cluster-cilium-helm-addon.yaml"
2928

3029
# Sync ClusterClasses (including Templates) and Clusters to separate files.
3130
kustomize build ./hack/examples |
@@ -104,10 +103,9 @@ kustomize build ./hack/examples |
104103
) \
105104
>/dev/null
106105

107-
#shellcheck disable=SC2016
108106
# TODO: deepakm-ntnx this is affecting examples of nutanix where there are 2 secrets gets same name
109-
sed -i'' 's/^ name: .\+$/ name: ${CLUSTER_NAME}/' "${EXAMPLE_CLUSTERS_DIR}"/aws*.yaml
110-
sed -i'' 's/^ name: .\+$/ name: ${CLUSTER_NAME}/' "${EXAMPLE_CLUSTERS_DIR}"/docker*.yaml
107+
#shellcheck disable=SC2016
108+
sed -i'' 's/^ name: .\+$/ name: ${CLUSTER_NAME}/' "${EXAMPLE_CLUSTERS_DIR}"/aws*.yaml "${EXAMPLE_CLUSTERS_DIR}"/docker*.yaml
111109

112110
# TODO Remove once kustomize supports retaining quotes in what will be numeric values.
113111
#shellcheck disable=SC2016

pkg/handlers/nutanix/mutation/machinedetails/inject_control_plane.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,14 @@ func (h *nutanixMachineDetailsControlPlanePatchHandler) Mutate(
128128
nutanixMachineDetailsVar.SystemDiskSize,
129129
)
130130

131-
subnets := make([]capxv1.NutanixResourceIdentifier, len(nutanixMachineDetailsVar.Subnets))
131+
subnets := make(
132+
[]capxv1.NutanixResourceIdentifier,
133+
len(nutanixMachineDetailsVar.Subnets),
134+
)
132135
for _, subnetCRE := range nutanixMachineDetailsVar.Subnets {
133-
subnet := capxv1.NutanixResourceIdentifier{Type: capxv1.NutanixIdentifierType(subnetCRE.Type)}
136+
subnet := capxv1.NutanixResourceIdentifier{
137+
Type: capxv1.NutanixIdentifierType(subnetCRE.Type),
138+
}
134139
if subnetCRE.Type == v1alpha1.NutanixIdentifierName {
135140
subnet.Name = subnetCRE.Name
136141
} else {
@@ -140,7 +145,7 @@ func (h *nutanixMachineDetailsControlPlanePatchHandler) Mutate(
140145
}
141146

142147
obj.Spec.Template.Spec.Subnets = subnets
143-
// TODO
148+
// TODO Update project, categories, and GPUs.
144149
// obj.Spec.Template.Spec.Project = nutanixMachineDetailsVar.Project
145150
// obj.Spec.Template.Spec.AdditionalCategories = nutanixMachineDetailsVar.AdditionalCategories
146151
// obj.Spec.Template.Spec.GPUs = nutanixMachineDetailsVar.GPUs

pkg/handlers/nutanix/mutation/machinedetails/inject_worker.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,14 @@ func (h *nutanixMachineDetailsWorkerPatchHandler) Mutate(
122122
nutanixMachineDetailsVar.SystemDiskSize,
123123
)
124124

125-
subnets := make([]capxv1.NutanixResourceIdentifier, len(nutanixMachineDetailsVar.Subnets))
125+
subnets := make(
126+
[]capxv1.NutanixResourceIdentifier,
127+
len(nutanixMachineDetailsVar.Subnets),
128+
)
126129
for _, subnetCRE := range nutanixMachineDetailsVar.Subnets {
127-
subnet := capxv1.NutanixResourceIdentifier{Type: capxv1.NutanixIdentifierType(subnetCRE.Type)}
130+
subnet := capxv1.NutanixResourceIdentifier{
131+
Type: capxv1.NutanixIdentifierType(subnetCRE.Type),
132+
}
128133
if subnetCRE.Type == v1alpha1.NutanixIdentifierName {
129134
subnet.Name = subnetCRE.Name
130135
} else {
@@ -134,7 +139,7 @@ func (h *nutanixMachineDetailsWorkerPatchHandler) Mutate(
134139
}
135140

136141
obj.Spec.Template.Spec.Subnets = subnets
137-
// TODO
142+
// TODO Update project, categories, and GPUs.
138143
// obj.Spec.Template.Spec.Project = nutanixMachineDetailsVar.Project
139144
// obj.Spec.Template.Spec.AdditionalCategories = nutanixMachineDetailsVar.AdditionalCategories
140145
// obj.Spec.Template.Spec.GPUs = nutanixMachineDetailsVar.GPUs

pkg/handlers/nutanix/mutation/metapatch_handler_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ func metaPatchGeneratorFunc(mgr manager.Manager) func() mutation.GeneratePatches
3636
}
3737
}
3838

39-
func workerPatchGeneratorFunc() func() mutation.GeneratePatches {
40-
return func() mutation.GeneratePatches {
41-
return MetaWorkerPatchHandler().(mutation.GeneratePatches)
42-
}
43-
}
39+
// func workerPatchGeneratorFunc() func() mutation.GeneratePatches {
40+
// return func() mutation.GeneratePatches {
41+
// return MetaWorkerPatchHandler().(mutation.GeneratePatches)
42+
// }
43+
// }
4444

4545
func TestGeneratePatches(t *testing.T) {
4646
t.Parallel()

pkg/handlers/nutanix/mutation/prismcentralendpoint/inject.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package prismcentralendpoint
66
import (
77
"context"
88

9+
"github.com/nutanix-cloud-native/prism-go-client/environment/credentials"
910
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
1011
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
1112
runtimehooksv1 "sigs.k8s.io/cluster-api/exp/runtime/hooks/api/v1alpha1"
@@ -18,7 +19,6 @@ import (
1819
"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/patches/selectors"
1920
"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/variables"
2021
"github.com/d2iq-labs/capi-runtime-extensions/pkg/handlers/generic/clusterconfig"
21-
"github.com/nutanix-cloud-native/prism-go-client/environment/credentials"
2222
)
2323

2424
const (

0 commit comments

Comments
 (0)