This is an automated email from the ASF dual-hosted git repository.

zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new 1d6aa247 [charts] Replacement of crds (#362)
1d6aa247 is described below

commit 1d6aa24795d640eeabc3e7a483e0b0f7fcf808e5
Author: mfordjody <[email protected]>
AuthorDate: Sun Sep 22 10:04:11 2024 +0800

    [charts] Replacement of crds (#362)
---
 deploy/charts/admin/templates/admin/admin-cert.yaml          |  8 ++++----
 deploy/charts/admin/templates/admin/admin-cm.yaml            |  5 +++--
 deploy/charts/admin/templates/traffic/traffic-authority.yaml |  8 +++-----
 deploy/charts/admin/templates/traffic/traffic-rules.yaml     | 10 ++++------
 deploy/charts/admin/values.yaml                              |  1 +
 5 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/deploy/charts/admin/templates/admin/admin-cert.yaml 
b/deploy/charts/admin/templates/admin/admin-cert.yaml
index 1a85fbcf..79216d27 100644
--- a/deploy/charts/admin/templates/admin/admin-cert.yaml
+++ b/deploy/charts/admin/templates/admin/admin-cert.yaml
@@ -9,7 +9,7 @@ We only autogenerate certs if the cert is not yet generated. 
This way we keep th
 */}}
 {{- $admin := .Values -}}
 {{- if not (eq (empty $admin.cp.tls.caBundle) (empty 
$admin.cp.tls.secretName)) }}
-  {{ print "You need to send both or neither of 
controlPlane.tls.general.caBundle and controlPlane.tls.general.secretName"}}
+  {{ fail "You need to send both or neither of 
controlPlane.tls.general.caBundle and controlPlane.tls.general.secretName"}}
 {{- end }}
 {{- $caBundle := $admin.cp.tls.caBundle }}
 {{- $namespace := include "admin.namespace" . -}}
@@ -23,12 +23,12 @@ We only autogenerate certs if the cert is not yet 
generated. This way we keep th
   {{- $key = index $secret.data "tls.key" -}}
   {{- $caBundle = index $secret.data "ca.crt" -}}
 {{- else -}}
-  {{- $commonName := (include "admin.name" .) -}}
-  {{- $altNames := list (printf "%s.%s" $commonName $namespace) (printf 
"%s.%s.svc" $commonName $namespace) -}}
+  {{- $name := (include "admin.name" .) -}}
+  {{- $altNames := list (printf "%s.%s" $name $namespace) (printf "%s.%s.svc" 
$name $namespace) -}}
   {{- $certTTL := 3650 -}}
   {{- $ca := genCA "dubbo-ca" $certTTL -}}
 
-  {{- $genCert := genSignedCert $commonName nil $altNames $certTTL $ca -}}
+  {{- $genCert := genSignedCert $name nil $altNames $certTTL $ca -}}
   {{- $cert = $genCert.Cert | b64enc -}}
   {{- $key = $genCert.Key | b64enc -}}
   {{ $caBundle = $ca.Cert | b64enc }}
diff --git a/deploy/charts/admin/templates/admin/admin-cm.yaml 
b/deploy/charts/admin/templates/admin/admin-cm.yaml
index 3b6a2ad6..c955420a 100644
--- a/deploy/charts/admin/templates/admin/admin-cm.yaml
+++ b/deploy/charts/admin/templates/admin/admin-cm.yaml
@@ -11,7 +11,8 @@ metadata:
   {{- toYaml . | nindent 4 }}
   {{- end }}
 data:
-  config.yaml: |
-    {{ if $admin.cp }}
+  {{/* TODO */}}
+  config.yaml: |-
+    {{- if $admin.cp }}
     {{ toYaml $admin.cp | nindent 4 | trim }}
     {{ end }}
diff --git a/deploy/charts/admin/templates/traffic/traffic-authority.yaml 
b/deploy/charts/admin/templates/traffic/traffic-authority.yaml
index 2e5fcd41..42a85117 100644
--- a/deploy/charts/admin/templates/traffic/traffic-authority.yaml
+++ b/deploy/charts/admin/templates/traffic/traffic-authority.yaml
@@ -1,6 +1,4 @@
-{{- $auth := .Values.auth -}}
-{{- $authz := .Values.auth.authorization -}}
-{{- $authc := .Values.auth.authentication -}}
+{{- $auth := .Values.auth -}}{{- $authz := $auth.authorization -}}{{- $authc 
:= $auth.authentication -}}
 {{- if $auth.enabled }}
 apiVersion: v1
 kind: ServiceAccount
@@ -33,7 +31,7 @@ subjects:
     name: {{ template "cp.name" . }}-sa
     namespace: {{ template "system.namespaces" . }}
 ---
-apiVersion: dubbo.apache.org/v1alpha1
+apiVersion: dubbo.io/v1alpha1
 kind: AuthenticationPolicy
 metadata:
   name: {{ template "cp.name" . }}-authentication
@@ -45,7 +43,7 @@ spec:
   selector:
     - namespaces: ["dubbo-system"]
 ---
-apiVersion: dubbo.apache.org/v1alpha1
+apiVersion: dubbo.io/v1alpha1
 kind: AuthorizationPolicy
 metadata:
   name: {{ template "cp.name" . }}-authorization
diff --git a/deploy/charts/admin/templates/traffic/traffic-rules.yaml 
b/deploy/charts/admin/templates/traffic/traffic-rules.yaml
index 9243da8e..d972a66d 100644
--- a/deploy/charts/admin/templates/traffic/traffic-rules.yaml
+++ b/deploy/charts/admin/templates/traffic/traffic-rules.yaml
@@ -1,7 +1,5 @@
-{{- $tr := .Values.traffic.tagRoute -}}
-{{- $dc := .Values.traffic.dynamicConfig -}}
-{{- $cr := .Values.traffic.conditionRoute -}}
-apiVersion: dubbo.apache.org/v1alpha1
+{{- $traffic := .Values.traffic -}}{{- $tr := $traffic.tagRoute -}}{{- $dc := 
$traffic.dynamicConfig -}}{{- $cr := $traffic.conditionRoute -}}
+apiVersion: dubbo.io/v1alpha1
 kind: ConditionRoute
 metadata:
   name: {{ template "cp.name" . }}-conditionroute
@@ -17,7 +15,7 @@ spec:
   conditions:
   - {{ $cr.conditions }}
 ---
-apiVersion: dubbo.apache.org/v1alpha1
+apiVersion: dubbo.io/v1alpha1
 kind: DynamicConfig
 metadata:
   name: {{ template "cp.name" . }}-dynamicconfig
@@ -33,7 +31,7 @@ spec:
         oneof:
         - exact: {{ $dc.exact }}
 ---
-apiVersion: dubbo.apache.org/v1alpha1
+apiVersion: dubbo.io/v1alpha1
 kind: TagRoute
 metadata:
   name: {{ template "cp.name" . }}-tagroute
diff --git a/deploy/charts/admin/values.yaml b/deploy/charts/admin/values.yaml
index bb506580..8402acce 100644
--- a/deploy/charts/admin/values.yaml
+++ b/deploy/charts/admin/values.yaml
@@ -315,6 +315,7 @@ jobs:
     # Image pull policy, available options are: Always, IfNotPresent, Never.
     pullPolicy: IfNotPresent
 
+## TODO
 cp:
  mode: universal
  topology: zone

Reply via email to