Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b0e42286
Unverified
Commit
b0e42286
authored
May 03, 2019
by
Erik Wilson
Committed by
GitHub
May 03, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #434 from galal-hussein/add_no_proxy
Add no_proxy env to server
parents
52f845ec
f7376ad9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
controller.go
pkg/helm/controller.go
+4
-1
server.go
pkg/server/server.go
+14
-0
No files found.
pkg/helm/controller.go
View file @
b0e42286
...
...
@@ -321,10 +321,13 @@ func keys(val map[string]intstr.IntOrString) []string {
func
setProxyEnv
(
job
*
batch
.
Job
)
{
proxySysEnv
:=
[]
string
{
"all_proxy"
,
"ALL_PROXY"
,
"http_proxy"
,
"https_proxy"
,
"HTTP_PROXY"
,
"https_proxy"
,
"HTTPS_PROXY"
,
"no_proxy"
,
"NO_PROXY"
,
}
for
_
,
proxyEnv
:=
range
proxySysEnv
{
...
...
pkg/server/server.go
View file @
b0e42286
...
...
@@ -10,6 +10,7 @@ import (
"os"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/pkg/errors"
...
...
@@ -48,6 +49,10 @@ func StartServer(ctx context.Context, config *Config) (string, error) {
return
""
,
err
}
if
err
:=
setNoProxyEnv
(
&
config
.
ControlConfig
);
err
!=
nil
{
return
""
,
err
}
if
err
:=
control
.
Server
(
ctx
,
&
config
.
ControlConfig
);
err
!=
nil
{
return
""
,
errors
.
Wrap
(
err
,
"starting kubernetes"
)
}
...
...
@@ -293,3 +298,12 @@ func writeToken(token, file, certs string) error {
token
=
FormatToken
(
token
,
certs
)
return
ioutil
.
WriteFile
(
file
,
[]
byte
(
token
+
"
\n
"
),
0600
)
}
func
setNoProxyEnv
(
config
*
config
.
Control
)
error
{
envList
:=
strings
.
Join
([]
string
{
os
.
Getenv
(
"NO_PROXY"
),
config
.
ClusterIPRange
.
String
(),
config
.
ServiceIPRange
.
String
(),
},
","
)
return
os
.
Setenv
(
"NO_PROXY"
,
envList
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment