From 1cdea86203e3b543a45bee26d5c15f481e94717c Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:10:55 +0200 Subject: [PATCH] [Maintenance] Update README (#1736) --- Makefile | 135 +++++++++++------- README.md | 39 +++-- .../templates/crd/cluster-role.yaml | 16 +++ .../templates/crd/cluster-role.yaml | 16 +++ .../templates/crd/cluster-role.yaml | 16 +++ .../templates/crd/cluster-role.yaml | 16 +++ internal/docs_test.go | 73 +++++++--- internal/platforms.yaml | 100 +++++++++---- internal/readme.go | 10 +- 9 files changed, 302 insertions(+), 119 deletions(-) diff --git a/Makefile b/Makefile index 7c176d50e..ca462de78 100644 --- a/Makefile +++ b/Makefile @@ -542,75 +542,100 @@ manifests-crd-kustomize: manifests-crd-file manifests: manifests-crd-kustomize $(eval $(call manifest-generator, deployment, kube-arangodb, \ - --set "operator.features.deployment=true" \ - --set "operator.features.deploymentReplications=false" \ - --set "operator.features.storage=false" \ - --set "operator.features.apps=false" \ - --set "operator.features.ml=false" \ - --set "operator.features.k8sToK8sClusterSync=false" \ - --set "operator.features.backup=false")) + --set "operator.features.deployment=true" \ + --set "operator.features.deploymentReplications=false" \ + --set "operator.features.storage=false" \ + --set "operator.features.backup=false" \ + --set "operator.features.apps=false" \ + --set "operator.features.k8sToK8sClusterSync=false" \ + --set "operator.features.ml=false" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=true" \ + --set "operator.features.scheduler=true")) $(eval $(call manifest-generator, deployment-replication, kube-arangodb, \ - --set "operator.features.deployment=false" \ - --set "operator.features.deploymentReplications=true" \ - --set "operator.features.storage=false" \ - --set "operator.features.apps=false" \ - --set "operator.features.k8sToK8sClusterSync=false" \ - --set "operator.features.backup=false")) + --set "operator.features.deployment=false" \ + --set "operator.features.deploymentReplications=true" \ + --set "operator.features.storage=false" \ + --set "operator.features.backup=false" \ + --set "operator.features.apps=false" \ + --set "operator.features.k8sToK8sClusterSync=false" \ + --set "operator.features.ml=false" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=false" \ + --set "operator.features.scheduler=false")) $(eval $(call manifest-generator, storage, kube-arangodb, \ - --set "operator.features.deployment=false" \ - --set "operator.features.deploymentReplications=false" \ - --set "operator.features.storage=true" \ - --set "operator.features.apps=false" \ - --set "operator.features.ml=false" \ - --set "operator.features.k8sToK8sClusterSync=false" \ - --set "operator.features.backup=false")) + --set "operator.features.deployment=false" \ + --set "operator.features.deploymentReplications=false" \ + --set "operator.features.storage=true" \ + --set "operator.features.backup=false" \ + --set "operator.features.apps=false" \ + --set "operator.features.k8sToK8sClusterSync=false" \ + --set "operator.features.ml=false" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=false" \ + --set "operator.features.scheduler=false")) $(eval $(call manifest-generator, backup, kube-arangodb, \ - --set "operator.features.deployment=false" \ - --set "operator.features.deploymentReplications=false" \ - --set "operator.features.storage=false" \ - --set "operator.features.apps=false" \ - --set "operator.features.ml=false" \ - --set "operator.features.k8sToK8sClusterSync=false" \ - --set "operator.features.backup=true")) + --set "operator.features.deployment=false" \ + --set "operator.features.deploymentReplications=false" \ + --set "operator.features.storage=false" \ + --set "operator.features.backup=true" \ + --set "operator.features.apps=false" \ + --set "operator.features.k8sToK8sClusterSync=false" \ + --set "operator.features.ml=false" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=false" \ + --set "operator.features.scheduler=false")) $(eval $(call manifest-generator, apps, kube-arangodb, \ - --set "operator.features.deployment=false" \ - --set "operator.features.deploymentReplications=false" \ - --set "operator.features.storage=false" \ - --set "operator.features.apps=true" \ - --set "operator.features.ml=false" \ - --set "operator.features.k8sToK8sClusterSync=false" \ - --set "operator.features.backup=false")) + --set "operator.features.deployment=false" \ + --set "operator.features.deploymentReplications=false" \ + --set "operator.features.storage=false" \ + --set "operator.features.backup=false" \ + --set "operator.features.apps=true" \ + --set "operator.features.k8sToK8sClusterSync=false" \ + --set "operator.features.ml=false" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=false" \ + --set "operator.features.scheduler=false")) $(eval $(call manifest-generator, ml, kube-arangodb, \ - --set "operator.features.deployment=false" \ - --set "operator.features.deploymentReplications=false" \ - --set "operator.features.storage=false" \ - --set "operator.features.apps=false" \ - --set "operator.features.ml=true" \ - --set "operator.features.k8sToK8sClusterSync=false" \ - --set "operator.features.backup=false")) + --set "operator.features.deployment=false" \ + --set "operator.features.deploymentReplications=false" \ + --set "operator.features.storage=false" \ + --set "operator.features.backup=false" \ + --set "operator.features.apps=false" \ + --set "operator.features.k8sToK8sClusterSync=false" \ + --set "operator.features.ml=true" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=false" \ + --set "operator.features.scheduler=false")) $(eval $(call manifest-generator, k2kclustersync, kube-arangodb, \ - --set "operator.features.deployment=false" \ - --set "operator.features.deploymentReplications=false" \ - --set "operator.features.storage=false" \ - --set "operator.features.apps=false" \ - --set "operator.features.ml=false" \ - --set "operator.features.k8sToK8sClusterSync=true" \ - --set "operator.features.backup=false")) + --set "operator.features.deployment=false" \ + --set "operator.features.deploymentReplications=false" \ + --set "operator.features.storage=false" \ + --set "operator.features.backup=false" \ + --set "operator.features.apps=false" \ + --set "operator.features.k8sToK8sClusterSync=true" \ + --set "operator.features.ml=false" \ + --set "operator.features.analytics=false" \ + --set "operator.features.networking=false" \ + --set "operator.features.scheduler=false")) $(eval $(call manifest-generator, all, kube-arangodb, \ - --set "operator.features.deployment=true" \ - --set "operator.features.deploymentReplications=true" \ - --set "operator.features.storage=true" \ - --set "operator.features.apps=true" \ - --set "operator.features.ml=true" \ - --set "operator.features.k8sToK8sClusterSync=true" \ - --set "operator.features.backup=true")) + --set "operator.features.deployment=true" \ + --set "operator.features.deploymentReplications=true" \ + --set "operator.features.storage=true" \ + --set "operator.features.backup=true" \ + --set "operator.features.apps=true" \ + --set "operator.features.k8sToK8sClusterSync=true" \ + --set "operator.features.ml=true" \ + --set "operator.features.analytics=true" \ + --set "operator.features.networking=true" \ + --set "operator.features.scheduler=true")) .PHONY: chart-crd chart-crd: export CHART_NAME := kube-arangodb-crd diff --git a/README.md b/README.md index 5643abcbd..8568367b9 100644 --- a/README.md +++ b/README.md @@ -52,19 +52,32 @@ covers individual newer features separately. [START_INJECT]: # (kubernetesVersionsTable) -| Platform | Kubernetes Version | ArangoDB Version | State | Remarks | Provider Remarks | -|:--------------------|:-------------------|:-----------------|:-----------|:------------------------------------------|:-----------------------------------| -| Google GKE | 1.25-1.30 | >= 3.8.0 | Production | Don't use micro nodes | | -| Azure AKS | 1.25-1.30 | >= 3.8.0 | Production | | | -| Amazon EKS | 1.25-1.30 | >= 3.8.0 | Production | | [Amazon EKS](./docs/providers/eks) | -| IBM Cloud | <= 1.20 | >= 3.8.0 | Deprecated | Support will be dropped in Operator 1.5.0 | | -| IBM Cloud | 1.25-1.30 | >= 3.8.0 | Production | | | -| OpenShift | 3.11 | >= 3.8.0 | Deprecated | Support will be dropped in Operator 1.5.0 | | -| OpenShift | 4.2-4.14 | >= 3.8.0 | Production | | | -| BareMetal (kubeadm) | <= 1.20 | >= 3.8.0 | Deprecated | Support will be dropped in Operator 1.5.0 | | -| BareMetal (kubeadm) | 1.25-1.30 | >= 3.8.0 | Production | | | -| Minikube | 1.25-1.30 | >= 3.8.0 | Devel Only | | | -| Other | 1.25-1.30 | >= 3.8.0 | Devel Only | | | +| Platform | State | Kubernetes Version | ArangoDB Version | Remarks | Provider Remarks | +|:--------------------|:-------------|:-------------------|:-----------------|:----------------------|:-----------------------------------| +| Google GKE | Production | 1.28-1.31 | >= 3.11.0 | Don't use micro nodes | | +| | EOL | 1.25-1.27 | 3.9.0-3.10.0 | Don't use micro nodes | | +| | NotSupported | < 1.25 | < 3.8.0 | Don't use micro nodes | | +| Azure AKS | Production | 1.28-1.32 | >= 3.11.0 | | | +| | EOL | 1.25-1.27 | 3.9.0-3.10.0 | | | +| | NotSupported | < 1.25 | < 3.8.0 | | | +| Amazon EKS | Production | 1.28-1.31 | >= 3.11.0 | | [Amazon EKS](./docs/providers/eks) | +| | EOL | 1.25-1.27 | 3.9.0-3.10.0 | | [Amazon EKS](./docs/providers/eks) | +| | NotSupported | < 1.25 | < 3.8.0 | | [Amazon EKS](./docs/providers/eks) | +| IBM Cloud | Production | 1.29-1.31 | >= 3.11.0 | | | +| | EOL | 1.25-1.28 | 3.9.0-3.10.0 | | | +| | NotSupported | < 1.25 | < 3.8.0 | | | +| OpenShift | Production | 4.11-4.17 | >= 3.11.0 | | | +| | EOL | 4.2-4.11 | 3.9.0-3.10.0 | | | +| | NotSupported | < 4.2 | < 3.8.0 | | | +| BareMetal (kubeadm) | Production | 1.28-1.31 | >= 3.11.0 | | | +| | EOL | 1.25-1.27 | 3.9.0-3.10.0 | | | +| | NotSupported | < 1.25 | < 3.8.0 | | | +| Minikube | Devel Only | 1.28-1.31 | >= 3.11.0 | | | +| | EOL | 1.25-1.27 | 3.9.0-3.10.0 | | | +| | NotSupported | < 1.25 | < 3.8.0 | | | +| Other | Production | 1.28-1.31 | >= 3.11.0 | | | +| | EOL | 1.25-1.27 | 3.9.0-3.10.0 | | | +| | NotSupported | < 1.25 | < 3.8.0 | | | [END_INJECT]: # (kubernetesVersionsTable) diff --git a/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml b/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml index 17936fa1b..433df0878 100644 --- a/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb-arm64/templates/crd/cluster-role.yaml @@ -13,18 +13,23 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} rules: +{{ if .Values.operator.features.analytics -}} # analytics.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "graphanalyticsengines.analytics.arangodb.com" +{{- end }} +{{ if .Values.operator.features.apps -}} # apps.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangojobs.apps.arangodb.com" +{{- end }} +{{ if .Values.operator.features.backup -}} # backup.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -32,6 +37,8 @@ rules: resourceNames: - "arangobackuppolicies.backup.arangodb.com" - "arangobackups.backup.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deployment -}} # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -41,6 +48,8 @@ rules: - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.ml -}} # ml.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -50,18 +59,24 @@ rules: - "arangomlcronjobs.ml.arangodb.com" - "arangomlextensions.ml.arangodb.com" - "arangomlstorages.ml.arangodb.com" +{{- end }} +{{ if .Values.operator.features.networking -}} # networking.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangoroutes.networking.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deploymentReplications -}} # replication.database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangodeploymentreplications.replication.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.scheduler -}} # scheduler.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -72,6 +87,7 @@ rules: - "arangoschedulerdeploymets.scheduler.arangodb.com" - "arangoschedulerbatchjobs.scheduler.arangodb.com" - "arangoschedulercronjobs.scheduler.arangodb.com" +{{- end }} {{- end }} {{- end }} diff --git a/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml b/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml index 17936fa1b..433df0878 100644 --- a/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb-enterprise-arm64/templates/crd/cluster-role.yaml @@ -13,18 +13,23 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} rules: +{{ if .Values.operator.features.analytics -}} # analytics.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "graphanalyticsengines.analytics.arangodb.com" +{{- end }} +{{ if .Values.operator.features.apps -}} # apps.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangojobs.apps.arangodb.com" +{{- end }} +{{ if .Values.operator.features.backup -}} # backup.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -32,6 +37,8 @@ rules: resourceNames: - "arangobackuppolicies.backup.arangodb.com" - "arangobackups.backup.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deployment -}} # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -41,6 +48,8 @@ rules: - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.ml -}} # ml.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -50,18 +59,24 @@ rules: - "arangomlcronjobs.ml.arangodb.com" - "arangomlextensions.ml.arangodb.com" - "arangomlstorages.ml.arangodb.com" +{{- end }} +{{ if .Values.operator.features.networking -}} # networking.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangoroutes.networking.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deploymentReplications -}} # replication.database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangodeploymentreplications.replication.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.scheduler -}} # scheduler.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -72,6 +87,7 @@ rules: - "arangoschedulerdeploymets.scheduler.arangodb.com" - "arangoschedulerbatchjobs.scheduler.arangodb.com" - "arangoschedulercronjobs.scheduler.arangodb.com" +{{- end }} {{- end }} {{- end }} diff --git a/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml b/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml index 17936fa1b..433df0878 100644 --- a/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb-enterprise/templates/crd/cluster-role.yaml @@ -13,18 +13,23 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} rules: +{{ if .Values.operator.features.analytics -}} # analytics.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "graphanalyticsengines.analytics.arangodb.com" +{{- end }} +{{ if .Values.operator.features.apps -}} # apps.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangojobs.apps.arangodb.com" +{{- end }} +{{ if .Values.operator.features.backup -}} # backup.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -32,6 +37,8 @@ rules: resourceNames: - "arangobackuppolicies.backup.arangodb.com" - "arangobackups.backup.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deployment -}} # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -41,6 +48,8 @@ rules: - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.ml -}} # ml.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -50,18 +59,24 @@ rules: - "arangomlcronjobs.ml.arangodb.com" - "arangomlextensions.ml.arangodb.com" - "arangomlstorages.ml.arangodb.com" +{{- end }} +{{ if .Values.operator.features.networking -}} # networking.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangoroutes.networking.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deploymentReplications -}} # replication.database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangodeploymentreplications.replication.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.scheduler -}} # scheduler.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -72,6 +87,7 @@ rules: - "arangoschedulerdeploymets.scheduler.arangodb.com" - "arangoschedulerbatchjobs.scheduler.arangodb.com" - "arangoschedulercronjobs.scheduler.arangodb.com" +{{- end }} {{- end }} {{- end }} diff --git a/chart/kube-arangodb/templates/crd/cluster-role.yaml b/chart/kube-arangodb/templates/crd/cluster-role.yaml index 17936fa1b..433df0878 100644 --- a/chart/kube-arangodb/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb/templates/crd/cluster-role.yaml @@ -13,18 +13,23 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} rules: +{{ if .Values.operator.features.analytics -}} # analytics.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "graphanalyticsengines.analytics.arangodb.com" +{{- end }} +{{ if .Values.operator.features.apps -}} # apps.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangojobs.apps.arangodb.com" +{{- end }} +{{ if .Values.operator.features.backup -}} # backup.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -32,6 +37,8 @@ rules: resourceNames: - "arangobackuppolicies.backup.arangodb.com" - "arangobackups.backup.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deployment -}} # database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -41,6 +48,8 @@ rules: - "arangodeployments.database.arangodb.com" - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.ml -}} # ml.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -50,18 +59,24 @@ rules: - "arangomlcronjobs.ml.arangodb.com" - "arangomlextensions.ml.arangodb.com" - "arangomlstorages.ml.arangodb.com" +{{- end }} +{{ if .Values.operator.features.networking -}} # networking.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangoroutes.networking.arangodb.com" +{{- end }} +{{ if .Values.operator.features.deploymentReplications -}} # replication.database.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "list", "watch", "update", "delete"] resourceNames: - "arangodeploymentreplications.replication.database.arangodb.com" +{{- end }} +{{ if .Values.operator.features.scheduler -}} # scheduler.arangodb.com - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] @@ -72,6 +87,7 @@ rules: - "arangoschedulerdeploymets.scheduler.arangodb.com" - "arangoschedulerbatchjobs.scheduler.arangodb.com" - "arangoschedulercronjobs.scheduler.arangodb.com" +{{- end }} {{- end }} {{- end }} diff --git a/internal/docs_test.go b/internal/docs_test.go index 765c969c9..6db3dc33e 100644 --- a/internal/docs_test.go +++ b/internal/docs_test.go @@ -21,15 +21,17 @@ package internal import ( + "bufio" "bytes" "fmt" "go/ast" "go/token" "io" "os" + "os/exec" "path" - "path/filepath" "reflect" + "sort" "strings" "testing" @@ -365,12 +367,60 @@ func Test_GenerateAPIDocs(t *testing.T) { } } -func prepareGitHubTreePath(t *testing.T, root string) string { - vStr, err := os.ReadFile(filepath.Join(root, "VERSION")) - require.NoError(t, err, "failed to read VERSION file") - opVersion, err := semver.NewVersion(string(vStr)) +func writeFrontMatter(t *testing.T, out io.Writer, keyVals map[string]string) { + fm := "" + util.IterateSorted(keyVals, func(key, val string) { + fm += fmt.Sprintf("%s: %s\n", key, val) + }) + + if fm != "" { + fm = "---\n" + fm + "---\n\n" + } + + write(t, out, fm) +} + +func extractVersion(t *testing.T, root string) *semver.Version { + cmd := exec.Command("git", "tag", "--list") + cmd.Dir = root + + out, err := cmd.StdoutPipe() require.NoError(t, err) + require.NoError(t, cmd.Start()) + + versions := semver.Versions{} + + scanner := bufio.NewScanner(out) + // optionally, resize scanner's capacity for lines over 64K, see next example + for scanner.Scan() { + v := strings.TrimSpace(scanner.Text()) + sm, err := semver.NewVersion(v) + if err != nil { + t.Logf("Unable to parse: %s", v) + continue + } + + if v := sm.PreRelease.Slice(); len(v) > 0 && v[0] != "" { + continue + } + + versions = append(versions, sm) + } + + require.NoError(t, cmd.Wait()) + + sort.Sort(versions) + + if len(versions) == 0 { + require.Fail(t, "Required at least one version") + } + + return versions[len(versions)-1] +} + +func prepareGitHubTreePath(t *testing.T, root string) string { + opVersion := extractVersion(t, root) ref := fmt.Sprintf("%d.%d.%d", opVersion.Major, opVersion.Minor, opVersion.Patch) return fmt.Sprintf("https://github.com/arangodb/kube-arangodb/blob/%s", ref) } @@ -434,16 +484,3 @@ func write(t *testing.T, out io.Writer, format string, args ...interface{}) { _, err := out.Write([]byte(fmt.Sprintf(format, args...))) require.NoError(t, err) } - -func writeFrontMatter(t *testing.T, out io.Writer, keyVals map[string]string) { - fm := "" - util.IterateSorted(keyVals, func(key, val string) { - fm += fmt.Sprintf("%s: %s\n", key, val) - }) - - if fm != "" { - fm = "---\n" + fm + "---\n\n" - } - - write(t, out, fm) -} diff --git a/internal/platforms.yaml b/internal/platforms.yaml index ea6fd5ca8..c7ba1d198 100644 --- a/internal/platforms.yaml +++ b/internal/platforms.yaml @@ -1,55 +1,95 @@ platforms: - name: "Google GKE" versions: - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "1.28-1.31" + arangoDBVersion: ">= 3.11.0" state: "Production" - remarks: "Don't use micro nodes " + remarks: "Don't use micro nodes" + - kubernetesVersion: "1.25-1.27" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + remarks: "Don't use micro nodes" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" + remarks: "Don't use micro nodes" - name: "Azure AKS" versions: - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "1.28-1.32" + arangoDBVersion: ">= 3.11.0" state: "Production" + - kubernetesVersion: "1.25-1.27" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" - name: "Amazon EKS" versions: - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "1.28-1.31" + arangoDBVersion: ">= 3.11.0" state: "Production" providerRemarks: "[Amazon EKS](./docs/providers/eks)" + - kubernetesVersion: "1.25-1.27" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + providerRemarks: "[Amazon EKS](./docs/providers/eks)" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" + providerRemarks: "[Amazon EKS](./docs/providers/eks)" - name: "IBM Cloud" versions: - - kubernetesVersion: "<= 1.20" - arangoDBVersion: ">= 3.8.0" - state: "Deprecated" - remarks: "Support will be dropped in Operator 1.5.0" - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "1.29-1.31" + arangoDBVersion: ">= 3.11.0" state: "Production" + - kubernetesVersion: "1.25-1.28" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" - name: "OpenShift" versions: - - kubernetesVersion: "3.11" - arangoDBVersion: ">= 3.8.0" - state: "Deprecated" - remarks: "Support will be dropped in Operator 1.5.0" - - kubernetesVersion: "4.2-4.14" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "4.11-4.17" + arangoDBVersion: ">= 3.11.0" state: "Production" + - kubernetesVersion: "4.2-4.11" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + - kubernetesVersion: "< 4.2" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" - name: "BareMetal (kubeadm)" versions: - - kubernetesVersion: "<= 1.20" - arangoDBVersion: ">= 3.8.0" - state: "Deprecated" - remarks: "Support will be dropped in Operator 1.5.0" - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "1.28-1.31" + arangoDBVersion: ">= 3.11.0" state: "Production" + - kubernetesVersion: "1.25-1.27" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" - name: "Minikube" versions: - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" + - kubernetesVersion: "1.28-1.31" + arangoDBVersion: ">= 3.11.0" state: "Devel Only" + - kubernetesVersion: "1.25-1.27" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" - name: "Other" versions: - - kubernetesVersion: "1.25-1.30" - arangoDBVersion: ">= 3.8.0" - state: "Devel Only" + - kubernetesVersion: "1.28-1.31" + arangoDBVersion: ">= 3.11.0" + state: "Production" + - kubernetesVersion: "1.25-1.27" + arangoDBVersion: "3.9.0-3.10.0" + state: "EOL" + - kubernetesVersion: "< 1.25" + arangoDBVersion: "< 3.8.0" + state: "NotSupported" diff --git a/internal/readme.go b/internal/readme.go index 402e91426..7ce37fb12 100644 --- a/internal/readme.go +++ b/internal/readme.go @@ -331,9 +331,9 @@ func GenerateReadmePlatforms(root string) (string, error) { pRemarks := md.NewColumn("Provider Remarks", md.ColumnLeftAlign) t := md.NewTable( platform, + state, kVersion, aVersion, - state, remarks, pRemarks, ) @@ -350,9 +350,13 @@ func GenerateReadmePlatforms(root string) (string, error) { } for _, p := range d.Platforms { - for _, v := range p.Versions { + for id, v := range p.Versions { + n := "" + if id == 0 { + n = p.Name + } if err := t.AddRow(map[md.Column]string{ - platform: p.Name, + platform: n, kVersion: util.TypeOrDefault[string](v.KubernetesVersion, ""), aVersion: util.TypeOrDefault[string](v.ArangoDBVersion, ""), state: util.TypeOrDefault[string](v.State, ""),