File tree Expand file tree Collapse file tree 4 files changed +37
-11
lines changed Expand file tree Collapse file tree 4 files changed +37
-11
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$' \n\t '
4
+
5
+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
6
+ readonly SCRIPT_DIR
7
+
8
+ # shellcheck source=hack/common.sh
9
+ source " ${SCRIPT_DIR} /../common.sh"
10
+
11
+ # Below are the lists of CSI Providers allowed for a specific infrastructure.
12
+ # - When we support a new infrastructure, we need to a create a new entry in this array using the same convention.
13
+ # - When we support a new CSI Provider, we need to add it to one or more of these lists.
14
+ declare -rA CSI_PROVIDERS=(
15
+ [" aws" ]=' ["aws-ebs"]'
16
+ [" nutanix" ]=' ["nutanix"]'
17
+ [" docker" ]=' ["local-path"]'
18
+ )
19
+
20
+ readonly CSI_JSONPATH=' .spec.versions[].schema.openAPIV3Schema.properties.spec.properties.addons.properties.csi.properties'
21
+
22
+ for provider in " ${! CSI_PROVIDERS[@]} " ; do
23
+ custerconfig_file=" ${GIT_REPO_ROOT} /api/v1alpha1/crds/caren.nutanix.com_${provider} clusterconfigs.yaml"
24
+ cat << EOF >"${custerconfig_file} .tmp"
25
+ $( cat " ${GIT_REPO_ROOT} /hack/license-header.yaml.txt" )
26
+ ---
27
+ $( gojq --yaml-input --yaml-output \
28
+ " (${CSI_JSONPATH} .providers.items.properties.name.enum, ${CSI_JSONPATH} .defaultStorage.properties.providerName.enum) |= ${CSI_PROVIDERS[${provider}]} " \
29
+ " ${custerconfig_file} " )
30
+ EOF
31
+
32
+ mv " ${custerconfig_file} " {.tmp,}
33
+ done
Original file line number Diff line number Diff line change @@ -68,11 +68,6 @@ generate-helm-configmap:
68
68
./hack/addons/add-warning-helm-configmap.sh
69
69
70
70
# Set only the supported CSI providers for each provider.
71
- .PHONY : configure-csi-providers.%
72
- configure-csi-providers.% : CSI_JSONPATH := .spec.versions[].schema.openAPIV3Schema.properties.spec.properties.addons.properties.csi.properties
73
- configure-csi-providers.% : ; $(info $(M ) configuring csi providers for $* clusterconfigs)
74
- gojq --yaml-input --yaml-output \
75
- ' ($(CSI_JSONPATH).providers.items.properties.name.enum, $(CSI_JSONPATH).defaultStorage.properties.providerName.enum) |= $(CSI_PROVIDERS_$(*))' \
76
- api/v1alpha1/crds/caren.nutanix.com_$(* ) clusterconfigs.yaml > api/v1alpha1/crds/caren.nutanix.com_$(* ) clusterconfigs.yaml.tmp
77
- cat hack/license-header.yaml.txt <( echo ---) api/v1alpha1/crds/caren.nutanix.com_$(* ) clusterconfigs.yaml.tmp > api/v1alpha1/crds/caren.nutanix.com_$(* ) clusterconfigs.yaml
78
- rm api/v1alpha1/crds/caren.nutanix.com_$(* ) clusterconfigs.yaml.tmp
71
+ .PHONY : configure-csi-providers
72
+ configure-csi-providers : ; $(info $(M ) configuring supported csi providers)
73
+ ./hack/addons/configure-supported-csi-providers.sh
Original file line number Diff line number Diff line change 1
1
# Copyright 2023 Nutanix. All rights reserved.
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
- ADDONS_PROVIDER := ClusterResourceSet
5
-
6
4
.PHONY : dev.run-on-kind
7
5
dev.run-on-kind : export KUBECONFIG := $(KIND_KUBECONFIG )
8
6
dev.run-on-kind : kind.create clusterctl.init
Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ go-generate: ; $(info $(M) running go generate)
201
201
object:headerFile=" hack/license-header.go.txt" output:object:artifacts:config=/dev/null \
202
202
crd:headerFile=hack/license-header.yaml.txt output:crd:artifacts:config=./api/v1alpha1/crds
203
203
# $(MAKE) go-fix
204
- $(MAKE ) $( addprefix configure-csi-providers.,aws nutanix docker)
204
+ $(MAKE ) configure-csi-providers
205
205
206
206
.PHONY : go-mod-upgrade
207
207
go-mod-upgrade : # # Interactive check for direct module dependency upgrades
You can’t perform that action at this time.
0 commit comments