This is an automated email from the ASF dual-hosted git repository.
github-actions[bot] 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 434dac5f Upgrade the core architecture (#1022)
434dac5f is described below
commit 434dac5f08f7984858cdb2bd093259275ffd10fe
Author: mfordjody <[email protected]>
AuthorDate: Mon Aug 31 22:42:59 2026 +0800
Upgrade the core architecture (#1022)
---
.asf.yaml | 2 +-
.licenserc.yaml | 3 -
dubbod/discovery/cmd/app/cmd.go | 6 +-
dubbod/discovery/cmd/app/cmd_test.go | 21 ++++
dubbod/discovery/pkg/bootstrap/mesh.go | 8 +-
dubbod/discovery/pkg/bootstrap/options.go | 22 ++---
dubbod/discovery/pkg/bootstrap/server.go | 6 +-
.../pkg/config/kube/crdclient/types.gen.go | 30 +++---
.../schema/codegen/templates/crdclient.go.tmpl | 2 +-
pkg/config/schema/kubeclient/common.go | 2 +-
pkg/{ctrlz => introspection}/options.go | 52 ++++++----
pkg/introspection/options_test.go | 108 +++++++++++++++++++++
pkg/kube/krt/collection.go | 14 +--
pkg/kube/krt/core.go | 14 +--
pkg/kube/krt/debug.go | 10 +-
pkg/kube/krt/dynamic.go | 10 +-
pkg/kube/krt/fetch.go | 10 +-
pkg/kube/krt/files/files.go | 10 +-
pkg/kube/krt/filter.go | 10 +-
pkg/kube/krt/helpers.go | 10 +-
pkg/kube/krt/index.go | 10 +-
pkg/kube/krt/informer.go | 14 +--
pkg/kube/krt/internal.go | 10 +-
pkg/kube/krt/join.go | 12 ++-
pkg/kube/krt/map.go | 10 +-
pkg/kube/krt/nestedjoin.go | 12 ++-
pkg/kube/krt/options.go | 10 +-
pkg/kube/krt/processor.go | 10 +-
pkg/kube/krt/recomputetrigger.go | 10 +-
pkg/kube/krt/singleton.go | 10 +-
pkg/kube/krt/static.go | 10 +-
pkg/kube/krt/status.go | 10 +-
pkg/kube/krt/sync.go | 10 +-
pkg/kube/krt/testing.go | 10 +-
pkg/kube/krt/util.go | 10 +-
35 files changed, 347 insertions(+), 161 deletions(-)
diff --git a/.asf.yaml b/.asf.yaml
index 58a347ff..0896c407 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -19,7 +19,7 @@ notifications:
pullrequests: [email protected]
github:
- homepage: "https://kdubbo.github.io"
+ homepage: "https://dsmlx.github.io"
description: "Build a native mesh using gRPC and xDS"
pull_requests:
allow_auto_merge: true
diff --git a/.licenserc.yaml b/.licenserc.yaml
index 06ff73cd..7bab846f 100644
--- a/.licenserc.yaml
+++ b/.licenserc.yaml
@@ -24,9 +24,6 @@ header:
- '**/*.gen.go'
- '**/*.cache'
- # Upstream KRT sources retain the Istio Authors Apache-2.0 header.
- - 'pkg/kube/krt/**'
-
# Configuration and template files
- '**/*.proto'
- '**/*.tpl'
diff --git a/dubbod/discovery/cmd/app/cmd.go b/dubbod/discovery/cmd/app/cmd.go
index a1e0a6b9..24ced502 100644
--- a/dubbod/discovery/cmd/app/cmd.go
+++ b/dubbod/discovery/cmd/app/cmd.go
@@ -24,7 +24,7 @@ import (
"github.com/apache/dubbo-kubernetes/dubbod/discovery/pkg/serviceregistry/provider"
"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/pkg/introspection"
dubbolog "github.com/apache/dubbo-kubernetes/pkg/log"
"github.com/spf13/cobra"
)
@@ -106,7 +106,7 @@ func newExecuteCommand() *cobra.Command {
func addFlags(c *cobra.Command) {
serverArgs = bootstrap.NewDubboArgs(func(p *bootstrap.DubboArgs) {
- p.CtrlZOptions = ctrlz.DefaultOptions()
+ p.IntrospectionOptions = introspection.DefaultOptions()
p.InjectionOptions = bootstrap.InjectionOptions{
InjectionDirectory: "./var/lib/dubbo/inject",
}
@@ -176,7 +176,7 @@ func addFlags(c *cobra.Command) {
c.PersistentFlags().StringToStringVar(&serverArgs.RegistryOptions.KubeOptions.ClusterAliases,
"clusterAliases", map[string]string{},
"Alias names for clusters. Example:
alias1=cluster1,alias2=cluster2")
- serverArgs.CtrlZOptions.AttachCobraFlags(c)
+ serverArgs.IntrospectionOptions.AttachCobraFlags(c)
serverArgs.KeepaliveOptions.AttachCobraFlags(c)
}
diff --git a/dubbod/discovery/cmd/app/cmd_test.go
b/dubbod/discovery/cmd/app/cmd_test.go
index 53b62877..3c0115f1 100644
--- a/dubbod/discovery/cmd/app/cmd_test.go
+++ b/dubbod/discovery/cmd/app/cmd_test.go
@@ -25,6 +25,27 @@ import (
"github.com/apache/dubbo-kubernetes/pkg/log"
)
+func TestRootCommandIntrospectionFlagsHaveNoLegacyIdentifiers(t *testing.T) {
+ root := NewRootCommand()
+ execute, _, err := root.Find([]string{"execute"})
+ if err != nil {
+ t.Fatal(err)
+ }
+ usages := execute.PersistentFlags().FlagUsages()
+ lower := strings.ToLower(usages)
+ for _, banned := range []string{"ctrl" + "z", "control" + "z"} {
+ if strings.Contains(lower, banned) {
+ t.Fatalf("execute flags still contain %q:\n%s", banned,
usages)
+ }
+ }
+ if execute.PersistentFlags().Lookup("introspection_port") == nil {
+ t.Fatalf("missing introspection_port; flags=\n%s", usages)
+ }
+ if execute.PersistentFlags().Lookup("introspection_address") == nil {
+ t.Fatalf("missing introspection_address; flags=\n%s", usages)
+ }
+}
+
func TestRootCommandRegistersRenamedCommands(t *testing.T) {
root := NewRootCommand()
commands := map[string]bool{}
diff --git a/dubbod/discovery/pkg/bootstrap/mesh.go
b/dubbod/discovery/pkg/bootstrap/mesh.go
index f99c6521..212834b7 100644
--- a/dubbod/discovery/pkg/bootstrap/mesh.go
+++ b/dubbod/discovery/pkg/bootstrap/mesh.go
@@ -133,7 +133,7 @@ func compactDubboArgs(args *DubboArgs) string {
formatQuotedField("kubeconfig",
args.RegistryOptions.KubeConfig),
formatQuotedField("config_dir", args.RegistryOptions.FileDir),
formatStringField("injection_dir",
args.InjectionOptions.InjectionDirectory),
- formatStringField("ctrlz", ctrlzAddress(args)),
+ formatStringField("introspection", introspectionAddress(args)),
formatCompositeField("server", serverAddressSummary(args)),
formatCompositeField("kube", kubeOptionsSummary(args)),
formatCompositeField("keepalive", keepaliveSummary(args)),
@@ -142,11 +142,11 @@ func compactDubboArgs(args *DubboArgs) string {
return compactParts(parts...)
}
-func ctrlzAddress(args *DubboArgs) string {
- if args == nil || args.CtrlZOptions == nil {
+func introspectionAddress(args *DubboArgs) string {
+ if args == nil || args.IntrospectionOptions == nil {
return ""
}
- return fmt.Sprintf("%s:%d", args.CtrlZOptions.Address,
args.CtrlZOptions.Port)
+ return args.IntrospectionOptions.ListenAddress()
}
func serverAddressSummary(args *DubboArgs) string {
diff --git a/dubbod/discovery/pkg/bootstrap/options.go
b/dubbod/discovery/pkg/bootstrap/options.go
index f5e9bbe5..45839194 100644
--- a/dubbod/discovery/pkg/bootstrap/options.go
+++ b/dubbod/discovery/pkg/bootstrap/options.go
@@ -21,7 +21,7 @@ import (
kubecontroller
"github.com/apache/dubbo-kubernetes/dubbod/discovery/pkg/serviceregistry/kube/controller"
"github.com/apache/dubbo-kubernetes/pkg/config/constants"
- "github.com/apache/dubbo-kubernetes/pkg/ctrlz"
+ "github.com/apache/dubbo-kubernetes/pkg/introspection"
"github.com/apache/dubbo-kubernetes/pkg/keepalive"
"github.com/apache/dubbo-kubernetes/pkg/kube/krt"
)
@@ -39,16 +39,16 @@ type InjectionOptions struct {
}
type DubboArgs struct {
- ServerOptions DiscoveryServerOptions
- RegistryOptions RegistryOptions
- InjectionOptions InjectionOptions
- MeshConfigFile string
- PodName string
- Namespace string
- CtrlZOptions *ctrlz.Options
- KeepaliveOptions *keepalive.Options
- KrtDebugger *krt.DebugHandler `json:"-"`
- Revision string
+ ServerOptions DiscoveryServerOptions
+ RegistryOptions RegistryOptions
+ InjectionOptions InjectionOptions
+ MeshConfigFile string
+ PodName string
+ Namespace string
+ IntrospectionOptions *introspection.Options
+ KeepaliveOptions *keepalive.Options
+ KrtDebugger *krt.DebugHandler `json:"-"`
+ Revision string
}
type DiscoveryServerOptions struct {
diff --git a/dubbod/discovery/pkg/bootstrap/server.go
b/dubbod/discovery/pkg/bootstrap/server.go
index 22fc5cd5..db7ec9e8 100644
--- a/dubbod/discovery/pkg/bootstrap/server.go
+++ b/dubbod/discovery/pkg/bootstrap/server.go
@@ -49,8 +49,8 @@ import (
"github.com/apache/dubbo-kubernetes/pkg/config/mesh"
"github.com/apache/dubbo-kubernetes/pkg/config/schema/collections"
"github.com/apache/dubbo-kubernetes/pkg/config/schema/kind"
- "github.com/apache/dubbo-kubernetes/pkg/ctrlz"
"github.com/apache/dubbo-kubernetes/pkg/filewatcher"
+ "github.com/apache/dubbo-kubernetes/pkg/introspection"
dubbokeepalive "github.com/apache/dubbo-kubernetes/pkg/keepalive"
kubelib "github.com/apache/dubbo-kubernetes/pkg/kube"
"github.com/apache/dubbo-kubernetes/pkg/kube/inject"
@@ -297,8 +297,8 @@ func NewServer(args *DubboArgs, initFuncs ...func(*Server))
(*Server, error) {
s.startCA(caOpts)
- if args.CtrlZOptions != nil {
- _, _ = ctrlz.Run(args.CtrlZOptions)
+ if args.IntrospectionOptions != nil {
+ _, _ = introspection.Run(args.IntrospectionOptions)
}
if s.kubeClient != nil {
diff --git a/dubbod/discovery/pkg/config/kube/crdclient/types.gen.go
b/dubbod/discovery/pkg/config/kube/crdclient/types.gen.go
index 67eb7da9..230c8b6e 100755
--- a/dubbod/discovery/pkg/config/kube/crdclient/types.gen.go
+++ b/dubbod/discovery/pkg/config/kube/crdclient/types.gen.go
@@ -293,7 +293,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return
c.Dubbo().SecurityV1alpha3().AuthorizationPolicies(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.BackendTLSPolicy:
oldRes := &sigsk8siogatewayapiapisv1.BackendTLSPolicy{
ObjectMeta: origMeta,
@@ -308,7 +308,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return
c.GatewayAPI().GatewayV1().BackendTLSPolicies(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.CircuitBreakerPolicy:
oldRes :=
&apigithubcomapachedubbokubernetesapinetworkingv1alpha3.CircuitBreakerPolicy{
ObjectMeta: origMeta,
@@ -323,7 +323,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return
c.Dubbo().NetworkingV1alpha3().CircuitBreakerPolicies(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.DxgateService:
oldRes :=
&apigithubcomapachedubbokubernetesapinetworkingv1alpha3.DxgateService{
ObjectMeta: origMeta,
@@ -338,7 +338,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return
c.Dubbo().NetworkingV1alpha3().DxgateServices(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.FaultInjectionPolicy:
oldRes :=
&apigithubcomapachedubbokubernetesapinetworkingv1alpha3.FaultInjectionPolicy{
ObjectMeta: origMeta,
@@ -353,7 +353,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return
c.Dubbo().NetworkingV1alpha3().FaultInjectionPolicies(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.GatewayClass:
oldRes := &sigsk8siogatewayapiapisv1.GatewayClass{
ObjectMeta: origMeta,
@@ -368,7 +368,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return c.GatewayAPI().GatewayV1().GatewayClasses().
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.HTTPRoute:
oldRes := &sigsk8siogatewayapiapisv1.HTTPRoute{
ObjectMeta: origMeta,
@@ -383,7 +383,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return c.GatewayAPI().GatewayV1().HTTPRoutes(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.KubernetesGateway:
oldRes := &sigsk8siogatewayapiapisv1.Gateway{
ObjectMeta: origMeta,
@@ -398,7 +398,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return c.GatewayAPI().GatewayV1().Gateways(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.PeerAuthentication:
oldRes :=
&apigithubcomapachedubbokubernetesapisecurityv1alpha3.PeerAuthentication{
ObjectMeta: origMeta,
@@ -413,7 +413,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return
c.Dubbo().SecurityV1alpha3().PeerAuthentications(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.ReferenceGrant:
oldRes := &sigsk8siogatewayapiapisv1beta1.ReferenceGrant{
ObjectMeta: origMeta,
@@ -428,7 +428,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return
c.GatewayAPI().GatewayV1beta1().ReferenceGrants(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.RequestAuthentication:
oldRes :=
&apigithubcomapachedubbokubernetesapisecurityv1alpha3.RequestAuthentication{
ObjectMeta: origMeta,
@@ -443,7 +443,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return
c.Dubbo().SecurityV1alpha3().RequestAuthentications(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.ServiceActivationPolicy:
oldRes :=
&apigithubcomapachedubbokubernetesapinetworkingv1alpha3.ServiceActivationPolicy{
ObjectMeta: origMeta,
@@ -458,7 +458,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return
c.Dubbo().NetworkingV1alpha3().ServiceActivationPolicies(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.ServiceEntry:
oldRes :=
&apigithubcomapachedubbokubernetesapinetworkingv1alpha3.ServiceEntry{
ObjectMeta: origMeta,
@@ -473,7 +473,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return
c.Dubbo().NetworkingV1alpha3().ServiceEntries(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.Telemetry:
oldRes :=
&apigithubcomapachedubbokubernetesapitelemetryv1alpha3.Telemetry{
ObjectMeta: origMeta,
@@ -488,7 +488,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return
c.Dubbo().TelemetryV1alpha3().Telemetries(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
case gvk.WorkloadEntry:
oldRes :=
&apigithubcomapachedubbokubernetesapinetworkingv1alpha3.WorkloadEntry{
ObjectMeta: origMeta,
@@ -503,7 +503,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return
c.Dubbo().NetworkingV1alpha3().WorkloadEntries(orig.Namespace).
- Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ, patchBytes,
metav1.PatchOptions{FieldManager: "dubbod"})
default:
return nil, fmt.Errorf("unsupported type: %v",
orig.GroupVersionKind)
}
diff --git a/pkg/config/schema/codegen/templates/crdclient.go.tmpl
b/pkg/config/schema/codegen/templates/crdclient.go.tmpl
index 0017546e..a49b5845 100644
--- a/pkg/config/schema/codegen/templates/crdclient.go.tmpl
+++ b/pkg/config/schema/codegen/templates/crdclient.go.tmpl
@@ -91,7 +91,7 @@ func patch(c kube.Client, orig config.Config, origMeta
metav1.ObjectMeta, mod co
return nil, err
}
return c.{{.ClientGetter}}().{{ .ClientGroupPath }}().{{
.ClientTypePath }}({{if not .Resource.ClusterScoped}}orig.Namespace{{end}}).
- Patch(context.TODO(), orig.Name, typ,
patchBytes, metav1.PatchOptions{FieldManager: "pilot-discovery"})
+ Patch(context.TODO(), orig.Name, typ,
patchBytes, metav1.PatchOptions{FieldManager: "dubbod"})
{{- end }}
{{- end }}
default:
diff --git a/pkg/config/schema/kubeclient/common.go
b/pkg/config/schema/kubeclient/common.go
index aa5af0a3..bfeb7548 100644
--- a/pkg/config/schema/kubeclient/common.go
+++ b/pkg/config/schema/kubeclient/common.go
@@ -46,7 +46,7 @@ type ClientGetter interface {
// Dynamic client.
Dynamic() dynamic.Interface
- // Dubbo returns the Istio kube client.
+ // Dubbo returns the Dubbo kube client.
Dubbo() dubboclient.Interface
// Metadata returns the Metadata kube client.
diff --git a/pkg/ctrlz/options.go b/pkg/introspection/options.go
similarity index 60%
rename from pkg/ctrlz/options.go
rename to pkg/introspection/options.go
index 55174f4d..db83541e 100644
--- a/pkg/ctrlz/options.go
+++ b/pkg/introspection/options.go
@@ -14,21 +14,30 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package ctrlz
+package introspection
import (
- "fmt"
- dubbolog "github.com/apache/dubbo-kubernetes/pkg/log"
- "github.com/spf13/cobra"
"net"
"net/http"
+ "strconv"
"sync"
"time"
+
+ dubbolog "github.com/apache/dubbo-kubernetes/pkg/log"
+ "github.com/spf13/cobra"
)
-var log = dubbolog.RegisterScope("ctrlz", "ctrlz debugging")
+var log = dubbolog.RegisterScope("introspection", "process introspection
listener")
+
+const (
+ DefaultPort = 9876
-const DefaultControlZPort = 9876
+ PortFlagName = "introspection_port"
+ AddressFlagName = "introspection_address"
+
+ portFlagHelp = "The IP port to use for the process introspection
listener"
+ addressFlagHelp = "The IP address to listen on for the process
introspection listener. Use '*' to indicate all addresses."
+)
type Options struct {
Port uint16
@@ -42,18 +51,18 @@ type Server struct {
}
func (s *Server) listen() {
- log.Infof("ControlZ available at %s", s.httpServer.Addr)
+ log.Infof("introspection available at %s", s.httpServer.Addr)
err := s.httpServer.Serve(s.listener)
- log.Infof("ControlZ terminated: %v", err)
+ log.Infof("introspection terminated: %v", err)
s.shutdown.Done()
}
func (s *Server) Close() {
- log.Info("Closing ControlZ")
+ log.Info("closing introspection")
if s.listener != nil {
if err := s.listener.Close(); err != nil {
- log.Warnf("Error closing ControlZ: %v", err)
+ log.Warnf("error closing introspection: %v", err)
}
s.shutdown.Wait()
}
@@ -61,21 +70,28 @@ func (s *Server) Close() {
func DefaultOptions() *Options {
return &Options{
- Port: DefaultControlZPort,
+ Port: DefaultPort,
Address: "localhost",
}
}
-func Run(o *Options) (*Server, error) {
+// ListenAddress is host:port the introspection listener binds, including
+// the wildcard-host form produced when Address is "*".
+func (o *Options) ListenAddress() string {
+ if o == nil {
+ return ""
+ }
addr := o.Address
if addr == "*" {
addr = ""
}
+ return net.JoinHostPort(addr, strconv.Itoa(int(o.Port)))
+}
- // Canonicalize the address and resolve a dynamic port if necessary
- listener, err := net.Listen("tcp", fmt.Sprintf("%s:%d", addr, o.Port))
+func Run(o *Options) (*Server, error) {
+ listener, err := net.Listen("tcp", o.ListenAddress())
if err != nil {
- log.Errorf("Unable to start ControlZ: %v", err)
+ log.Errorf("unable to start introspection: %v", err)
return nil, err
}
@@ -95,8 +111,6 @@ func Run(o *Options) (*Server, error) {
}
func (o *Options) AttachCobraFlags(cmd *cobra.Command) {
- cmd.PersistentFlags().Uint16Var(&o.Port, "ctrlz_port", o.Port,
- "The IP port to use for the ControlZ introspection facility")
- cmd.PersistentFlags().StringVar(&o.Address, "ctrlz_address", o.Address,
- "The IP Address to listen on for the ControlZ introspection
facility. Use '*' to indicate all addresses.")
+ cmd.PersistentFlags().Uint16Var(&o.Port, PortFlagName, o.Port,
portFlagHelp)
+ cmd.PersistentFlags().StringVar(&o.Address, AddressFlagName, o.Address,
addressFlagHelp)
}
diff --git a/pkg/introspection/options_test.go
b/pkg/introspection/options_test.go
new file mode 100644
index 00000000..044ec14b
--- /dev/null
+++ b/pkg/introspection/options_test.go
@@ -0,0 +1,108 @@
+//
+// 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 introspection
+
+import (
+ "bytes"
+ "net"
+ "os"
+ "strings"
+ "testing"
+
+ dubbolog "github.com/apache/dubbo-kubernetes/pkg/log"
+ "github.com/spf13/cobra"
+)
+
+func legacyIntrospectionTokens() []string {
+ return []string{"ctrl" + "z", "control" + "z"}
+}
+
+func TestDefaultOptionsListenAddress(t *testing.T) {
+ got := DefaultOptions().ListenAddress()
+ if got == "" {
+ t.Fatal("DefaultOptions().ListenAddress() is empty")
+ }
+ host, port, err := net.SplitHostPort(got)
+ if err != nil {
+ t.Fatalf("ListenAddress %q is not host:port: %v", got, err)
+ }
+ if host != "localhost" {
+ t.Fatalf("host = %q, want localhost", host)
+ }
+ if port != "9876" {
+ t.Fatalf("port = %q, want 9876", port)
+ }
+}
+
+func TestAttachCobraFlagsHasNoLegacyIntrospectionIdentifiers(t *testing.T) {
+ cmd := &cobra.Command{Use: "dubbo-discovery"}
+ opts := DefaultOptions()
+ opts.AttachCobraFlags(cmd)
+
+ usages := cmd.PersistentFlags().FlagUsages()
+ lower := strings.ToLower(usages)
+ for _, banned := range legacyIntrospectionTokens() {
+ if strings.Contains(lower, banned) {
+ t.Fatalf("flag help still contains %q:\n%s", banned,
usages)
+ }
+ }
+
+ port := cmd.PersistentFlags().Lookup(PortFlagName)
+ if port == nil {
+ t.Fatalf("missing flag %q; flags=\n%s", PortFlagName, usages)
+ }
+ address := cmd.PersistentFlags().Lookup(AddressFlagName)
+ if address == nil {
+ t.Fatalf("missing flag %q; flags=\n%s", AddressFlagName, usages)
+ }
+ for _, banned := range legacyIntrospectionTokens() {
+ if
strings.Contains(strings.ToLower(port.Name+port.Usage+address.Name+address.Usage),
banned) {
+ t.Fatalf("flag metadata still uses banned identifier
%q: port=%q usage=%q", banned, port.Name, port.Usage)
+ }
+ }
+}
+
+func TestRunLogsHaveNoLegacyIntrospectionIdentifiers(t *testing.T) {
+ scope := dubbolog.FindScope("introspection")
+ if scope == nil {
+ t.Fatal("introspection log scope missing")
+ }
+ var out bytes.Buffer
+ scope.SetOutput(&out)
+ defer scope.SetOutput(os.Stderr)
+
+ opts := DefaultOptions()
+ opts.Port = 0
+ server, err := Run(opts)
+ if err != nil {
+ t.Fatalf("Run() error = %v", err)
+ }
+ if server == nil || server.httpServer.Addr == "" {
+ t.Fatal("Run() did not bind a listen address")
+ }
+ server.Close()
+
+ logged := strings.ToLower(out.String())
+ for _, banned := range legacyIntrospectionTokens() {
+ if strings.Contains(logged, banned) {
+ t.Fatalf("introspection logs still contain %q:\n%s",
banned, out.String())
+ }
+ }
+ if !strings.Contains(logged, "introspection available at") {
+ t.Fatalf("missing start log, got:\n%s", out.String())
+ }
+}
diff --git a/pkg/kube/krt/collection.go b/pkg/kube/krt/collection.go
index 348fd53a..06151aea 100644
--- a/pkg/kube/krt/collection.go
+++ b/pkg/kube/krt/collection.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
@@ -19,7 +21,7 @@ import (
"sync"
"github.com/apache/dubbo-kubernetes/pkg/kube/controllers"
- istiolog "github.com/apache/dubbo-kubernetes/pkg/log"
+ dubbolog "github.com/apache/dubbo-kubernetes/pkg/log"
"github.com/apache/dubbo-kubernetes/pkg/maps"
"github.com/apache/dubbo-kubernetes/pkg/queue"
"github.com/apache/dubbo-kubernetes/pkg/slices"
@@ -186,7 +188,7 @@ type manyCollection[I, O any] struct {
parent Collection[I]
// log is a logger for the collection, with additional labels already
added to identify it.
- log *istiolog.Logger
+ log *dubbolog.Logger
// This can be acquired with blockNewEvents held, but only with strict
ordering (mu inside blockNewEvents)
// mu protects all items grouped below(collectionState,
dependencyState, indexes).
// This is acquired for reads and writes of data.
diff --git a/pkg/kube/krt/core.go b/pkg/kube/krt/core.go
index 70c615e2..5edb3576 100644
--- a/pkg/kube/krt/core.go
+++ b/pkg/kube/krt/core.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
@@ -16,10 +18,10 @@ package krt
import (
"github.com/apache/dubbo-kubernetes/pkg/kube/controllers"
- istiolog "github.com/apache/dubbo-kubernetes/pkg/log"
+ dubbolog "github.com/apache/dubbo-kubernetes/pkg/log"
)
-var log = istiolog.RegisterScope("krt", "")
+var log = dubbolog.RegisterScope("krt", "")
type Metadata map[string]any
diff --git a/pkg/kube/krt/debug.go b/pkg/kube/krt/debug.go
index 3ad166c9..6c64d3c8 100644
--- a/pkg/kube/krt/debug.go
+++ b/pkg/kube/krt/debug.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/dynamic.go b/pkg/kube/krt/dynamic.go
index 28ba7592..6f9641a2 100644
--- a/pkg/kube/krt/dynamic.go
+++ b/pkg/kube/krt/dynamic.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/fetch.go b/pkg/kube/krt/fetch.go
index b3ce00bd..6f2f8e65 100644
--- a/pkg/kube/krt/fetch.go
+++ b/pkg/kube/krt/fetch.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/files/files.go b/pkg/kube/krt/files/files.go
index d3345c61..717edf3c 100644
--- a/pkg/kube/krt/files/files.go
+++ b/pkg/kube/krt/files/files.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/filter.go b/pkg/kube/krt/filter.go
index 3604eb37..b28b5d46 100644
--- a/pkg/kube/krt/filter.go
+++ b/pkg/kube/krt/filter.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/helpers.go b/pkg/kube/krt/helpers.go
index ca7d6bef..64c8a159 100644
--- a/pkg/kube/krt/helpers.go
+++ b/pkg/kube/krt/helpers.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/index.go b/pkg/kube/krt/index.go
index 1f078f58..67e7a1f3 100644
--- a/pkg/kube/krt/index.go
+++ b/pkg/kube/krt/index.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/informer.go b/pkg/kube/krt/informer.go
index 54e4382a..0021c980 100644
--- a/pkg/kube/krt/informer.go
+++ b/pkg/kube/krt/informer.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
@@ -25,14 +27,14 @@ import (
"github.com/apache/dubbo-kubernetes/pkg/kube/controllers"
"github.com/apache/dubbo-kubernetes/pkg/kube/kclient"
"github.com/apache/dubbo-kubernetes/pkg/kube/kubetypes"
- istiolog "github.com/apache/dubbo-kubernetes/pkg/log"
+ dubbolog "github.com/apache/dubbo-kubernetes/pkg/log"
"github.com/apache/dubbo-kubernetes/pkg/slices"
"github.com/apache/dubbo-kubernetes/pkg/util/ptr"
)
type informer[I controllers.ComparableObject] struct {
inf kclient.Informer[I]
- log *istiolog.Logger
+ log *dubbolog.Logger
collectionName string
id collectionUID
diff --git a/pkg/kube/krt/internal.go b/pkg/kube/krt/internal.go
index c2d666b5..f036a6bf 100644
--- a/pkg/kube/krt/internal.go
+++ b/pkg/kube/krt/internal.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/join.go b/pkg/kube/krt/join.go
index 8f8d9c32..d04efcaa 100644
--- a/pkg/kube/krt/join.go
+++ b/pkg/kube/krt/join.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
@@ -392,7 +394,7 @@ func (j *join[T]) Metadata() Metadata {
// Collection[T], picking the first object found when duplicates are found.
// Access operations (e.g. GetKey and List) will perform a best effort stable
ordering
// of the list of elements returned; however, this ordering will not be
persistent across
-// istiod restarts.
+// control plane restarts.
func JoinCollection[T any](cs []Collection[T], opts ...CollectionOption)
Collection[T] {
return JoinWithMergeCollection[T](cs, nil, opts...)
}
diff --git a/pkg/kube/krt/map.go b/pkg/kube/krt/map.go
index 39d7fd7a..32178faf 100644
--- a/pkg/kube/krt/map.go
+++ b/pkg/kube/krt/map.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/nestedjoin.go b/pkg/kube/krt/nestedjoin.go
index 60502572..df04447d 100644
--- a/pkg/kube/krt/nestedjoin.go
+++ b/pkg/kube/krt/nestedjoin.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
@@ -521,7 +523,7 @@ func (j *nestedjoin[T]) registerCollectionChangeHandler(h
func(e collectionChang
// NestedJoinCollection creates a new collection of collections of T.
Duplicate keys across the collections will *not*
// be merged (see NestedJoinWithMergeCollection for that) and access
operations (e.g. GetKey and List) will perform a
// best effort stable ordering of the list of elements returned; however, this
ordering will not be persistent across
-// istiod restarts.
+// control plane restarts.
func NestedJoinCollection[T any](collections Collection[Collection[T]], opts
...CollectionOption) Collection[T] {
return NestedJoinWithMergeCollection(collections, nil, opts...)
}
diff --git a/pkg/kube/krt/options.go b/pkg/kube/krt/options.go
index c875b7f9..a6c68b26 100644
--- a/pkg/kube/krt/options.go
+++ b/pkg/kube/krt/options.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/processor.go b/pkg/kube/krt/processor.go
index 463d27bb..623a5b02 100644
--- a/pkg/kube/krt/processor.go
+++ b/pkg/kube/krt/processor.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/recomputetrigger.go b/pkg/kube/krt/recomputetrigger.go
index 30123db8..b3feac2e 100644
--- a/pkg/kube/krt/recomputetrigger.go
+++ b/pkg/kube/krt/recomputetrigger.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/singleton.go b/pkg/kube/krt/singleton.go
index adb21f77..38291687 100644
--- a/pkg/kube/krt/singleton.go
+++ b/pkg/kube/krt/singleton.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/static.go b/pkg/kube/krt/static.go
index 7515e9ae..244a5786 100644
--- a/pkg/kube/krt/static.go
+++ b/pkg/kube/krt/static.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/status.go b/pkg/kube/krt/status.go
index 23e635eb..9402587c 100644
--- a/pkg/kube/krt/status.go
+++ b/pkg/kube/krt/status.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/sync.go b/pkg/kube/krt/sync.go
index fe41fbc3..a5af2ee6 100644
--- a/pkg/kube/krt/sync.go
+++ b/pkg/kube/krt/sync.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/testing.go b/pkg/kube/krt/testing.go
index d53ed7e0..7e0284e3 100644
--- a/pkg/kube/krt/testing.go
+++ b/pkg/kube/krt/testing.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//
diff --git a/pkg/kube/krt/util.go b/pkg/kube/krt/util.go
index 9315a35e..673a43ea 100644
--- a/pkg/kube/krt/util.go
+++ b/pkg/kube/krt/util.go
@@ -1,8 +1,10 @@
-// Copyright Istio Authors
//
-// Licensed 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
+// 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
//