feat: delete zk common
diff --git a/pkg/dds/reconcile/reconciler.go b/pkg/dds/reconcile/reconciler.go
index c1fb527..9121efc 100644
--- a/pkg/dds/reconcile/reconciler.go
+++ b/pkg/dds/reconcile/reconciler.go
@@ -133,6 +133,7 @@
continue
}
+ // 如果旧版本不为空, 并且新版本和旧版本的资源是一样的, 那么以旧版本为主
if old != nil && r.equal(new.GetResources(typ), old.GetResources(typ)) {
version = old.GetVersion(typ)
}
diff --git a/pkg/plugins/common/zookeeper/connection.go b/pkg/plugins/common/zookeeper/connection.go
deleted file mode 100644
index af4cc0c..0000000
--- a/pkg/plugins/common/zookeeper/connection.go
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package zookeeper
-
-import (
- gxzookeeper "github.com/dubbogo/gost/database/kv/zk"
-)
-
-import (
- config "github.com/apache/dubbo-kubernetes/pkg/config/plugins/resources/zookeeper"
-)
-
-func ConnectToZK(cfg config.ZookeeperStoreConfig) (*gxzookeeper.ZookeeperClient, error) {
- client, err := gxzookeeper.NewZookeeperClient("default", cfg.Servers, true)
- if err != nil {
- return nil, err
- }
- return client, nil
-}
diff --git a/pkg/plugins/common/zookeeper/listener.go b/pkg/plugins/common/zookeeper/listener.go
deleted file mode 100644
index fae637d..0000000
--- a/pkg/plugins/common/zookeeper/listener.go
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package zookeeper
-
-type Listener interface {
- Notify() chan *Notification
- Error() <-chan error
- Close() error
-}
-
-// Notification represents a single notification from the database.
-type Notification struct {
- // Payload, or the empty string if unspecified.
- Payload string
-}
diff --git a/pkg/plugins/common/zookeeper/zk_listener.go b/pkg/plugins/common/zookeeper/zk_listener.go
deleted file mode 100644
index 70cc299..0000000
--- a/pkg/plugins/common/zookeeper/zk_listener.go
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package zookeeper
-
-import (
- "sync"
-)
-
-import (
- gxzookeeper "github.com/dubbogo/gost/database/kv/zk"
-
- "github.com/go-logr/logr"
-
- "go.uber.org/atomic"
-)
-
-import (
- "github.com/apache/dubbo-kubernetes/pkg/config/plugins/resources/zookeeper"
-)
-
-type zkListener struct {
- Client *gxzookeeper.ZookeeperClient
- pathMapLock sync.Mutex
- pathMap map[string]*atomic.Int32
- wg sync.WaitGroup
- err chan error
- notifications chan *Notification
- stop chan struct{}
-}
-
-func NewListener(cfg zookeeper.ZookeeperStoreConfig, log logr.Logger) (Listener, error) {
- return nil, nil
-}
-
-func (z *zkListener) Error() <-chan error {
- return z.err
-}
-
-func (z *zkListener) Notify() chan *Notification {
- return z.notifications
-}
-
-func (z *zkListener) Close() error {
- close(z.stop)
- z.wg.Wait()
- return nil
-}