diff --git a/go.mod b/go.mod index 0c4371d50d44..83210bc2d89b 100644 --- a/go.mod +++ b/go.mod @@ -158,3 +158,5 @@ require ( sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) + +replace knative.dev/networking => github.com/KauzClay/networking v0.0.0-20230814191707-8832c2d139e2 diff --git a/go.sum b/go.sum index 812c5f3bc3fd..718b8fd70475 100644 --- a/go.sum +++ b/go.sum @@ -67,6 +67,8 @@ github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUM github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/KauzClay/networking v0.0.0-20230814191707-8832c2d139e2 h1:saMgq4XPyUr8r7JQiSjy2PVPtjLEO7Q+uBqhcS0LuD8= +github.com/KauzClay/networking v0.0.0-20230814191707-8832c2d139e2/go.mod h1:Ao0oO/s5ARZP2jllEoGWbLgpCb2nI4OCUutylpSyxpw= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -946,8 +948,6 @@ knative.dev/caching v0.0.0-20230816124641-fb5eab7e73c3 h1:89UmDmhZuaaS7Ee+ri1nMk knative.dev/caching v0.0.0-20230816124641-fb5eab7e73c3/go.mod h1:L3wH1GzVUdT+16IKpIlhBiBrvZMPX1Mqu+RpxeSwhtM= knative.dev/hack v0.0.0-20230815012940-044c02b7a447 h1:Lr4O/WEyZHuUBFbqATYdQlfLXvhPUCluF4zlgRi59T4= knative.dev/hack v0.0.0-20230815012940-044c02b7a447/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q= -knative.dev/networking v0.0.0-20230816124641-4901742377cd h1:wpZp3/Tqfkwgah37B3h8fLg1NQ4ig1cVJH4VvKP/MZ4= -knative.dev/networking v0.0.0-20230816124641-4901742377cd/go.mod h1:iGxfnvUJ3gGqtKnoOXhLzNCZeGxVnH4xdClYuh5vB4o= knative.dev/pkg v0.0.0-20230815132840-4f651e092853 h1:OyAYpXLa/jQWClFxRegCccGySyX2/1BVRtKaAWRE/xM= knative.dev/pkg v0.0.0-20230815132840-4f651e092853/go.mod h1:Y5Tis5nMoapB9iTZywW20Qnv/7LBahrtHz9Sm6+l3LE= pgregory.net/rapid v1.0.0 h1:iQaM2w5PZ6xvt6x7hbd7tiDS+nk7YPp5uCaEba+T/F4= diff --git a/vendor/knative.dev/networking/pkg/config/config.go b/vendor/knative.dev/networking/pkg/config/config.go index 47cf440cdeb8..a4534fc51d95 100644 --- a/vendor/knative.dev/networking/pkg/config/config.go +++ b/vendor/knative.dev/networking/pkg/config/config.go @@ -25,6 +25,7 @@ import ( "strings" "text/template" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/lru" cm "knative.dev/pkg/configmap" @@ -321,6 +322,14 @@ func defaultConfig() *Config { } } +// NewConfigFromConfigMap returns a Config for the given configmap +func NewConfigFromConfigMap(config *corev1.ConfigMap) (*Config, error) { + if config == nil { + return NewConfigFromMap(nil) + } + return NewConfigFromMap(config.Data) +} + // NewConfigFromMap creates a Config from the supplied data. func NewConfigFromMap(data map[string]string) (*Config, error) { nc := defaultConfig() @@ -436,6 +445,11 @@ func NewConfigFromMap(data map[string]string) (*Config, error) { return nc, nil } +// InternalTLSEnabled returns whether or not dataplane-trust is disabled +func (c *Config) InternalTLSEnabled() bool { + return c.DataplaneTrust != TrustDisabled +} + // GetDomainTemplate returns the golang Template from the config map // or panics (the value is validated during CM validation and at // this point guaranteed to be parseable). diff --git a/vendor/modules.txt b/vendor/modules.txt index 22aeacf6732a..72f49e9fc494 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1317,7 +1317,7 @@ knative.dev/caching/pkg/client/listers/caching/v1alpha1 ## explicit; go 1.18 knative.dev/hack knative.dev/hack/shell -# knative.dev/networking v0.0.0-20230816124641-4901742377cd +# knative.dev/networking v0.0.0-20230816124641-4901742377cd => github.com/KauzClay/networking v0.0.0-20230814191707-8832c2d139e2 ## explicit; go 1.18 knative.dev/networking/config knative.dev/networking/pkg @@ -1493,3 +1493,4 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.3.0 ## explicit; go 1.12 sigs.k8s.io/yaml +# knative.dev/networking => github.com/KauzClay/networking v0.0.0-20230814191707-8832c2d139e2