From 0b4b8386726d9ae9df855bb519bda77351e1404d Mon Sep 17 00:00:00 2001 From: FillZpp Date: Tue, 18 Jul 2023 11:28:21 +0800 Subject: [PATCH] Add documentation to clarify the ContentType behavior Signed-off-by: FillZpp --- alias.go | 3 +++ pkg/manager/manager.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/alias.go b/alias.go index 237963889c..1f8092f4ae 100644 --- a/alias.go +++ b/alias.go @@ -110,6 +110,9 @@ var ( NewWebhookManagedBy = builder.WebhookManagedBy // NewManager returns a new Manager for creating Controllers. + // Note that if ContentType in the given config is not set, "application/vnd.kubernetes.protobuf" + // will be used for all built-in resources of Kubernetes, and "application/json" is for other types + // including all CRD resources. NewManager = manager.New // CreateOrUpdate creates or updates the given object obj in the Kubernetes diff --git a/pkg/manager/manager.go b/pkg/manager/manager.go index 7e65ef0c3a..04e6d94cb2 100644 --- a/pkg/manager/manager.go +++ b/pkg/manager/manager.go @@ -390,6 +390,9 @@ type LeaderElectionRunnable interface { } // New returns a new Manager for creating Controllers. +// Note that if ContentType in the given config is not set, "application/vnd.kubernetes.protobuf" +// will be used for all built-in resources of Kubernetes, and "application/json" is for other types +// including all CRD resources. func New(config *rest.Config, options Options) (Manager, error) { // Set default values for options fields options = setOptionsDefaults(options)