Skip to content

Commit

Permalink
Revert "modified apiversion capabilities check (#2149)"
Browse files Browse the repository at this point in the history
This reverts commit 0ccbb3b.
  • Loading branch information
ykadowak committed Nov 30, 2023
1 parent b2b2846 commit ca8d337
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
go version
make E2E_BIND_PORT=8081 \
E2E_DATASET_NAME=${DATASET} \
E2E_INSERT_COUNT=10000 \
E2E_INSERT_COUNT=60000 \
E2E_SEARCH_COUNT=10000 \
E2E_SEARCH_BY_ID_COUNT=10000 \
E2E_GET_OBJECT_COUNT=100 \
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:
go version
make E2E_BIND_PORT=8081 \
E2E_DATASET_NAME=${DATASET} \
E2E_INSERT_COUNT=10000 \
E2E_INSERT_COUNT=60000 \
E2E_SEARCH_COUNT=10000 \
E2E_SEARCH_BY_ID_COUNT=10000 \
E2E_GET_OBJECT_COUNT=100 \
Expand Down
6 changes: 3 additions & 3 deletions charts/vald/templates/agent/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
{{- if and $agent.enabled $agent.hpa.enabled }}
{{- if (.Capabilities.APIVersions.Has "autoscaling/v2") }}
apiVersion: autoscaling/v2
{{- else if (.Capabilities.APIVersions.Has "autoscaling/v1") }}
apiVersion: autoscaling/v1
{{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }}
apiVersion: autoscaling/v2beta2
{{- else }}
{{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta1") }}
apiVersion: autoscaling/v2beta1
{{- else }}
apiVersion: autoscaling/v1
{{- end }}
kind: HorizontalPodAutoscaler
metadata:
Expand Down
4 changes: 4 additions & 0 deletions charts/vald/templates/agent/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
{{- $lb := .Values.gateway.lb -}}
{{- $index := .Values.manager.index -}}
{{- if .Values.defaults.networkPolicy.enabled }}
{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }}
apiVersion: networking.k8s.io/v1alpha1
{{- else }}
apiVersion: networking.k8s.io/v1
{{- end }}
kind: NetworkPolicy
metadata:
name: agent-allow
Expand Down
6 changes: 3 additions & 3 deletions charts/vald/templates/agent/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#
{{- $agent := .Values.agent -}}
{{- if $agent.enabled }}
{{- if (.Capabilities.APIVersions.Has "policy/v1") }}
apiVersion: policy/v1
{{- else }}
{{- if (.Capabilities.APIVersions.Has "policy/v1beta1") }}
apiVersion: policy/v1beta1
{{- else }}
apiVersion: policy/v1
{{- end }}
kind: PodDisruptionBudget
metadata:
Expand Down
6 changes: 3 additions & 3 deletions charts/vald/templates/discoverer/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
{{- if $discoverer.hpa.enabled }}
{{- if (.Capabilities.APIVersions.Has "autoscaling/v2") }}
apiVersion: autoscaling/v2
{{- else if (.Capabilities.APIVersions.Has "autoscaling/v1") }}
apiVersion: autoscaling/v1
{{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }}
apiVersion: autoscaling/v2beta2
{{- else }}
{{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta1") }}
apiVersion: autoscaling/v2beta1
{{- else }}
apiVersion: autoscaling/v1
{{- end }}
kind: HorizontalPodAutoscaler
metadata:
Expand Down
4 changes: 4 additions & 0 deletions charts/vald/templates/discoverer/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
{{- $lb := .Values.gateway.lb -}}
{{- $index := .Values.manager.index -}}
{{- if .Values.defaults.networkPolicy.enabled }}
{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }}
apiVersion: networking.k8s.io/v1alpha1
{{- else }}
apiVersion: networking.k8s.io/v1
{{- end }}
kind: NetworkPolicy
metadata:
name: discoverer-allow
Expand Down
6 changes: 3 additions & 3 deletions charts/vald/templates/discoverer/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#
{{- $discoverer := .Values.discoverer -}}
{{- if $discoverer.enabled }}
{{- if (.Capabilities.APIVersions.Has "policy/v1") }}
apiVersion: policy/v1
{{- else }}
{{- if (.Capabilities.APIVersions.Has "policy/v1beta1") }}
apiVersion: policy/v1beta1
{{- else }}
apiVersion: policy/v1
{{- end }}
kind: PodDisruptionBudget
metadata:
Expand Down
6 changes: 3 additions & 3 deletions charts/vald/templates/gateway/filter/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
{{- if and $gateway.enabled $gateway.hpa.enabled }}
{{- if (.Capabilities.APIVersions.Has "autoscaling/v2") }}
apiVersion: autoscaling/v2
{{- else if (.Capabilities.APIVersions.Has "autoscaling/v1") }}
apiVersion: autoscaling/v1
{{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }}
apiVersion: autoscaling/v2beta2
{{- else }}
{{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta1") }}
apiVersion: autoscaling/v2beta1
{{- else }}
apiVersion: autoscaling/v1
{{- end }}
kind: HorizontalPodAutoscaler
metadata:
Expand Down
6 changes: 3 additions & 3 deletions charts/vald/templates/gateway/filter/ing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#
{{- $gateway := .Values.gateway.filter -}}
{{- if and $gateway.enabled $gateway.ingress.enabled }}
{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }}
apiVersion: networking.k8s.io/v1
{{- else }}
{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }}
apiVersion: networking.k8s.io/v1alpha1
{{- else }}
apiVersion: networking.k8s.io/v1
{{- end }}
kind: Ingress
metadata:
Expand Down
4 changes: 4 additions & 0 deletions charts/vald/templates/gateway/filter/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
{{- $lb := .Values.gateway.lb -}}
{{- $filter := .Values.gateway.filter -}}
{{- if .Values.defaults.networkPolicy.enabled }}
{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }}
apiVersion: networking.k8s.io/v1alpha1
{{- else }}
apiVersion: networking.k8s.io/v1
{{- end }}
kind: NetworkPolicy
metadata:
name: filter-allow
Expand Down
6 changes: 3 additions & 3 deletions charts/vald/templates/gateway/filter/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#
{{- $gateway := .Values.gateway.filter -}}
{{- if $gateway.enabled }}
{{- if (.Capabilities.APIVersions.Has "policy/v1") }}
apiVersion: policy/v1
{{- else }}
{{- if (.Capabilities.APIVersions.Has "policy/v1beta1") }}
apiVersion: policy/v1beta1
{{- else }}
apiVersion: policy/v1
{{- end }}
kind: PodDisruptionBudget
metadata:
Expand Down
6 changes: 3 additions & 3 deletions charts/vald/templates/gateway/lb/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
{{- if and $gateway.enabled $gateway.hpa.enabled }}
{{- if (.Capabilities.APIVersions.Has "autoscaling/v2") }}
apiVersion: autoscaling/v2
{{- else if (.Capabilities.APIVersions.Has "autoscaling/v1") }}
apiVersion: autoscaling/v1
{{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }}
apiVersion: autoscaling/v2beta2
{{- else }}
{{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta1") }}
apiVersion: autoscaling/v2beta1
{{- else }}
apiVersion: autoscaling/v1
{{- end }}
kind: HorizontalPodAutoscaler
metadata:
Expand Down
6 changes: 3 additions & 3 deletions charts/vald/templates/gateway/lb/ing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#
{{- $gateway := .Values.gateway.lb -}}
{{- if and $gateway.enabled $gateway.ingress.enabled }}
{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }}
apiVersion: networking.k8s.io/v1
{{- else }}
{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }}
apiVersion: networking.k8s.io/v1alpha1
{{- else }}
apiVersion: networking.k8s.io/v1
{{- end }}
kind: Ingress
metadata:
Expand Down
4 changes: 4 additions & 0 deletions charts/vald/templates/gateway/lb/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
{{- $filter := .Values.gateway.filter -}}
{{- $discoverer := .Values.discoverer -}}
{{- if .Values.defaults.networkPolicy.enabled }}
{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }}
apiVersion: networking.k8s.io/v1alpha1
{{- else }}
apiVersion: networking.k8s.io/v1
{{- end }}
kind: NetworkPolicy
metadata:
name: lb-allow
Expand Down
6 changes: 3 additions & 3 deletions charts/vald/templates/gateway/lb/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#
{{- $gateway := .Values.gateway.lb -}}
{{- if $gateway.enabled }}
{{- if (.Capabilities.APIVersions.Has "policy/v1") }}
apiVersion: policy/v1
{{- else }}
{{- if (.Capabilities.APIVersions.Has "policy/v1beta1") }}
apiVersion: policy/v1beta1
{{- else }}
apiVersion: policy/v1
{{- end }}
kind: PodDisruptionBudget
metadata:
Expand Down
4 changes: 4 additions & 0 deletions charts/vald/templates/manager/index/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
{{- $discoverer := .Values.discoverer -}}
{{- $index := .Values.manager.index -}}
{{- if .Values.defaults.networkPolicy.enabled }}
{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }}
apiVersion: networking.k8s.io/v1alpha1
{{- else }}
apiVersion: networking.k8s.io/v1
{{- end }}
kind: NetworkPolicy
metadata:
name: index-allow
Expand Down
6 changes: 3 additions & 3 deletions charts/vald/templates/manager/index/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#
{{- $index := .Values.manager.index -}}
{{- if $index.enabled }}
{{- if (.Capabilities.APIVersions.Has "policy/v1") }}
apiVersion: policy/v1
{{- else }}
{{- if (.Capabilities.APIVersions.Has "policy/v1beta1") }}
apiVersion: policy/v1beta1
{{- else }}
apiVersion: policy/v1
{{- end }}
kind: PodDisruptionBudget
metadata:
Expand Down

0 comments on commit ca8d337

Please sign in to comment.