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 24dc7b7c [operator] add delete resources
24dc7b7c is described below
commit 24dc7b7c9b7d09864105d89c8453caa8be316f9c
Author: mfordjody <[email protected]>
AuthorDate: Wed Jan 1 08:06:17 2025 +0800
[operator] add delete resources
---
manifests/charts/admin/values.yaml | 4 ++--
operator/pkg/uninstall/uninstaller.go | 8 ++++++--
operator/pkg/values/map.go | 9 ---------
3 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/manifests/charts/admin/values.yaml
b/manifests/charts/admin/values.yaml
index 05ee106c..a7ea529f 100644
--- a/manifests/charts/admin/values.yaml
+++ b/manifests/charts/admin/values.yaml
@@ -464,7 +464,7 @@ jaeger:
zookeeper:
## Whether to enable the zookeeper.
- enabled: false
+ enabled: true
## Override the namespace where the resource is deployed.
namespaceOverride: ~
## Labels to attach to the resource.
@@ -638,7 +638,7 @@ zookeeper:
nacos:
## Whether to enable the nacos.
- enabled: true
+ enabled: false
## Specifies the mode in which nacos is running (standalone, cluster, etc.).
mode: standalone
## Override the namespace where the resource is deployed.
diff --git a/operator/pkg/uninstall/uninstaller.go
b/operator/pkg/uninstall/uninstaller.go
index 3d63885c..82f37fde 100644
--- a/operator/pkg/uninstall/uninstaller.go
+++ b/operator/pkg/uninstall/uninstaller.go
@@ -22,7 +22,7 @@ var (
{Group: "rbac.authorization.k8s.io", Version: "v1", Kind:
"ClusterRole"},
{Group: "rbac.authorization.k8s.io", Version: "v1", Kind:
"ClusterRoleBinding"},
}
- ClusterCPResources = []schema.GroupVersionKind{
+ ClusterControlPlaneResources = []schema.GroupVersionKind{
{Group: "rbac.authorization.k8s.io", Version: "v1", Kind:
"ClusterRole"},
{Group: "rbac.authorization.k8s.io", Version: "v1", Kind:
"ClusterRoleBinding"},
}
@@ -40,7 +40,7 @@ func GetPrunedResources(kc kube.CLIClient, dopName,
dopNamespace string, include
labels[manifest.OwningResourceNamespace] = dopNamespace
}
resources := NamespacedResources()
- gvkList := append(resources, ClusterCPResources...)
+ gvkList := append(resources, ClusterControlPlaneResources...)
if includeClusterResources {
gvkList = append(resources, AllClusterResources...)
}
@@ -70,6 +70,10 @@ func GetPrunedResources(kc kube.CLIClient, dopName,
dopNamespace string, include
func NamespacedResources() []schema.GroupVersionKind {
res := []schema.GroupVersionKind{
gvk.Deployment.Kubernetes(),
+ gvk.StatefulSet.Kubernetes(),
+ gvk.Service.Kubernetes(),
+ gvk.Secret.Kubernetes(),
+ gvk.ServiceAccount.Kubernetes(),
{Group: "rbac.authorization.k8s.io", Version: "v1", Kind:
"RoleBinding"},
{Group: "rbac.authorization.k8s.io", Version: "v1", Kind:
"Role"},
}
diff --git a/operator/pkg/values/map.go b/operator/pkg/values/map.go
index e36d4310..4abcac7e 100644
--- a/operator/pkg/values/map.go
+++ b/operator/pkg/values/map.go
@@ -56,15 +56,6 @@ func fromJSON[T any](overlay []byte) (T, error) {
return *v, nil
}
-func fromYAML[T any](overlay []byte) (T, error) {
- v := new(T)
- err := yaml.Unmarshal(overlay, &v)
- if err != nil {
- return pointer.Empty[T](), err
- }
- return *v, nil
-}
-
func parsePath(key string) []string { return strings.Split(key, ".") }
func tableLookup(m Map, simple string) (Map, bool) {