Support file path as input param for Kubernetes token value
This commit is contained in:
parent
ff7966f9cd
commit
980dac4572
37 changed files with 292 additions and 256 deletions
|
@ -7,7 +7,7 @@ import (
|
|||
|
||||
"github.com/mitchellh/copystructure"
|
||||
"github.com/traefik/traefik/v3/pkg/config/dynamic"
|
||||
"github.com/traefik/traefik/v3/pkg/tls"
|
||||
"github.com/traefik/traefik/v3/pkg/types"
|
||||
"mvdan.cc/xurls/v2"
|
||||
)
|
||||
|
||||
|
@ -164,8 +164,8 @@ func reset(field reflect.Value, name string) error {
|
|||
}
|
||||
case reflect.String:
|
||||
if field.String() != "" {
|
||||
if field.Type().AssignableTo(reflect.TypeOf(tls.FileOrContent(""))) {
|
||||
field.Set(reflect.ValueOf(tls.FileOrContent(maskShort)))
|
||||
if field.Type().AssignableTo(reflect.TypeOf(types.FileOrContent(""))) {
|
||||
field.Set(reflect.ValueOf(types.FileOrContent(maskShort)))
|
||||
} else {
|
||||
field.Set(reflect.ValueOf(maskShort))
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ func init() {
|
|||
"foo": {
|
||||
ServerName: "foo",
|
||||
InsecureSkipVerify: true,
|
||||
RootCAs: []traefiktls.FileOrContent{"rootca.pem"},
|
||||
RootCAs: []types.FileOrContent{"rootca.pem"},
|
||||
Certificates: []traefiktls.Certificate{
|
||||
{
|
||||
CertFile: "cert.pem",
|
||||
|
@ -390,7 +390,7 @@ func init() {
|
|||
TLS: &dynamic.TLSClientConfig{
|
||||
ServerName: "foo",
|
||||
InsecureSkipVerify: true,
|
||||
RootCAs: []traefiktls.FileOrContent{"rootca.pem"},
|
||||
RootCAs: []types.FileOrContent{"rootca.pem"},
|
||||
Certificates: []traefiktls.Certificate{
|
||||
{
|
||||
CertFile: "cert.pem",
|
||||
|
@ -441,7 +441,7 @@ func init() {
|
|||
CipherSuites: []string{"foo"},
|
||||
CurvePreferences: []string{"foo"},
|
||||
ClientAuth: traefiktls.ClientAuth{
|
||||
CAFiles: []traefiktls.FileOrContent{"ca.pem"},
|
||||
CAFiles: []types.FileOrContent{"ca.pem"},
|
||||
ClientAuthType: "RequireAndVerifyClientCert",
|
||||
},
|
||||
SniStrict: true,
|
||||
|
@ -560,7 +560,7 @@ func TestDo_staticConfiguration(t *testing.T) {
|
|||
|
||||
config.ServersTransport = &static.ServersTransport{
|
||||
InsecureSkipVerify: true,
|
||||
RootCAs: []traefiktls.FileOrContent{"RootCAs 1", "RootCAs 2", "RootCAs 3"},
|
||||
RootCAs: []types.FileOrContent{"RootCAs 1", "RootCAs 2", "RootCAs 3"},
|
||||
MaxIdleConnsPerHost: 111,
|
||||
ForwardingTimeouts: &static.ForwardingTimeouts{
|
||||
DialTimeout: ptypes.Duration(111 * time.Second),
|
||||
|
@ -574,7 +574,7 @@ func TestDo_staticConfiguration(t *testing.T) {
|
|||
DialKeepAlive: ptypes.Duration(111 * time.Second),
|
||||
TLS: &static.TLSClientConfig{
|
||||
InsecureSkipVerify: true,
|
||||
RootCAs: []traefiktls.FileOrContent{"RootCAs 1", "RootCAs 2", "RootCAs 3"},
|
||||
RootCAs: []types.FileOrContent{"RootCAs 1", "RootCAs 2", "RootCAs 3"},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue