Skip to content

Commit

Permalink
Updated resources for v4.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Praveenrajmani committed Sep 25, 2024
1 parent c767c13 commit d6f9d1c
Show file tree
Hide file tree
Showing 58 changed files with 145 additions and 2,683 deletions.
44 changes: 10 additions & 34 deletions generate-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,48 +71,24 @@ function git_commit() {
}

function update_resources() {
path="resources/base"
declare directpv_args
echo "$@"
for arg in "$@"; do
if [ "${arg}" == "--legacy" ]; then
path="resources/legacy/base"
elif [ "${arg}" == "--openshift" ]; then
path="resources/openshift/base"
fi
directpv_args+=("${arg}")
done

declare -A resources
"${KUBECTL_DIRECTPV}" install "${directpv_args[@]}" -o yaml | sed -e 's/^---/~~~/g' | awk '{f="file" NR; print $0 > f}' RS='~~~'
"${KUBECTL_DIRECTPV}" install -o yaml | sed -e 's/^---/~~~/g' | awk '{f="file" NR; print $0 > f}' RS='~~~'
for file in file*; do
name=$(awk '/^kind:/ { print $NF }' "${file}")
if [ "${name}" == "CustomResourceDefinition" ]; then
name=$(awk '/^ name:/ { print $NF }' "${file}")
fi
if [[ -v "resources[$name]" ]]; then
name+=-$(awk '/^ name:/ { print $NF }' "${file}")
fi
if [ -n "$name" ]; then
resources["$name"]=""
fi
if [ -n "${name}" ]; then
mv "${file}" "${PWD}/${path}/${name}.yaml"
else
rm "${file}"
fi
name=$(awk '/^kind:/ { print $NF }' "${file}")
if [ "${name}" == "CustomResourceDefinition" ]; then
name=$(awk '/^ name:/ { print $NF }' "${file}")
fi
if [ -n "${name}" ]; then
mv "${file}" "${PWD}/resources/base/${name}.yaml"
else
rm "${file}"
fi
done

git_commit "Updated resources for v${BUILD_VERSION}"
}

function main() {
rm -rf resources/base/*
update_resources
rm -rf resources/legacy/base/*
update_resources --legacy
rm -rf resources/openshift/base/*
update_resources --openshift
}

init "$@"
Expand Down
21 changes: 21 additions & 0 deletions resources/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: directpv
commonAnnotations:
directpv.min.io/authors: MinIO, Inc.
directpv.min.io/support: https://subnet.min.io
resources:
- resources/Namespace.yaml
- resources/directpvdrives.directpv.min.io.yaml
- resources/directpvinitrequests.directpv.min.io.yaml
- resources/directpvnodes.directpv.min.io.yaml
- resources/directpvvolumes.directpv.min.io.yaml
- resources/CSIDriver.yaml
- resources/StorageClass.yaml
- resources/ServiceAccount.yaml
- resources/ClusterRole.yaml
- resources/ClusterRoleBinding.yaml
- resources/Role.yaml
- resources/RoleBinding.yaml
- resources/DaemonSet.yaml
- resources/Deployment.yaml
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ metadata:
spec:
selector:
matchLabels:
selector.directpv.min.io: directpv-min-io-2c3pu
selector.directpv.min.io: directpv-min-io-ooufw
template:
metadata:
annotations:
created-by: kubectl-directpv
creationTimestamp: null
labels:
selector.directpv.min.io: directpv-min-io-2c3pu
selector.directpv.min.io: directpv-min-io-ooufw
selector.directpv.min.io.service: enabled
name: node-server
namespace: directpv
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
replicas: 3
selector:
matchLabels:
selector.directpv.min.io: controller-ms345
selector.directpv.min.io: controller-ckhew
strategy:
type: Recreate
template:
Expand All @@ -26,7 +26,7 @@ spec:
created-by: kubectl-directpv
creationTimestamp: null
labels:
selector.directpv.min.io: controller-ms345
selector.directpv.min.io: controller-ckhew
name: controller
namespace: directpv
spec:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 0 additions & 21 deletions resources/kustomization.yaml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 0 additions & 21 deletions resources/legacy/base/CSIDriver.yaml

This file was deleted.

173 changes: 0 additions & 173 deletions resources/legacy/base/ClusterRole.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions resources/legacy/base/ClusterRoleBinding.yaml

This file was deleted.

Loading

0 comments on commit d6f9d1c

Please sign in to comment.