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
1d61576e
Commit
1d61576e
authored
Mar 24, 2019
by
Erik Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linting issues
parent
1f82d834
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
13 deletions
+13
-13
main.go
cmd/k3s/main.go
+2
-2
flannel.go
pkg/agent/flannel/flannel.go
+1
-1
setup.go
pkg/agent/flannel/setup.go
+2
-2
server.go
pkg/cli/cmds/server.go
+3
-3
stage.go
pkg/deploy/stage.go
+3
-2
server.go
pkg/server/server.go
+1
-2
controller.go
pkg/servicelb/controller.go
+1
-1
No files found.
cmd/k3s/main.go
View file @
1d61576e
...
@@ -105,13 +105,13 @@ func getAssetAndDir(dataDir string) (string, string) {
...
@@ -105,13 +105,13 @@ func getAssetAndDir(dataDir string) (string, string) {
func
extract
(
dataDir
string
)
(
string
,
error
)
{
func
extract
(
dataDir
string
)
(
string
,
error
)
{
// first look for global asset folder so we don't create a HOME version if not needed
// first look for global asset folder so we don't create a HOME version if not needed
asset
,
dir
:=
getAssetAndDir
(
datadir
.
DefaultDataDir
)
_
,
dir
:=
getAssetAndDir
(
datadir
.
DefaultDataDir
)
if
_
,
err
:=
os
.
Stat
(
dir
);
err
==
nil
{
if
_
,
err
:=
os
.
Stat
(
dir
);
err
==
nil
{
logrus
.
Debugf
(
"Asset dir %s"
,
dir
)
logrus
.
Debugf
(
"Asset dir %s"
,
dir
)
return
dir
,
nil
return
dir
,
nil
}
}
asset
,
dir
=
getAssetAndDir
(
dataDir
)
asset
,
dir
:
=
getAssetAndDir
(
dataDir
)
if
_
,
err
:=
os
.
Stat
(
dir
);
err
==
nil
{
if
_
,
err
:=
os
.
Stat
(
dir
);
err
==
nil
{
logrus
.
Debugf
(
"Asset dir %s"
,
dir
)
logrus
.
Debugf
(
"Asset dir %s"
,
dir
)
return
dir
,
nil
return
dir
,
nil
...
...
pkg/agent/flannel/flannel.go
View file @
1d61576e
...
@@ -122,7 +122,7 @@ func WriteSubnetFile(path string, nw ip.IP4Net, ipMasq bool, bn backend.Network)
...
@@ -122,7 +122,7 @@ func WriteSubnetFile(path string, nw ip.IP4Net, ipMasq bool, bn backend.Network)
// Write out the first usable IP by incrementing
// Write out the first usable IP by incrementing
// sn.IP by one
// sn.IP by one
sn
:=
bn
.
Lease
()
.
Subnet
sn
:=
bn
.
Lease
()
.
Subnet
sn
.
IP
+=
1
sn
.
IP
++
fmt
.
Fprintf
(
f
,
"FLANNEL_NETWORK=%s
\n
"
,
nw
)
fmt
.
Fprintf
(
f
,
"FLANNEL_NETWORK=%s
\n
"
,
nw
)
fmt
.
Fprintf
(
f
,
"FLANNEL_SUBNET=%s
\n
"
,
sn
)
fmt
.
Fprintf
(
f
,
"FLANNEL_SUBNET=%s
\n
"
,
sn
)
...
...
pkg/agent/flannel/setup.go
View file @
1d61576e
...
@@ -35,7 +35,7 @@ const (
...
@@ -35,7 +35,7 @@ const (
]
]
}
}
`
`
netJ
son
=
`{
netJ
SON
=
`{
"Network": "%CIDR%",
"Network": "%CIDR%",
"Backend": {
"Backend": {
"Type": "vxlan"
"Type": "vxlan"
...
@@ -99,5 +99,5 @@ func createFlannelConf(config *config.Node) error {
...
@@ -99,5 +99,5 @@ func createFlannelConf(config *config.Node) error {
return
nil
return
nil
}
}
return
util
.
WriteFile
(
config
.
FlannelConf
,
return
util
.
WriteFile
(
config
.
FlannelConf
,
strings
.
Replace
(
netJ
son
,
"%CIDR%"
,
config
.
AgentConfig
.
ClusterCIDR
.
String
(),
-
1
))
strings
.
Replace
(
netJ
SON
,
"%CIDR%"
,
config
.
AgentConfig
.
ClusterCIDR
.
String
(),
-
1
))
}
}
pkg/cli/cmds/server.go
View file @
1d61576e
...
@@ -16,7 +16,7 @@ type Server struct {
...
@@ -16,7 +16,7 @@ type Server struct {
DisableAgent
bool
DisableAgent
bool
KubeConfigOutput
string
KubeConfigOutput
string
KubeConfigMode
string
KubeConfigMode
string
KnownIPs
cli
.
StringSlice
KnownIPs
cli
.
StringSlice
}
}
var
ServerConfig
Server
var
ServerConfig
Server
...
@@ -96,8 +96,8 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
...
@@ -96,8 +96,8 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
EnvVar
:
"K3S_KUBECONFIG_MODE"
,
EnvVar
:
"K3S_KUBECONFIG_MODE"
,
},
},
cli
.
StringSliceFlag
{
cli
.
StringSliceFlag
{
Name
:
"tls-san"
,
Name
:
"tls-san"
,
Usage
:
"Add additional hostname or IP as a Subject Alternative Name in the TLS cert"
,
Usage
:
"Add additional hostname or IP as a Subject Alternative Name in the TLS cert"
,
Value
:
&
ServerConfig
.
KnownIPs
,
Value
:
&
ServerConfig
.
KnownIPs
,
},
},
NodeIPFlag
,
NodeIPFlag
,
...
...
pkg/deploy/stage.go
View file @
1d61576e
...
@@ -2,11 +2,12 @@ package deploy
...
@@ -2,11 +2,12 @@ package deploy
import
(
import
(
"bytes"
"bytes"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"io/ioutil"
"io/ioutil"
"os"
"os"
"path/filepath"
"path/filepath"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
)
func
Stage
(
dataDir
string
,
templateVars
map
[
string
]
string
,
skipList
[]
string
)
error
{
func
Stage
(
dataDir
string
,
templateVars
map
[
string
]
string
,
skipList
[]
string
)
error
{
...
...
pkg/server/server.go
View file @
1d61576e
...
@@ -137,8 +137,7 @@ func startNorman(ctx context.Context, config *Config) (string, error) {
...
@@ -137,8 +137,7 @@ func startNorman(ctx context.Context, config *Config) (string, error) {
},
},
}
}
ctx
,
_
,
err
=
normanConfig
.
Build
(
ctx
,
nil
)
if
_
,
_
,
err
=
normanConfig
.
Build
(
ctx
,
nil
);
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
...
...
pkg/servicelb/controller.go
View file @
1d61576e
...
@@ -222,7 +222,7 @@ func (h *handler) newDeployment(svc *core.Service) (*apps.Deployment, error) {
...
@@ -222,7 +222,7 @@ func (h *handler) newDeployment(svc *core.Service) (*apps.Deployment, error) {
for
_
,
node
:=
range
nodes
{
for
_
,
node
:=
range
nodes
{
if
Ready
.
IsTrue
(
node
)
{
if
Ready
.
IsTrue
(
node
)
{
replicas
+=
1
replicas
++
}
}
if
replicas
>=
2
{
if
replicas
>=
2
{
break
break
...
...
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