Skip to content

Commit

Permalink
dev: use my branch of networking
Browse files Browse the repository at this point in the history
* contains new function I had in a PR, hopefully will drop this commit when that PR is merged
  • Loading branch information
KauzClay committed Aug 18, 2023
1 parent 2d2e11b commit a8b7aec
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
14 changes: 14 additions & 0 deletions vendor/knative.dev/networking/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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).
Expand Down
3 changes: 2 additions & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit a8b7aec

Please sign in to comment.