config.cert-manager.io -> webhook.config.cert-manager.io

Signed-off-by: James Munnelly <jmunnelly@apple.com>
This commit is contained in:
James Munnelly
2021-12-01 12:57:08 +00:00
parent 9fce2ba5b0
commit 1a96d9f32d
34 changed files with 100 additions and 97 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ go_library(
deps = [
"//cmd/util:go_default_library",
"//cmd/webhook/app/options:go_default_library",
"//internal/apis/config:go_default_library",
"//internal/apis/config/webhook:go_default_library",
"//pkg/logs:go_default_library",
"//pkg/util:go_default_library",
"//pkg/webhook:go_default_library",
+3 -3
View File
@@ -9,9 +9,9 @@ go_library(
importpath = "github.com/jetstack/cert-manager/cmd/webhook/app/options",
visibility = ["//visibility:public"],
deps = [
"//internal/apis/config:go_default_library",
"//internal/apis/config/scheme:go_default_library",
"//pkg/apis/config/v1alpha1:go_default_library",
"//internal/apis/config/webhook:go_default_library",
"//internal/apis/config/webhook/scheme:go_default_library",
"//pkg/apis/config/webhook/v1alpha1:go_default_library",
"//pkg/logs:go_default_library",
"@com_github_spf13_pflag//:go_default_library",
"@io_k8s_component_base//cli/flag:go_default_library",
+3 -3
View File
@@ -22,9 +22,9 @@ import (
"github.com/spf13/pflag"
cliflag "k8s.io/component-base/cli/flag"
"github.com/jetstack/cert-manager/internal/apis/config"
configscheme "github.com/jetstack/cert-manager/internal/apis/config/scheme"
configv1alpha1 "github.com/jetstack/cert-manager/pkg/apis/config/v1alpha1"
config "github.com/jetstack/cert-manager/internal/apis/config/webhook"
configscheme "github.com/jetstack/cert-manager/internal/apis/config/webhook/scheme"
configv1alpha1 "github.com/jetstack/cert-manager/pkg/apis/config/webhook/v1alpha1"
)
// WebhookFlags defines options that can only be configured via flags.
+1 -1
View File
@@ -31,7 +31,7 @@ import (
cmdutil "github.com/jetstack/cert-manager/cmd/util"
"github.com/jetstack/cert-manager/cmd/webhook/app/options"
"github.com/jetstack/cert-manager/internal/apis/config"
config "github.com/jetstack/cert-manager/internal/apis/config/webhook"
logf "github.com/jetstack/cert-manager/pkg/logs"
"github.com/jetstack/cert-manager/pkg/util"
"github.com/jetstack/cert-manager/pkg/webhook"
+1 -1
View File
@@ -211,7 +211,7 @@ webhook:
# An APIVersion and Kind must be specified in your values.yaml file.
# Flags will override options that are set here.
config:
# apiVersion: config.cert-manager.io/v1alpha1
# apiVersion: config.webhook.cert-manager.io/v1alpha1
# kind: WebhookConfiguration
strategy: {}
+4 -4
View File
@@ -44,8 +44,8 @@ deepcopy_inputs=(
pkg/apis/acme/v1beta1 \
pkg/apis/acme/v1 \
internal/apis/acme \
pkg/apis/config/v1alpha1 \
internal/apis/config \
pkg/apis/config/webhook/v1alpha1 \
internal/apis/config/webhook \
pkg/apis/meta/v1 \
internal/apis/meta \
pkg/webhook/handlers/testdata/apis/testgroup/v2 \
@@ -78,7 +78,7 @@ defaulter_inputs=(
internal/apis/acme/v1alpha3 \
internal/apis/acme/v1beta1 \
internal/apis/acme/v1 \
internal/apis/config/v1alpha1 \
internal/apis/config/webhook/v1alpha1 \
internal/apis/meta/v1 \
pkg/webhook/handlers/testdata/apis/testgroup/v2 \
pkg/webhook/handlers/testdata/apis/testgroup/v1 \
@@ -94,7 +94,7 @@ conversion_inputs=(
internal/apis/acme/v1alpha3 \
internal/apis/acme/v1beta1 \
internal/apis/acme/v1 \
internal/apis/config/v1alpha1 \
internal/apis/config/webhook/v1alpha1 \
internal/apis/meta/v1 \
pkg/webhook/handlers/testdata/apis/testgroup/v2 \
pkg/webhook/handlers/testdata/apis/testgroup/v1 \
+1 -1
View File
@@ -13,7 +13,7 @@ filegroup(
"//internal/api/validation:all-srcs",
"//internal/apis/acme:all-srcs",
"//internal/apis/certmanager:all-srcs",
"//internal/apis/config:all-srcs",
"//internal/apis/config/webhook:all-srcs",
"//internal/apis/meta:all-srcs",
"//internal/ingress:all-srcs",
"//internal/vault:all-srcs",
+8 -8
View File
@@ -5,13 +5,13 @@ go_library(
srcs = [
"doc.go",
"register.go",
"types_webhook.go",
"types.go",
"zz_generated.deepcopy.go",
],
importpath = "github.com/jetstack/cert-manager/internal/apis/config",
importpath = "github.com/jetstack/cert-manager/internal/apis/config/webhook",
visibility = ["//:__subpackages__"],
deps = [
"//pkg/apis/config:go_default_library",
"//pkg/apis/config/webhook:go_default_library",
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
"@io_k8s_apimachinery//pkg/runtime:go_default_library",
"@io_k8s_apimachinery//pkg/runtime/schema:go_default_library",
@@ -29,11 +29,11 @@ filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//internal/apis/config/fuzzer:all-srcs",
"//internal/apis/config/install:all-srcs",
"//internal/apis/config/scheme:all-srcs",
"//internal/apis/config/v1alpha1:all-srcs",
"//internal/apis/config/validation:all-srcs",
"//internal/apis/config/webhook/fuzzer:all-srcs",
"//internal/apis/config/webhook/install:all-srcs",
"//internal/apis/config/webhook/scheme:all-srcs",
"//internal/apis/config/webhook/v1alpha1:all-srcs",
"//internal/apis/config/webhook/validation:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
+3 -3
View File
@@ -16,6 +16,6 @@ limitations under the License.
// +k8s:deepcopy-gen=package,register
// Package config is the internal version of the API.
// +groupName=config.cert-manager.io
package config
// Package webhook is the internal version of the webhook config API.
// +groupName=webhook.config.cert-manager.io
package webhook
@@ -3,10 +3,10 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["fuzzer.go"],
importpath = "github.com/jetstack/cert-manager/internal/apis/config/fuzzer",
importpath = "github.com/jetstack/cert-manager/internal/apis/config/webhook/fuzzer",
visibility = ["//:__subpackages__"],
deps = [
"//internal/apis/config:go_default_library",
"//internal/apis/config/webhook:go_default_library",
"@com_github_google_gofuzz//:go_default_library",
"@io_k8s_apimachinery//pkg/runtime/serializer:go_default_library",
"@io_k8s_utils//pointer:go_default_library",
@@ -21,13 +21,13 @@ import (
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/utils/pointer"
"github.com/jetstack/cert-manager/internal/apis/config"
"github.com/jetstack/cert-manager/internal/apis/config/webhook"
)
// Funcs returns the fuzzer functions for the apps api group.
// Funcs returns the fuzzer functions for the webhook config api group.
var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
func(s *config.WebhookConfiguration, c fuzz.Continue) {
func(s *webhook.WebhookConfiguration, c fuzz.Continue) {
c.FuzzNoCustom(s) // fuzz self without calling this function again
if s.HealthzPort == nil {
@@ -3,11 +3,11 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = ["install.go"],
importpath = "github.com/jetstack/cert-manager/internal/apis/config/install",
importpath = "github.com/jetstack/cert-manager/internal/apis/config/webhook/install",
visibility = ["//:__subpackages__"],
deps = [
"//internal/apis/config:go_default_library",
"//internal/apis/config/v1alpha1:go_default_library",
"//internal/apis/config/webhook:go_default_library",
"//internal/apis/config/webhook/v1alpha1:go_default_library",
"@io_k8s_apimachinery//pkg/runtime:go_default_library",
"@io_k8s_apimachinery//pkg/util/runtime:go_default_library",
],
@@ -35,7 +35,7 @@ go_test(
],
embed = [":go_default_library"],
deps = [
"//internal/apis/config/fuzzer:go_default_library",
"//internal/apis/config/webhook/fuzzer:go_default_library",
"@io_k8s_apimachinery//pkg/api/apitesting/roundtrip:go_default_library",
],
)
@@ -22,12 +22,12 @@ import (
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"github.com/jetstack/cert-manager/internal/apis/config"
"github.com/jetstack/cert-manager/internal/apis/config/v1alpha1"
"github.com/jetstack/cert-manager/internal/apis/config/webhook"
"github.com/jetstack/cert-manager/internal/apis/config/webhook/v1alpha1"
)
// Install registers the API group and adds types to a scheme
func Install(scheme *runtime.Scheme) {
utilruntime.Must(config.AddToScheme(scheme))
utilruntime.Must(webhook.AddToScheme(scheme))
utilruntime.Must(v1alpha1.AddToScheme(scheme))
}
@@ -21,7 +21,7 @@ import (
"k8s.io/apimachinery/pkg/api/apitesting/roundtrip"
configfuzzer "github.com/jetstack/cert-manager/internal/apis/config/fuzzer"
configfuzzer "github.com/jetstack/cert-manager/internal/apis/config/webhook/fuzzer"
)
func TestRoundTripTypes(t *testing.T) {
+3 -2
View File
@@ -14,12 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package config
package webhook
import (
"github.com/jetstack/cert-manager/pkg/apis/config/webhook"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/jetstack/cert-manager/pkg/apis/config/webhook"
)
var (
@@ -3,11 +3,11 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["scheme.go"],
importpath = "github.com/jetstack/cert-manager/internal/apis/config/scheme",
importpath = "github.com/jetstack/cert-manager/internal/apis/config/webhook/scheme",
visibility = ["//:__subpackages__"],
deps = [
"//internal/apis/config:go_default_library",
"//internal/apis/config/v1alpha1:go_default_library",
"//internal/apis/config/webhook:go_default_library",
"//internal/apis/config/webhook/v1alpha1:go_default_library",
"@io_k8s_apimachinery//pkg/runtime:go_default_library",
"@io_k8s_apimachinery//pkg/runtime/serializer:go_default_library",
],
@@ -20,8 +20,8 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
"github.com/jetstack/cert-manager/internal/apis/config"
configv1alpha1 "github.com/jetstack/cert-manager/internal/apis/config/v1alpha1"
config "github.com/jetstack/cert-manager/internal/apis/config/webhook"
configv1alpha1 "github.com/jetstack/cert-manager/internal/apis/config/webhook/v1alpha1"
)
// NewSchemeAndCodecs is a utility function that returns a Scheme and CodecFactory
+11 -11
View File
@@ -32,7 +32,7 @@ type WebhookConfiguration struct {
HealthzPort *int
// tlsConfig is used to configure the secure listener's TLS settings.
TLSConfig WebhookTLSConfig
TLSConfig TLSConfig
// kubeConfig is the kubeconfig file used to connect to the Kubernetes apiserver.
// If not specified, the webhook will attempt to load the in-cluster-config.
@@ -50,9 +50,9 @@ type WebhookConfiguration struct {
PprofAddress string
}
// WebhookTLSConfig configures how TLS certificates are sourced for serving.
// TLSConfig configures how TLS certificates are sourced for serving.
// Only one of 'filesystem' or 'dynamic' may be specified.
type WebhookTLSConfig struct {
type TLSConfig struct {
// cipherSuites is the list of allowed cipher suites for the server.
// Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants).
// If not specified, the default for the Go version will be used and may change over time.
@@ -65,7 +65,7 @@ type WebhookTLSConfig struct {
// Filesystem enables using a certificate and private key found on the local filesystem.
// These files will be periodically polled in case they have changed, and dynamically reloaded.
Filesystem WebhookFilesystemServingConfig
Filesystem FilesystemServingConfig
// When Dynamic serving is enabled, the webhook will generate a CA used to sign webhook
// certificates and persist it into a Kubernetes Secret resource (for other replicas of the
@@ -73,26 +73,26 @@ type WebhookTLSConfig struct {
// It will then generate a certificate in-memory for itself using this CA to serve with.
// The CAs certificate can then be copied into the appropriate Validating, Mutating and Conversion
// webhook configuration objects (typically by cainjector).
Dynamic WebhookDynamicServingConfig
Dynamic DynamicServingConfig
}
func (c *WebhookTLSConfig) FilesystemConfigProvided() bool {
func (c *TLSConfig) FilesystemConfigProvided() bool {
if c.Filesystem.KeyFile != "" || c.Filesystem.CertFile != "" {
return true
}
return false
}
func (c *WebhookTLSConfig) DynamicConfigProvided() bool {
func (c *TLSConfig) DynamicConfigProvided() bool {
if c.Dynamic.SecretNamespace != "" || c.Dynamic.SecretName != "" || len(c.Dynamic.DNSNames) > 0 {
return true
}
return false
}
// WebhookDynamicServingConfig makes the webhook generate a CA and persist it into Secret resources.
// DynamicServingConfig makes the webhook generate a CA and persist it into Secret resources.
// This CA will be used by all instances of the webhook for signing serving certificates.
type WebhookDynamicServingConfig struct {
type DynamicServingConfig struct {
// Namespace of the Kubernetes Secret resource containing the TLS certificate
// used as a CA to sign dynamic serving certificates.
SecretNamespace string
@@ -105,9 +105,9 @@ type WebhookDynamicServingConfig struct {
DNSNames []string
}
// WebhookFilesystemServingConfig enables using a certificate and private key found on the local filesystem.
// FilesystemServingConfig enables using a certificate and private key found on the local filesystem.
// These files will be periodically polled in case they have changed, and dynamically reloaded.
type WebhookFilesystemServingConfig struct {
type FilesystemServingConfig struct {
// Path to a file containing TLS certificate & chain to serve with
CertFile string
@@ -10,12 +10,12 @@ go_library(
"zz_generated.conversion.go",
"zz_generated.defaults.go",
],
importpath = "github.com/jetstack/cert-manager/internal/apis/config/v1alpha1",
importpath = "github.com/jetstack/cert-manager/internal/apis/config/webhook/v1alpha1",
visibility = ["//:__subpackages__"],
deps = [
"//internal/apis/config:go_default_library",
"//pkg/apis/config:go_default_library",
"//pkg/apis/config/v1alpha1:go_default_library",
"//internal/apis/config/webhook:go_default_library",
"//pkg/apis/config/webhook:go_default_library",
"//pkg/apis/config/webhook/v1alpha1:go_default_library",
"@io_k8s_apimachinery//pkg/conversion:go_default_library",
"@io_k8s_apimachinery//pkg/runtime:go_default_library",
"@io_k8s_apimachinery//pkg/runtime/schema:go_default_library",
@@ -17,9 +17,10 @@ limitations under the License.
package v1alpha1
import (
"github.com/jetstack/cert-manager/pkg/apis/config/webhook/v1alpha1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/utils/pointer"
"github.com/jetstack/cert-manager/pkg/apis/config/webhook/v1alpha1"
)
func addDefaultingFuncs(scheme *runtime.Scheme) error {
+4 -4
View File
@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// +k8s:conversion-gen=github.com/jetstack/cert-manager/internal/apis/config
// +k8s:conversion-gen-external-types=github.com/jetstack/cert-manager/pkg/apis/config/v1alpha1
// +k8s:conversion-gen=github.com/jetstack/cert-manager/internal/apis/config/webhook
// +k8s:conversion-gen-external-types=github.com/jetstack/cert-manager/pkg/apis/config/webhook/v1alpha1
// +k8s:defaulter-gen=TypeMeta
// +k8s:defaulter-gen-input=../../../../pkg/apis/config/v1alpha1
// +k8s:defaulter-gen-input=../../../../../pkg/apis/config/webhook/v1alpha1
// +groupName=config.cert-manager.io
// +groupName=webhook.config.cert-manager.io
package v1alpha1
@@ -17,9 +17,10 @@ limitations under the License.
package v1alpha1
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/jetstack/cert-manager/pkg/apis/config/webhook"
"github.com/jetstack/cert-manager/pkg/apis/config/webhook/v1alpha1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// SchemeGroupVersion is group version used to register these objects
@@ -3,10 +3,10 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["validation.go"],
importpath = "github.com/jetstack/cert-manager/internal/apis/config/validation",
importpath = "github.com/jetstack/cert-manager/internal/apis/config/webhook/validation",
visibility = ["//:__subpackages__"],
deps = [
"//internal/apis/config:go_default_library",
"//internal/apis/config/webhook:go_default_library",
"@io_k8s_apimachinery//pkg/util/errors:go_default_library",
],
)
@@ -21,7 +21,7 @@ import (
utilerrors "k8s.io/apimachinery/pkg/util/errors"
"github.com/jetstack/cert-manager/internal/apis/config"
config "github.com/jetstack/cert-manager/internal/apis/config/webhook"
)
func ValidateWebhookConfiguration(cfg *config.WebhookConfiguration) error {
+1 -1
View File
@@ -20,7 +20,7 @@ filegroup(
":package-srcs",
"//pkg/apis/acme:all-srcs",
"//pkg/apis/certmanager:all-srcs",
"//pkg/apis/config:all-srcs",
"//pkg/apis/config/webhook:all-srcs",
"//pkg/apis/experimental:all-srcs",
"//pkg/apis/meta:all-srcs",
],
+2 -2
View File
@@ -3,7 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["doc.go"],
importpath = "github.com/jetstack/cert-manager/pkg/apis/config",
importpath = "github.com/jetstack/cert-manager/pkg/apis/config/webhook",
visibility = ["//visibility:public"],
)
@@ -18,7 +18,7 @@ filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//pkg/apis/config/v1alpha1:all-srcs",
"//pkg/apis/config/webhook/v1alpha1:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
+4 -4
View File
@@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// +groupName=config.cert-manager.io
// +groupName=webhook.config.cert-manager.io
// Package config contains types used to configure cert-manager components
package config
// Package webhook contains types used to configure the webhook
package webhook
const GroupName = "config.cert-manager.io"
const GroupName = "webhook.config.cert-manager.io"
+3 -3
View File
@@ -5,13 +5,13 @@ go_library(
srcs = [
"doc.go",
"register.go",
"types_webhook.go",
"types.go",
"zz_generated.deepcopy.go",
],
importpath = "github.com/jetstack/cert-manager/pkg/apis/config/v1alpha1",
importpath = "github.com/jetstack/cert-manager/pkg/apis/config/webhook/v1alpha1",
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/config:go_default_library",
"//pkg/apis/config/webhook:go_default_library",
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
"@io_k8s_apimachinery//pkg/runtime:go_default_library",
"@io_k8s_apimachinery//pkg/runtime/schema:go_default_library",
+2 -2
View File
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1alpha1 is the v1alpha1 version of the API.
// Package v1alpha1 is the v1alpha1 version of the webhook config API.
// +k8s:deepcopy-gen=package,register
// +groupName=config.cert-manager.io
// +groupName=webhook.config.cert-manager.io
package v1alpha1
+2 -2
View File
@@ -21,11 +21,11 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/jetstack/cert-manager/pkg/apis/config"
"github.com/jetstack/cert-manager/pkg/apis/config/webhook"
)
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: config.GroupName, Version: "v1alpha1"}
var SchemeGroupVersion = schema.GroupVersion{Group: webhook.GroupName, Version: "v1alpha1"}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
+9 -9
View File
@@ -32,7 +32,7 @@ type WebhookConfiguration struct {
HealthzPort *int `json:"healthzPort,omitempty"`
// tlsConfig is used to configure the secure listener's TLS settings.
TLSConfig WebhookTLSConfig `json:"tlsConfig"`
TLSConfig TLSConfig `json:"tlsConfig"`
// kubeConfig is the kubeconfig file used to connect to the Kubernetes apiserver.
// If not specified, the webhook will attempt to load the in-cluster-config.
@@ -50,9 +50,9 @@ type WebhookConfiguration struct {
PprofAddress string `json:"pprofAddress,omitempty"`
}
// WebhookTLSConfig configures how TLS certificates are sourced for serving.
// TLSConfig configures how TLS certificates are sourced for serving.
// Only one of 'filesystem' or 'dynamic' may be specified.
type WebhookTLSConfig struct {
type TLSConfig struct {
// cipherSuites is the list of allowed cipher suites for the server.
// Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants).
// If not specified, the default for the Go version will be used and may change over time.
@@ -65,7 +65,7 @@ type WebhookTLSConfig struct {
// Filesystem enables using a certificate and private key found on the local filesystem.
// These files will be periodically polled in case they have changed, and dynamically reloaded.
Filesystem WebhookFilesystemServingConfig `json:"filesystem"`
Filesystem FilesystemServingConfig `json:"filesystem"`
// When Dynamic serving is enabled, the webhook will generate a CA used to sign webhook
// certificates and persist it into a Kubernetes Secret resource (for other replicas of the
@@ -73,12 +73,12 @@ type WebhookTLSConfig struct {
// It will then generate a certificate in-memory for itself using this CA to serve with.
// The CAs certificate can then be copied into the appropriate Validating, Mutating and Conversion
// webhook configuration objects (typically by cainjector).
Dynamic WebhookDynamicServingConfig `json:"dynamic"`
Dynamic DynamicServingConfig `json:"dynamic"`
}
// WebhookDynamicServingConfig makes the webhook generate a CA and persist it into Secret resources.
// DynamicServingConfig makes the webhook generate a CA and persist it into Secret resources.
// This CA will be used by all instances of the webhook for signing serving certificates.
type WebhookDynamicServingConfig struct {
type DynamicServingConfig struct {
// Namespace of the Kubernetes Secret resource containing the TLS certificate
// used as a CA to sign dynamic serving certificates.
SecretNamespace string `json:"secretNamespace,omitempty"`
@@ -91,9 +91,9 @@ type WebhookDynamicServingConfig struct {
DNSNames []string `json:"dnsNames,omitempty"`
}
// WebhookFilesystemServingConfig enables using a certificate and private key found on the local filesystem.
// FilesystemServingConfig enables using a certificate and private key found on the local filesystem.
// These files will be periodically polled in case they have changed, and dynamically reloaded.
type WebhookFilesystemServingConfig struct {
type FilesystemServingConfig struct {
// Path to a file containing TLS certificate & chain to serve with
CertFile string `json:"certFile,omitempty"`
+2 -2
View File
@@ -6,8 +6,8 @@ go_library(
importpath = "github.com/jetstack/cert-manager/pkg/webhook/configfile",
visibility = ["//visibility:public"],
deps = [
"//internal/apis/config:go_default_library",
"//internal/apis/config/scheme:go_default_library",
"//internal/apis/config/webhook:go_default_library",
"//internal/apis/config/webhook/scheme:go_default_library",
"@io_k8s_apimachinery//pkg/runtime/serializer:go_default_library",
],
)
+2 -2
View File
@@ -23,8 +23,8 @@ import (
"k8s.io/apimachinery/pkg/runtime/serializer"
"github.com/jetstack/cert-manager/internal/apis/config"
"github.com/jetstack/cert-manager/internal/apis/config/scheme"
config "github.com/jetstack/cert-manager/internal/apis/config/webhook"
"github.com/jetstack/cert-manager/internal/apis/config/webhook/scheme"
)
// Filesystem is an interface used to mock out calls to ReadFile
+1 -1
View File
@@ -30,7 +30,7 @@ func TestFSLoader_Load(t *testing.T) {
t.Fatalf("unexpected filename %q passed to ReadFile", filename)
return nil, fmt.Errorf("unexpected filename %q", filename)
}
return []byte(fmt.Sprintf(`apiVersion: config.cert-manager.io/v1alpha1
return []byte(fmt.Sprintf(`apiVersion: webhook.config.cert-manager.io/v1alpha1
kind: WebhookConfiguration
kubeConfig: %s`, kubeConfigPath)), nil
}), expectedFilename)