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 63ab4eba [sail] Revised final naming and added log output (#789)
63ab4eba is described below

commit 63ab4eba2258e3d3782297339235684319f41708
Author: Jian Zhong <[email protected]>
AuthorDate: Fri Sep 19 20:48:34 2025 +0800

    [sail] Revised final naming and added log output (#789)
---
 README.md                                          |  2 +-
 manifests/charts/base/files/crd-all.yaml           | 14 +++++++-------
 pkg/config/model.go                                |  2 +-
 pkg/kube/kclient/client.go                         |  2 +-
 pkg/kube/util.go                                   |  2 +-
 pkg/{ship-agent => sail-agent}/agent.go            |  0
 .../ship-agent => sail/cmd/sail-agent}/app/cmd.go  |  8 ++++----
 .../ship-agent => sail/cmd/sail-agent}/app/wait.go |  0
 .../cmd/ship-agent => sail/cmd/sail-agent}/main.go |  2 +-
 .../cmd/sail-agent}/options/agent_proxy.go         |  4 ++--
 .../cmd/sail-discovery}/app/cmd.go                 | 18 ++++++++++--------
 .../cmd/sail-discovery}/main.go                    |  2 +-
 {ship => sail}/pkg/bootstrap/ca.go                 |  2 +-
 {ship => sail}/pkg/bootstrap/certcontroller.go     |  4 ++--
 {ship => sail}/pkg/bootstrap/configcontroller.go   |  0
 {ship => sail}/pkg/bootstrap/mesh.go               | 12 ++++++------
 {ship => sail}/pkg/bootstrap/options.go            | 10 +++++-----
 {ship => sail}/pkg/bootstrap/server.go             | 22 +++++++++++-----------
 {ship => sail}/pkg/bootstrap/util.go               |  2 +-
 {ship => sail}/pkg/features/security.go            |  0
 {ship => sail}/pkg/features/ship.go                |  0
 {ship => sail}/pkg/features/tuning.go              |  0
 {ship => sail}/pkg/features/xds.go                 |  0
 {ship => sail}/pkg/keycertbundle/watcher.go        |  0
 {ship => sail}/pkg/model/context.go                |  2 +-
 {ship => sail}/pkg/model/push_context.go           |  0
 {ship => sail}/pkg/model/typed_xds_cache.go        |  0
 {ship => sail}/pkg/model/xds_cache.go              |  2 +-
 {ship => sail}/pkg/server/instance.go              |  0
 .../serviceregistry/kube/controller/controller.go  |  0
 .../pkg/serviceregistry/providers/providers.go     |  0
 {ship => sail}/pkg/trustbundle/trustbundle.go      |  0
 {ship => sail}/pkg/util/protoconv/protoconv.go     |  2 +-
 {ship => sail}/pkg/xds/ads.go                      |  2 +-
 {ship => sail}/pkg/xds/discovery.go                |  2 +-
 {ship => sail}/pkg/xds/pushqueue.go                |  2 +-
 security/pkg/pki/ca/ca.go                          | 14 +++++++++++---
 37 files changed, 72 insertions(+), 62 deletions(-)

diff --git a/README.md b/README.md
index 59ba4a1f..44663ae1 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ The main repositories of Dubbo on Kubernetes include:
 
 - **dubboctl** — The command-line management tool that provides control plane 
management, development framework scaffolding, and application deployment.
 - **dubbod** — The dubbo control plane. It is built on Istio to implement a 
proxyless service mesh and includes the following components:
-  - **Ship** - (under development): Runtime proxy configuration.
+  - **Sail** - (under development): Runtime proxy configuration.
   - **Aegis** - (under development): Certificate issuance and rotation.
   - **Gear** - (under development): Validation, aggregation, transformation, 
and distribution of Dubbo configuration.
 - **operator**: Provides user-friendly options to operate the Dubbo proxyless 
service mesh.
diff --git a/manifests/charts/base/files/crd-all.yaml 
b/manifests/charts/base/files/crd-all.yaml
index ae43f41f..e4fe13f6 100644
--- a/manifests/charts/base/files/crd-all.yaml
+++ b/manifests/charts/base/files/crd-all.yaml
@@ -20,7 +20,7 @@ metadata:
   annotations:
     "helm.sh/resource-policy": keep
   labels:
-    app: dubbo-ship
+    app: dubbo-sail
     chart: dubbo
     heritage: Tiller
     release: dubbo
@@ -5860,7 +5860,7 @@ metadata:
   annotations:
     "helm.sh/resource-policy": keep
   labels:
-    app: dubbo-ship
+    app: dubbo-sail
     chart: dubbo
     heritage: Tiller
     dubbo: security
@@ -6625,7 +6625,7 @@ metadata:
   annotations:
     "helm.sh/resource-policy": keep
   labels:
-    app: dubbo-ship
+    app: dubbo-sail
     chart: dubbo
     heritage: Tiller
     dubbo: security
@@ -6976,7 +6976,7 @@ metadata:
   annotations:
     "helm.sh/resource-policy": keep
   labels:
-    app: dubbo-ship
+    app: dubbo-sail
     chart: dubbo
     heritage: Tiller
     dubbo: security
@@ -7098,7 +7098,7 @@ spec:
                         type: string
                       timeout:
                         description: The maximum amount of time that the 
resolver, determined
-                          by the ship_JWT_ENABLE_REMOTE_JWKS environment 
variable,
+                          by the sail_JWT_ENABLE_REMOTE_JWKS environment 
variable,
                           will spend waiting for the JWKS to be fetched.
                         type: string
                         x-kubernetes-validations:
@@ -7378,7 +7378,7 @@ spec:
                         type: string
                       timeout:
                         description: The maximum amount of time that the 
resolver, determined
-                          by the ship_JWT_ENABLE_REMOTE_JWKS environment 
variable,
+                          by the sail_JWT_ENABLE_REMOTE_JWKS environment 
variable,
                           will spend waiting for the JWKS to be fetched.
                         type: string
                         x-kubernetes-validations:
@@ -7563,7 +7563,7 @@ metadata:
   annotations:
     "helm.sh/resource-policy": keep
   labels:
-    app: dubbo-ship
+    app: dubbo-sail
     chart: dubbo
     heritage: Tiller
     release: dubbo
diff --git a/pkg/config/model.go b/pkg/config/model.go
index bc46e3eb..76e8265a 100644
--- a/pkg/config/model.go
+++ b/pkg/config/model.go
@@ -43,7 +43,7 @@ import (
        "github.com/apache/dubbo-kubernetes/pkg/util/protomarshal"
        "github.com/apache/dubbo-kubernetes/pkg/util/sets"
        "github.com/apache/dubbo-kubernetes/pkg/util/slices"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/util/protoconv"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/util/protoconv"
        "istio.io/api/label"
 )
 
diff --git a/pkg/kube/kclient/client.go b/pkg/kube/kclient/client.go
index d4943c82..8ee75959 100644
--- a/pkg/kube/kclient/client.go
+++ b/pkg/kube/kclient/client.go
@@ -30,7 +30,7 @@ import (
        "github.com/apache/dubbo-kubernetes/pkg/ptr"
        "github.com/apache/dubbo-kubernetes/pkg/util/sets"
        "github.com/apache/dubbo-kubernetes/pkg/util/slices"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/features"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/features"
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
        klabels "k8s.io/apimachinery/pkg/labels"
        "k8s.io/apimachinery/pkg/runtime/schema"
diff --git a/pkg/kube/util.go b/pkg/kube/util.go
index e0f4536c..6491fac0 100644
--- a/pkg/kube/util.go
+++ b/pkg/kube/util.go
@@ -18,7 +18,7 @@
 package kube
 
 import (
-       "github.com/apache/dubbo-kubernetes/ship/pkg/features"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/features"
        corev1 "k8s.io/api/core/v1"
        "k8s.io/apimachinery/pkg/runtime"
        "k8s.io/apimachinery/pkg/runtime/serializer"
diff --git a/pkg/ship-agent/agent.go b/pkg/sail-agent/agent.go
similarity index 100%
rename from pkg/ship-agent/agent.go
rename to pkg/sail-agent/agent.go
diff --git a/ship/cmd/ship-agent/app/cmd.go b/sail/cmd/sail-agent/app/cmd.go
similarity index 93%
rename from ship/cmd/ship-agent/app/cmd.go
rename to sail/cmd/sail-agent/app/cmd.go
index 142e5a66..2356cbe9 100644
--- a/ship/cmd/ship-agent/app/cmd.go
+++ b/sail/cmd/sail-agent/app/cmd.go
@@ -22,7 +22,7 @@ import (
        "github.com/apache/dubbo-kubernetes/pkg/cmd"
        "github.com/apache/dubbo-kubernetes/pkg/config/constants"
        "github.com/apache/dubbo-kubernetes/pkg/model"
-       "github.com/apache/dubbo-kubernetes/ship/cmd/ship-agent/options"
+       "github.com/apache/dubbo-kubernetes/sail/cmd/sail-agent/options"
        "github.com/spf13/cobra"
 )
 
@@ -32,9 +32,9 @@ var (
 
 func NewRootCommand() *cobra.Command {
        rootCmd := &cobra.Command{
-               Use:          "ship-agent",
-               Short:        "Dubbo Ship agent.",
-               Long:         "Dubbo Ship agent runs in the sidecar or gateway 
container and bootstraps Envoy.",
+               Use:          "sail-agent",
+               Short:        "Dubbo Sail agent.",
+               Long:         "Dubbo Sail agent runs in the sidecar or gateway 
container and bootstraps Envoy.",
                SilenceUsage: true,
                FParseErrWhitelist: cobra.FParseErrWhitelist{
                        // Allow unknown flags for backward-compatibility.
diff --git a/ship/cmd/ship-agent/app/wait.go b/sail/cmd/sail-agent/app/wait.go
similarity index 100%
rename from ship/cmd/ship-agent/app/wait.go
rename to sail/cmd/sail-agent/app/wait.go
diff --git a/ship/cmd/ship-agent/main.go b/sail/cmd/sail-agent/main.go
similarity index 93%
rename from ship/cmd/ship-agent/main.go
rename to sail/cmd/sail-agent/main.go
index 848c1e63..cf80f16d 100644
--- a/ship/cmd/ship-agent/main.go
+++ b/sail/cmd/sail-agent/main.go
@@ -18,7 +18,7 @@
 package main
 
 import (
-       "github.com/apache/dubbo-kubernetes/ship/cmd/ship-agent/app"
+       "github.com/apache/dubbo-kubernetes/sail/cmd/sail-agent/app"
        "os"
 )
 
diff --git a/ship/cmd/ship-agent/options/agent_proxy.go 
b/sail/cmd/sail-agent/options/agent_proxy.go
similarity index 92%
rename from ship/cmd/ship-agent/options/agent_proxy.go
rename to sail/cmd/sail-agent/options/agent_proxy.go
index 51bb9f64..d962ea57 100644
--- a/ship/cmd/ship-agent/options/agent_proxy.go
+++ b/sail/cmd/sail-agent/options/agent_proxy.go
@@ -17,11 +17,11 @@
 
 package options
 
-import shipagent "github.com/apache/dubbo-kubernetes/pkg/ship-agent"
+import sailagent "github.com/apache/dubbo-kubernetes/pkg/sail-agent"
 
 // ProxyArgs provides all of the configuration parameters for the Saku proxy.
 type ProxyArgs struct {
-       shipagent.Proxy
+       sailagent.Proxy
        MeshConfigFile string
        ServiceCluster string
 }
diff --git a/ship/cmd/ship-discovery/app/cmd.go 
b/sail/cmd/sail-discovery/app/cmd.go
similarity index 89%
rename from ship/cmd/ship-discovery/app/cmd.go
rename to sail/cmd/sail-discovery/app/cmd.go
index 5fd212e5..e4ff4834 100644
--- a/ship/cmd/ship-discovery/app/cmd.go
+++ b/sail/cmd/sail-discovery/app/cmd.go
@@ -22,21 +22,21 @@ import (
        "github.com/apache/dubbo-kubernetes/pkg/cmd"
        "github.com/apache/dubbo-kubernetes/pkg/config/constants"
        "github.com/apache/dubbo-kubernetes/pkg/ctrlz"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/bootstrap"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/features"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/serviceregistry/providers"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/bootstrap"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/features"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/serviceregistry/providers"
        "github.com/spf13/cobra"
 )
 
 var (
-       serverArgs *bootstrap.ShipArgs
+       serverArgs *bootstrap.SailArgs
 )
 
 func NewRootCommand() *cobra.Command {
        rootCmd := &cobra.Command{
-               Use:          "ship-discovery",
-               Short:        "Dubbo Ship.",
-               Long:         "Dubbo Ship provides mesh-wide traffic 
management, security and policy capabilities in the Dubbo Service Mesh.",
+               Use:          "sail-discovery",
+               Short:        "Dubbo Sail.",
+               Long:         "Dubbo Sail provides mesh-wide traffic 
management, security and policy capabilities in the Dubbo Service Mesh.",
                SilenceUsage: true,
                FParseErrWhitelist: cobra.FParseErrWhitelist{
                        // Allow unknown flags for backward-compatibility.
@@ -84,7 +84,7 @@ func newDiscoveryCommand() *cobra.Command {
 }
 
 func addFlags(c *cobra.Command) {
-       serverArgs = bootstrap.NewShipArgs(func(p *bootstrap.ShipArgs) {
+       serverArgs = bootstrap.NewSailArgs(func(p *bootstrap.SailArgs) {
                p.CtrlZOptions = ctrlz.DefaultOptions()
        })
        
c.PersistentFlags().StringSliceVar(&serverArgs.RegistryOptions.Registries, 
"registries",
@@ -97,6 +97,8 @@ func addFlags(c *cobra.Command) {
                "Use a Kubernetes configuration file instead of in-cluster 
configuration")
        c.PersistentFlags().StringVar(&serverArgs.MeshConfigFile, "meshConfig", 
"./etc/dubbo/config/mesh",
                "File name for Dubbo mesh configuration. If not specified, a 
default mesh will be used.")
+       c.PersistentFlags().StringVar(&serverArgs.NetworksConfigFile, 
"networksConfig", "./etc/dubbo/config/meshNetworks",
+               "File name for Dubbo mesh networks configuration. If not 
specified, a default mesh networks will be used.")
        
c.PersistentFlags().Float32Var(&serverArgs.RegistryOptions.KubeOptions.KubernetesAPIQPS,
 "kubernetesApiQPS", 80.0,
                "Maximum QPS when communicating with the kubernetes API")
        
c.PersistentFlags().IntVar(&serverArgs.RegistryOptions.KubeOptions.KubernetesAPIBurst,
 "kubernetesApiBurst", 160,
diff --git a/ship/cmd/ship-discovery/main.go b/sail/cmd/sail-discovery/main.go
similarity index 93%
rename from ship/cmd/ship-discovery/main.go
rename to sail/cmd/sail-discovery/main.go
index 40bec04d..e6d52203 100644
--- a/ship/cmd/ship-discovery/main.go
+++ b/sail/cmd/sail-discovery/main.go
@@ -18,7 +18,7 @@
 package main
 
 import (
-       "github.com/apache/dubbo-kubernetes/ship/cmd/ship-discovery/app"
+       "github.com/apache/dubbo-kubernetes/sail/cmd/sail-discovery/app"
        "os"
 )
 
diff --git a/ship/pkg/bootstrap/ca.go b/sail/pkg/bootstrap/ca.go
similarity index 99%
rename from ship/pkg/bootstrap/ca.go
rename to sail/pkg/bootstrap/ca.go
index 3a329bcb..0ad04100 100644
--- a/ship/pkg/bootstrap/ca.go
+++ b/sail/pkg/bootstrap/ca.go
@@ -24,11 +24,11 @@ import (
        "github.com/apache/dubbo-kubernetes/pkg/config/constants"
        "github.com/apache/dubbo-kubernetes/pkg/env"
        "github.com/apache/dubbo-kubernetes/pkg/security"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/features"
        "github.com/apache/dubbo-kubernetes/security/pkg/cmd"
        "github.com/apache/dubbo-kubernetes/security/pkg/pki/ca"
        "github.com/apache/dubbo-kubernetes/security/pkg/pki/ra"
        caserver "github.com/apache/dubbo-kubernetes/security/pkg/server/ca"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/features"
        "github.com/fsnotify/fsnotify"
        "k8s.io/apimachinery/pkg/api/errors"
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/ship/pkg/bootstrap/certcontroller.go 
b/sail/pkg/bootstrap/certcontroller.go
similarity index 93%
rename from ship/pkg/bootstrap/certcontroller.go
rename to sail/pkg/bootstrap/certcontroller.go
index a65a406c..b0d28690 100644
--- a/ship/pkg/bootstrap/certcontroller.go
+++ b/sail/pkg/bootstrap/certcontroller.go
@@ -18,8 +18,8 @@
 package bootstrap
 
 import (
-       "github.com/apache/dubbo-kubernetes/ship/pkg/features"
-       tb "github.com/apache/dubbo-kubernetes/ship/pkg/trustbundle"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/features"
+       tb "github.com/apache/dubbo-kubernetes/sail/pkg/trustbundle"
        "k8s.io/klog/v2"
 )
 
diff --git a/ship/pkg/bootstrap/configcontroller.go 
b/sail/pkg/bootstrap/configcontroller.go
similarity index 100%
rename from ship/pkg/bootstrap/configcontroller.go
rename to sail/pkg/bootstrap/configcontroller.go
diff --git a/ship/pkg/bootstrap/mesh.go b/sail/pkg/bootstrap/mesh.go
similarity index 91%
rename from ship/pkg/bootstrap/mesh.go
rename to sail/pkg/bootstrap/mesh.go
index c3e60b7e..1121cafa 100644
--- a/ship/pkg/bootstrap/mesh.go
+++ b/sail/pkg/bootstrap/mesh.go
@@ -24,7 +24,7 @@ import (
        "github.com/apache/dubbo-kubernetes/pkg/filewatcher"
        "github.com/apache/dubbo-kubernetes/pkg/kube/krt"
        "github.com/apache/dubbo-kubernetes/pkg/ptr"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/features"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/features"
        "k8s.io/klog/v2"
        "os"
        "sigs.k8s.io/yaml"
@@ -34,7 +34,7 @@ const (
        defaultMeshConfigMapName = "dubbo"
 )
 
-func (s *Server) initMeshConfiguration(args *ShipArgs, fileWatcher 
filewatcher.FileWatcher) {
+func (s *Server) initMeshConfiguration(args *SailArgs, fileWatcher 
filewatcher.FileWatcher) {
        klog.Infof("initializing mesh configuration %v", args.MeshConfigFile)
        col := s.getMeshConfiguration(args, fileWatcher)
        col.AsCollection().WaitUntilSynced(s.internalStop)
@@ -44,7 +44,7 @@ func (s *Server) initMeshConfiguration(args *ShipArgs, 
fileWatcher filewatcher.F
        klog.Infof("flags: \n%s", argsdump)
 }
 
-func (s *Server) initMeshNetworks(args *ShipArgs, fileWatcher 
filewatcher.FileWatcher) {
+func (s *Server) initMeshNetworks(args *SailArgs, fileWatcher 
filewatcher.FileWatcher) {
        klog.Infof("initializing mesh networks configuration %v", 
args.NetworksConfigFile)
        col := s.getMeshNetworks(args, fileWatcher)
        col.AsCollection().WaitUntilSynced(s.internalStop)
@@ -52,7 +52,7 @@ func (s *Server) initMeshNetworks(args *ShipArgs, fileWatcher 
filewatcher.FileWa
        klog.Infof("mesh networks configuration: %s", 
meshwatcher.PrettyFormatOfMeshNetworks(s.environment.MeshNetworks()))
 }
 
-func (s *Server) getMeshNetworks(args *ShipArgs, fileWatcher 
filewatcher.FileWatcher) krt.Singleton[meshwatcher.MeshNetworksResource] {
+func (s *Server) getMeshNetworks(args *SailArgs, fileWatcher 
filewatcher.FileWatcher) krt.Singleton[meshwatcher.MeshNetworksResource] {
        // We need to get mesh networks up-front, before we start anything, so 
we use internalStop rather than scheduling a task to run
        // later.
        opts := krt.NewOptionsBuilder(s.internalStop, "", args.KrtDebugger)
@@ -63,7 +63,7 @@ func (s *Server) getMeshNetworks(args *ShipArgs, fileWatcher 
filewatcher.FileWat
        return meshwatcher.NewNetworksCollection(opts, sources...)
 }
 
-func (s *Server) getMeshConfiguration(args *ShipArgs, fileWatcher 
filewatcher.FileWatcher) krt.Singleton[meshwatcher.MeshConfigResource] {
+func (s *Server) getMeshConfiguration(args *SailArgs, fileWatcher 
filewatcher.FileWatcher) krt.Singleton[meshwatcher.MeshConfigResource] {
        opts := krt.NewOptionsBuilder(s.internalStop, "", args.KrtDebugger)
        sources := s.getConfigurationSources(args, fileWatcher, 
args.MeshConfigFile, kubemesh.MeshConfigKey)
        if len(sources) == 0 {
@@ -72,7 +72,7 @@ func (s *Server) getMeshConfiguration(args *ShipArgs, 
fileWatcher filewatcher.Fi
        return meshwatcher.NewCollection(opts, sources...)
 }
 
-func (s *Server) getConfigurationSources(args *ShipArgs, fileWatcher 
filewatcher.FileWatcher, file string, cmKey string) 
[]meshwatcher.MeshConfigSource {
+func (s *Server) getConfigurationSources(args *SailArgs, fileWatcher 
filewatcher.FileWatcher, file string, cmKey string) 
[]meshwatcher.MeshConfigSource {
        opts := krt.NewOptionsBuilder(s.internalStop, "", args.KrtDebugger)
        var userMeshConfig *meshwatcher.MeshConfigSource
        if features.SharedMeshConfig != "" && s.kubeClient != nil {
diff --git a/ship/pkg/bootstrap/options.go b/sail/pkg/bootstrap/options.go
similarity index 91%
rename from ship/pkg/bootstrap/options.go
rename to sail/pkg/bootstrap/options.go
index ed369f2a..83c9baaa 100644
--- a/ship/pkg/bootstrap/options.go
+++ b/sail/pkg/bootstrap/options.go
@@ -23,7 +23,7 @@ import (
        "github.com/apache/dubbo-kubernetes/pkg/env"
        "github.com/apache/dubbo-kubernetes/pkg/keepalive"
        "github.com/apache/dubbo-kubernetes/pkg/kube/krt"
-       kubecontroller 
"github.com/apache/dubbo-kubernetes/ship/pkg/serviceregistry/kube/controller"
+       kubecontroller 
"github.com/apache/dubbo-kubernetes/sail/pkg/serviceregistry/kube/controller"
 )
 
 var (
@@ -39,7 +39,7 @@ type RegistryOptions struct {
        ClusterRegistriesNamespace string
 }
 
-type ShipArgs struct {
+type SailArgs struct {
        ServerOptions      DiscoveryServerOptions
        RegistryOptions    RegistryOptions
        MeshConfigFile     string
@@ -58,8 +58,8 @@ type DiscoveryServerOptions struct {
        SecureGRPCAddr string
 }
 
-func NewShipArgs(initFuncs ...func(*ShipArgs)) *ShipArgs {
-       p := &ShipArgs{}
+func NewSailArgs(initFuncs ...func(*SailArgs)) *SailArgs {
+       p := &SailArgs{}
 
        // Apply Default Values.
        p.applyDefaults()
@@ -72,7 +72,7 @@ func NewShipArgs(initFuncs ...func(*ShipArgs)) *ShipArgs {
        return p
 }
 
-func (p *ShipArgs) applyDefaults() {
+func (p *SailArgs) applyDefaults() {
        p.Namespace = PodNamespace
        p.PodName = PodName
        p.KeepaliveOptions = keepalive.DefaultOption()
diff --git a/ship/pkg/bootstrap/server.go b/sail/pkg/bootstrap/server.go
similarity index 95%
rename from ship/pkg/bootstrap/server.go
rename to sail/pkg/bootstrap/server.go
index fb7aba8b..00e4a551 100644
--- a/ship/pkg/bootstrap/server.go
+++ b/sail/pkg/bootstrap/server.go
@@ -30,15 +30,15 @@ import (
        "github.com/apache/dubbo-kubernetes/pkg/kube/kclient"
        "github.com/apache/dubbo-kubernetes/pkg/kube/namespace"
        "github.com/apache/dubbo-kubernetes/pkg/network"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/features"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/keycertbundle"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/model"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/server"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/serviceregistry/providers"
+       tb "github.com/apache/dubbo-kubernetes/sail/pkg/trustbundle"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/xds"
        "github.com/apache/dubbo-kubernetes/security/pkg/pki/ca"
        "github.com/apache/dubbo-kubernetes/security/pkg/pki/ra"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/features"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/keycertbundle"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/model"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/server"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/serviceregistry/providers"
-       tb "github.com/apache/dubbo-kubernetes/ship/pkg/trustbundle"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/xds"
        "github.com/fsnotify/fsnotify"
        "golang.org/x/net/http2"
        "google.golang.org/grpc"
@@ -80,7 +80,7 @@ type Server struct {
        dubbodCertBundleWatcher *keycertbundle.Watcher
 }
 
-func NewServer(args *ShipArgs, initFuncs ...func(*Server)) (*Server, error) {
+func NewServer(args *SailArgs, initFuncs ...func(*Server)) (*Server, error) {
        e := model.NewEnvironment()
        s := &Server{
                environment:  e,
@@ -206,7 +206,7 @@ func (s *Server) Start(stop <-chan struct{}) error {
        return nil
 }
 
-func (s *Server) initKubeClient(args *ShipArgs) error {
+func (s *Server) initKubeClient(args *SailArgs) error {
        if s.kubeClient != nil {
                // Already initialized by startup arguments
                return nil
@@ -252,7 +252,7 @@ func (s *Server) initKubeClient(args *ShipArgs) error {
        return nil
 }
 
-func (s *Server) initServers(args *ShipArgs) {
+func (s *Server) initServers(args *SailArgs) {
        s.initGrpcServer(args.KeepaliveOptions)
        multiplexGRPC := false
        if args.ServerOptions.GRPCAddr != "" {
@@ -333,7 +333,7 @@ func (s *Server) maybeCreateCA(caOpts *caOptions) error {
        return nil
 }
 
-func getClusterID(args *ShipArgs) cluster.ID {
+func getClusterID(args *SailArgs) cluster.ID {
        clusterID := args.RegistryOptions.KubeOptions.ClusterID
        if clusterID == "" {
                if hasKubeRegistry(args.RegistryOptions.Registries) {
diff --git a/ship/pkg/bootstrap/util.go b/sail/pkg/bootstrap/util.go
similarity index 94%
rename from ship/pkg/bootstrap/util.go
rename to sail/pkg/bootstrap/util.go
index ab98d090..a4519a93 100644
--- a/ship/pkg/bootstrap/util.go
+++ b/sail/pkg/bootstrap/util.go
@@ -18,7 +18,7 @@
 package bootstrap
 
 import (
-       "github.com/apache/dubbo-kubernetes/ship/pkg/serviceregistry/providers"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/serviceregistry/providers"
 )
 
 func hasKubeRegistry(registries []string) bool {
diff --git a/ship/pkg/features/security.go b/sail/pkg/features/security.go
similarity index 100%
rename from ship/pkg/features/security.go
rename to sail/pkg/features/security.go
diff --git a/ship/pkg/features/ship.go b/sail/pkg/features/ship.go
similarity index 100%
rename from ship/pkg/features/ship.go
rename to sail/pkg/features/ship.go
diff --git a/ship/pkg/features/tuning.go b/sail/pkg/features/tuning.go
similarity index 100%
rename from ship/pkg/features/tuning.go
rename to sail/pkg/features/tuning.go
diff --git a/ship/pkg/features/xds.go b/sail/pkg/features/xds.go
similarity index 100%
rename from ship/pkg/features/xds.go
rename to sail/pkg/features/xds.go
diff --git a/ship/pkg/keycertbundle/watcher.go 
b/sail/pkg/keycertbundle/watcher.go
similarity index 100%
rename from ship/pkg/keycertbundle/watcher.go
rename to sail/pkg/keycertbundle/watcher.go
diff --git a/ship/pkg/model/context.go b/sail/pkg/model/context.go
similarity index 98%
rename from ship/pkg/model/context.go
rename to sail/pkg/model/context.go
index 0c4dc245..626c78d3 100644
--- a/ship/pkg/model/context.go
+++ b/sail/pkg/model/context.go
@@ -22,7 +22,7 @@ import (
        "github.com/apache/dubbo-kubernetes/pkg/config/host"
        "github.com/apache/dubbo-kubernetes/pkg/config/mesh"
        "github.com/apache/dubbo-kubernetes/pkg/config/mesh/meshwatcher"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/features"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/features"
        meshconfig "istio.io/api/mesh/v1alpha1"
        "net"
        "strconv"
diff --git a/ship/pkg/model/push_context.go b/sail/pkg/model/push_context.go
similarity index 100%
rename from ship/pkg/model/push_context.go
rename to sail/pkg/model/push_context.go
diff --git a/ship/pkg/model/typed_xds_cache.go 
b/sail/pkg/model/typed_xds_cache.go
similarity index 100%
rename from ship/pkg/model/typed_xds_cache.go
rename to sail/pkg/model/typed_xds_cache.go
diff --git a/ship/pkg/model/xds_cache.go b/sail/pkg/model/xds_cache.go
similarity index 95%
rename from ship/pkg/model/xds_cache.go
rename to sail/pkg/model/xds_cache.go
index 972f390e..7ebeee13 100644
--- a/ship/pkg/model/xds_cache.go
+++ b/sail/pkg/model/xds_cache.go
@@ -18,7 +18,7 @@
 package model
 
 import (
-       "github.com/apache/dubbo-kubernetes/ship/pkg/features"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/features"
 )
 
 type XdsCache interface{}
diff --git a/ship/pkg/server/instance.go b/sail/pkg/server/instance.go
similarity index 100%
rename from ship/pkg/server/instance.go
rename to sail/pkg/server/instance.go
diff --git a/ship/pkg/serviceregistry/kube/controller/controller.go 
b/sail/pkg/serviceregistry/kube/controller/controller.go
similarity index 100%
rename from ship/pkg/serviceregistry/kube/controller/controller.go
rename to sail/pkg/serviceregistry/kube/controller/controller.go
diff --git a/ship/pkg/serviceregistry/providers/providers.go 
b/sail/pkg/serviceregistry/providers/providers.go
similarity index 100%
rename from ship/pkg/serviceregistry/providers/providers.go
rename to sail/pkg/serviceregistry/providers/providers.go
diff --git a/ship/pkg/trustbundle/trustbundle.go 
b/sail/pkg/trustbundle/trustbundle.go
similarity index 100%
rename from ship/pkg/trustbundle/trustbundle.go
rename to sail/pkg/trustbundle/trustbundle.go
diff --git a/ship/pkg/util/protoconv/protoconv.go 
b/sail/pkg/util/protoconv/protoconv.go
similarity index 97%
rename from ship/pkg/util/protoconv/protoconv.go
rename to sail/pkg/util/protoconv/protoconv.go
index 3f9c048f..d9cab2b6 100644
--- a/ship/pkg/util/protoconv/protoconv.go
+++ b/sail/pkg/util/protoconv/protoconv.go
@@ -18,7 +18,7 @@
 package protoconv
 
 import (
-       "github.com/apache/dubbo-kubernetes/ship/pkg/features"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/features"
        "google.golang.org/protobuf/proto"
        "google.golang.org/protobuf/types/known/anypb"
 )
diff --git a/ship/pkg/xds/ads.go b/sail/pkg/xds/ads.go
similarity index 96%
rename from ship/pkg/xds/ads.go
rename to sail/pkg/xds/ads.go
index 7a717a78..5a71bd04 100644
--- a/ship/pkg/xds/ads.go
+++ b/sail/pkg/xds/ads.go
@@ -19,7 +19,7 @@ package xds
 
 import (
        "github.com/apache/dubbo-kubernetes/pkg/xds"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/model"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/model"
        core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
        discovery 
"github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
 )
diff --git a/ship/pkg/xds/discovery.go b/sail/pkg/xds/discovery.go
similarity index 97%
rename from ship/pkg/xds/discovery.go
rename to sail/pkg/xds/discovery.go
index 0f136645..9b51f9e5 100644
--- a/ship/pkg/xds/discovery.go
+++ b/sail/pkg/xds/discovery.go
@@ -20,7 +20,7 @@ package xds
 import (
        "github.com/apache/dubbo-kubernetes/pkg/cluster"
        "github.com/apache/dubbo-kubernetes/pkg/kube/krt"
-       "github.com/apache/dubbo-kubernetes/ship/pkg/model"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/model"
        "go.uber.org/atomic"
        "k8s.io/klog/v2"
        "time"
diff --git a/ship/pkg/xds/pushqueue.go b/sail/pkg/xds/pushqueue.go
similarity index 98%
rename from ship/pkg/xds/pushqueue.go
rename to sail/pkg/xds/pushqueue.go
index 99c26a01..3c634eaa 100644
--- a/ship/pkg/xds/pushqueue.go
+++ b/sail/pkg/xds/pushqueue.go
@@ -20,7 +20,7 @@ package xds
 import (
        "sync"
 
-       "github.com/apache/dubbo-kubernetes/ship/pkg/model"
+       "github.com/apache/dubbo-kubernetes/sail/pkg/model"
 )
 
 type PushQueue struct {
diff --git a/security/pkg/pki/ca/ca.go b/security/pkg/pki/ca/ca.go
index 5100cdf9..48b85751 100644
--- a/security/pkg/pki/ca/ca.go
+++ b/security/pkg/pki/ca/ca.go
@@ -32,6 +32,7 @@ import (
        apierror "k8s.io/apimachinery/pkg/api/errors"
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
        corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
+       "k8s.io/klog/v2"
        "os"
        "time"
 )
@@ -172,6 +173,7 @@ func NewSelfSignedDubboCAOptions(ctx context.Context,
                        }
 
                        // 3. if use cacerts disabled, create 
`dubbo-ca-secret`, otherwise create `cacerts`.
+                       klog.Infof("CASecret %s not found, will create one", 
caCertName)
                        options := util.CertOptions{
                                TTL:          caCertTTL,
                                Org:          org,
@@ -182,11 +184,13 @@ func NewSelfSignedDubboCAOptions(ctx context.Context,
                        }
                        pemCert, pemKey, ckErr := 
util.GenCertKeyFromOptions(options)
                        if ckErr != nil {
+                               klog.Errorf("unable to generate CA cert and key 
for self-signed CA (%v)", ckErr)
                                return fmt.Errorf("unable to generate CA cert 
and key for self-signed CA (%v)", ckErr)
                        }
 
                        rootCerts, err := util.AppendRootCerts(pemCert, 
rootCertFile)
                        if err != nil {
+                               klog.Errorf("failed to append root certificates 
(%v)", err)
                                return fmt.Errorf("failed to append root 
certificates (%v)", err)
                        }
                        if caOpts.KeyCertBundle, err = 
util.NewVerifiedKeyCertBundleFromPem(
@@ -196,18 +200,22 @@ func NewSelfSignedDubboCAOptions(ctx context.Context,
                                rootCerts,
                                nil,
                        ); err != nil {
+                               klog.Errorf("failed to create CA KeyCertBundle 
(%v)", err)
                                return fmt.Errorf("failed to create CA 
KeyCertBundle (%v)", err)
                        }
                        // Write the key/cert back to secret, so they will be 
persistent when CA restarts.
                        secret := BuildSecret(caCertName, namespace, nil, nil, 
pemCert, pemCert, pemKey, dubboCASecretType)
                        _, err = 
client.Secrets(namespace).Create(context.TODO(), secret, metav1.CreateOptions{})
                        if err != nil {
+                               klog.Errorf("Failed to create secret %s (%v)", 
caCertName, err)
                                return err
                        }
+                       klog.Infof("Using self-generated public key: %v", 
string(rootCerts))
                        return nil
                }
                return err
        })
+       klog.Infof("Set secret name for self-signed CA cert rotator to %s", 
caCertName)
        caOpts.RotatorConfig.secretName = caCertName
        return caOpts, err
 }
@@ -291,6 +299,7 @@ func (ca *DubboCA) signWithCertChain(csrPEM []byte, 
subjectIDs []string, request
 func loadSelfSignedCaSecret(client corev1.CoreV1Interface, namespace string, 
caCertName string, rootCertFile string, caOpts *DubboCAOptions) error {
        caSecret, err := client.Secrets(namespace).Get(context.TODO(), 
caCertName, metav1.GetOptions{})
        if err == nil {
+               klog.Infof("Load signing key and cert from existing secret 
%s/%s", caSecret.Namespace, caSecret.Name)
                rootCerts, err := 
util.AppendRootCerts(caSecret.Data[CACertFile], rootCertFile)
                if err != nil {
                        return fmt.Errorf("failed to append root certificates 
(%v)", err)
@@ -304,6 +313,7 @@ func loadSelfSignedCaSecret(client corev1.CoreV1Interface, 
namespace string, caC
                ); err != nil {
                        return fmt.Errorf("failed to create CA KeyCertBundle 
(%v)", err)
                }
+               klog.Infof("Using existing public key: %v", string(rootCerts))
        }
        return err
 }
@@ -402,9 +412,7 @@ func (ca *DubboCA) minTTL(defaultCertTTL time.Duration) 
(time.Duration, error) {
        return defaultCertTTL, nil
 }
 
-func NewSelfSignedDebugDubboCAOptions(rootCertFile string, caCertTTL, 
defaultCertTTL, maxCertTTL time.Duration,
-       org string, caRSAKeySize int,
-) (caOpts *DubboCAOptions, err error) {
+func NewSelfSignedDebugDubboCAOptions(rootCertFile string, caCertTTL, 
defaultCertTTL, maxCertTTL time.Duration, org string, caRSAKeySize int) (caOpts 
*DubboCAOptions, err error) {
        caOpts = &DubboCAOptions{
                CAType:         selfSignedCA,
                DefaultCertTTL: defaultCertTTL,

Reply via email to