Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
traefik
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
containous
traefik
Commits
48a2c8e4
Unverified
Commit
48a2c8e4
authored
Mar 21, 2023
by
Romain
Committed by
GitHub
Mar 21, 2023
Browse files
Options
Downloads
Patches
Plain Diff
Fix Nomad client TLS defaults
parent
b3f162a8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/provider/nomad/nomad.go
+15
-6
15 additions, 6 deletions
pkg/provider/nomad/nomad.go
pkg/provider/nomad/nomad_test.go
+0
-1
0 additions, 1 deletion
pkg/provider/nomad/nomad_test.go
with
15 additions
and
7 deletions
pkg/provider/nomad/nomad.go
+
15
−
6
View file @
48a2c8e4
...
...
@@ -79,13 +79,17 @@ func (p *Provider) SetDefaults() {
Address
:
defConfig
.
Address
,
Region
:
defConfig
.
Region
,
Token
:
defConfig
.
SecretID
,
TLS
:
&
types
.
ClientTLS
{
}
if
defConfig
.
TLSConfig
!=
nil
&&
(
defConfig
.
TLSConfig
.
Insecure
||
defConfig
.
TLSConfig
.
CACert
!=
""
||
defConfig
.
TLSConfig
.
ClientCert
!=
""
||
defConfig
.
TLSConfig
.
ClientKey
!=
""
)
{
p
.
Endpoint
.
TLS
=
&
types
.
ClientTLS
{
CA
:
defConfig
.
TLSConfig
.
CACert
,
Cert
:
defConfig
.
TLSConfig
.
ClientCert
,
Key
:
defConfig
.
TLSConfig
.
ClientKey
,
InsecureSkipVerify
:
defConfig
.
TLSConfig
.
Insecure
,
},
}
}
p
.
Prefix
=
defaultPrefix
p
.
ExposedByDefault
=
true
p
.
RefreshInterval
=
ptypes
.
Duration
(
15
*
time
.
Second
)
...
...
@@ -173,19 +177,24 @@ func (p *Provider) loadConfiguration(ctx context.Context, configurationC chan<-
}
func
createClient
(
namespace
string
,
endpoint
*
EndpointConfig
)
(
*
api
.
Client
,
error
)
{
return
api
.
NewClient
(
&
api
.
Config
{
config
:=
api
.
Config
{
Address
:
endpoint
.
Address
,
Namespace
:
namespace
,
Region
:
endpoint
.
Region
,
SecretID
:
endpoint
.
Token
,
WaitTime
:
time
.
Duration
(
endpoint
.
EndpointWaitTime
),
TLSConfig
:
&
api
.
TLSConfig
{
}
if
endpoint
.
TLS
!=
nil
{
config
.
TLSConfig
=
&
api
.
TLSConfig
{
CACert
:
endpoint
.
TLS
.
CA
,
ClientCert
:
endpoint
.
TLS
.
Cert
,
ClientKey
:
endpoint
.
TLS
.
Key
,
Insecure
:
endpoint
.
TLS
.
InsecureSkipVerify
,
},
})
}
}
return
api
.
NewClient
(
&
config
)
}
// configuration contains information from the service's tags that are globals
...
...
This diff is collapsed.
Click to expand it.
pkg/provider/nomad/nomad_test.go
+
0
−
1
View file @
48a2c8e4
...
...
@@ -84,7 +84,6 @@ func TestProvider_SetDefaults_Endpoint(t *testing.T) {
envs
:
map
[
string
]
string
{},
expected
:
&
EndpointConfig
{
Address
:
"http://127.0.0.1:4646"
,
TLS
:
&
types
.
ClientTLS
{},
},
},
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment