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
0aeea780
Unverified
Commit
0aeea780
authored
Feb 27, 2020
by
Erik Wilson
Committed by
GitHub
Feb 27, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1444 from KnicKnic/k3s_build_windows
K3s build windows (no agents)
parents
d049a5d0
c2db115e
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
98 additions
and
7 deletions
+98
-7
command.go
pkg/agent/containerd/command.go
+15
-0
command_windows.go
pkg/agent/containerd/command_windows.go
+7
-0
containerd.go
pkg/agent/containerd/containerd.go
+1
-4
netpol_windows.go
pkg/agent/netpol/netpol_windows.go
+10
-0
network_policy.go
pkg/agent/netpol/network_policy.go
+2
-0
network_policy_controller.go
pkg/agent/netpol/network_policy_controller.go
+2
-0
utils.go
pkg/agent/netpol/utils.go
+2
-0
setup.go
pkg/agent/syssetup/setup.go
+2
-0
setup_windows.go
pkg/agent/syssetup/setup_windows.go
+3
-0
passwd.go
pkg/passwd/passwd.go
+2
-1
mounts.go
pkg/rootless/mounts.go
+2
-0
rootless.go
pkg/rootless/rootless.go
+2
-0
rootless_windows.go
pkg/rootless/rootless_windows.go
+5
-0
controller.go
pkg/rootlessports/controller.go
+2
-0
controller_windows.go
pkg/rootlessports/controller_windows.go
+10
-0
server.go
pkg/server/server.go
+3
-2
file.go
pkg/util/file.go
+15
-0
file_windows.go
pkg/util/file_windows.go
+13
-0
No files found.
pkg/agent/containerd/command.go
0 → 100644
View file @
0aeea780
// +build !windows
package
containerd
import
(
"os/exec"
"syscall"
)
func
addDeathSig
(
cmd
*
exec
.
Cmd
)
{
// not supported in this OS
cmd
.
SysProcAttr
=
&
syscall
.
SysProcAttr
{
Pdeathsig
:
syscall
.
SIGKILL
,
}
}
pkg/agent/containerd/command_windows.go
0 → 100644
View file @
0aeea780
package
containerd
import
"os/exec"
func
addDeathSig
(
_
*
exec
.
Cmd
)
{
// not supported in this OS
}
pkg/agent/containerd/containerd.go
View file @
0aeea780
...
@@ -8,7 +8,6 @@ import (
...
@@ -8,7 +8,6 @@ import (
"os"
"os"
"os/exec"
"os/exec"
"path/filepath"
"path/filepath"
"syscall"
"time"
"time"
"github.com/containerd/containerd"
"github.com/containerd/containerd"
...
@@ -67,9 +66,7 @@ func Run(ctx context.Context, cfg *config.Node) error {
...
@@ -67,9 +66,7 @@ func Run(ctx context.Context, cfg *config.Node) error {
cmd
:=
exec
.
Command
(
args
[
0
],
args
[
1
:
]
...
)
cmd
:=
exec
.
Command
(
args
[
0
],
args
[
1
:
]
...
)
cmd
.
Stdout
=
stdOut
cmd
.
Stdout
=
stdOut
cmd
.
Stderr
=
stdErr
cmd
.
Stderr
=
stdErr
cmd
.
SysProcAttr
=
&
syscall
.
SysProcAttr
{
addDeathSig
(
cmd
)
Pdeathsig
:
syscall
.
SIGKILL
,
}
if
err
:=
cmd
.
Run
();
err
!=
nil
{
if
err
:=
cmd
.
Run
();
err
!=
nil
{
fmt
.
Fprintf
(
os
.
Stderr
,
"containerd: %s
\n
"
,
err
)
fmt
.
Fprintf
(
os
.
Stderr
,
"containerd: %s
\n
"
,
err
)
}
}
...
...
pkg/agent/netpol/netpol_windows.go
0 → 100644
View file @
0aeea780
package
netpol
import
(
"context"
daemonconfig
"github.com/rancher/k3s/pkg/daemons/config"
)
func
Run
(
ctx
context
.
Context
,
nodeConfig
*
daemonconfig
.
Node
)
error
{
panic
(
"Netpol is not supported on windows ensure to pass --disable-network-policy"
)
}
pkg/agent/netpol/network_policy.go
View file @
0aeea780
// +build !windows
package
netpol
package
netpol
import
(
import
(
...
...
pkg/agent/netpol/network_policy_controller.go
View file @
0aeea780
// Apache License v2.0 (copyright Cloud Native Labs & Rancher Labs)
// Apache License v2.0 (copyright Cloud Native Labs & Rancher Labs)
// - modified from https://github.com/cloudnativelabs/kube-router/blob/d6f9f31a7b/pkg/controllers/netpol/network_policy_controller.go
// - modified from https://github.com/cloudnativelabs/kube-router/blob/d6f9f31a7b/pkg/controllers/netpol/network_policy_controller.go
// +build !windows
package
netpol
package
netpol
import
(
import
(
...
...
pkg/agent/netpol/utils.go
View file @
0aeea780
// Apache License v2.0 (copyright Cloud Native Labs & Rancher Labs)
// Apache License v2.0 (copyright Cloud Native Labs & Rancher Labs)
// - modified from https://github.com/cloudnativelabs/kube-router/tree/d6f9f31a7b/pkg/utils
// - modified from https://github.com/cloudnativelabs/kube-router/tree/d6f9f31a7b/pkg/utils
// +build !windows
package
netpol
package
netpol
import
(
import
(
...
...
pkg/agent/syssetup/setup.go
View file @
0aeea780
// +build !windows
package
syssetup
package
syssetup
import
(
import
(
...
...
pkg/agent/syssetup/setup_windows.go
0 → 100644
View file @
0aeea780
package
syssetup
func
Configure
()
{}
pkg/passwd/passwd.go
View file @
0aeea780
...
@@ -8,6 +8,7 @@ import (
...
@@ -8,6 +8,7 @@ import (
"strings"
"strings"
"github.com/rancher/k3s/pkg/token"
"github.com/rancher/k3s/pkg/token"
"github.com/rancher/k3s/pkg/util"
)
)
type
entry
struct
{
type
entry
struct
{
...
@@ -141,7 +142,7 @@ func writePasswords(passwdFile string, records [][]string) error {
...
@@ -141,7 +142,7 @@ func writePasswords(passwdFile string, records [][]string) error {
}
}
defer
out
.
Close
()
defer
out
.
Close
()
if
err
:=
out
.
Chmod
(
0600
);
err
!=
nil
{
if
err
:=
util
.
SetFileModeForFile
(
out
,
0600
);
err
!=
nil
{
return
err
return
err
}
}
...
...
pkg/rootless/mounts.go
View file @
0aeea780
// +build !windows
package
rootless
package
rootless
import
(
import
(
...
...
pkg/rootless/rootless.go
View file @
0aeea780
// +build !windows
package
rootless
package
rootless
import
(
import
(
...
...
pkg/rootless/rootless_windows.go
0 → 100644
View file @
0aeea780
package
rootless
func
Rootless
(
stateDir
string
)
error
{
panic
(
"Rootless not supported on windows"
)
}
pkg/rootlessports/controller.go
View file @
0aeea780
// +build !windows
package
rootlessports
package
rootlessports
import
(
import
(
...
...
pkg/rootlessports/controller_windows.go
0 → 100644
View file @
0aeea780
package
rootlessports
import
(
"context"
coreClients
"github.com/rancher/wrangler-api/pkg/generated/controllers/core/v1"
)
func
Register
(
ctx
context
.
Context
,
serviceController
coreClients
.
ServiceController
,
httpsPort
int
)
error
{
panic
(
"Rootless is not supported on windows"
)
}
pkg/server/server.go
View file @
0aeea780
...
@@ -24,6 +24,7 @@ import (
...
@@ -24,6 +24,7 @@ import (
"github.com/rancher/k3s/pkg/rootlessports"
"github.com/rancher/k3s/pkg/rootlessports"
"github.com/rancher/k3s/pkg/servicelb"
"github.com/rancher/k3s/pkg/servicelb"
"github.com/rancher/k3s/pkg/static"
"github.com/rancher/k3s/pkg/static"
"github.com/rancher/k3s/pkg/util"
v1
"github.com/rancher/wrangler-api/pkg/generated/controllers/core/v1"
v1
"github.com/rancher/wrangler-api/pkg/generated/controllers/core/v1"
"github.com/rancher/wrangler/pkg/leader"
"github.com/rancher/wrangler/pkg/leader"
"github.com/rancher/wrangler/pkg/resolvehome"
"github.com/rancher/wrangler/pkg/resolvehome"
...
@@ -263,12 +264,12 @@ func writeKubeConfig(certs string, config *Config) error {
...
@@ -263,12 +264,12 @@ func writeKubeConfig(certs string, config *Config) error {
if
config
.
ControlConfig
.
KubeConfigMode
!=
""
{
if
config
.
ControlConfig
.
KubeConfigMode
!=
""
{
mode
,
err
:=
strconv
.
ParseInt
(
config
.
ControlConfig
.
KubeConfigMode
,
8
,
0
)
mode
,
err
:=
strconv
.
ParseInt
(
config
.
ControlConfig
.
KubeConfigMode
,
8
,
0
)
if
err
==
nil
{
if
err
==
nil
{
os
.
Chmod
(
kubeConfig
,
os
.
FileMode
(
mode
))
util
.
SetFileModeForPath
(
kubeConfig
,
os
.
FileMode
(
mode
))
}
else
{
}
else
{
logrus
.
Errorf
(
"failed to set %s to mode %s: %v"
,
kubeConfig
,
os
.
FileMode
(
mode
),
err
)
logrus
.
Errorf
(
"failed to set %s to mode %s: %v"
,
kubeConfig
,
os
.
FileMode
(
mode
),
err
)
}
}
}
else
{
}
else
{
os
.
Chmod
(
kubeConfig
,
os
.
FileMode
(
0600
))
util
.
SetFileModeForPath
(
kubeConfig
,
os
.
FileMode
(
0600
))
}
}
if
kubeConfigSymlink
!=
kubeConfig
{
if
kubeConfigSymlink
!=
kubeConfig
{
...
...
pkg/util/file.go
0 → 100644
View file @
0aeea780
// +build !windows
package
util
import
(
"os"
)
func
SetFileModeForPath
(
name
string
,
mode
os
.
FileMode
)
error
{
return
os
.
Chmod
(
name
,
mode
)
}
func
SetFileModeForFile
(
file
*
os
.
File
,
mode
os
.
FileMode
)
error
{
return
file
.
Chmod
(
mode
)
}
pkg/util/file_windows.go
0 → 100644
View file @
0aeea780
package
util
import
(
"os"
)
func
SetFileModeForPath
(
name
string
,
mode
os
.
FileMode
)
error
{
return
nil
}
func
SetFileModeForFile
(
file
*
os
.
File
,
mode
os
.
FileMode
)
error
{
return
nil
}
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