-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2baa2f
commit 902315e
Showing
16 changed files
with
229 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Build Windows Binaries | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
push: | ||
branches: | ||
- master | ||
- release-* | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
|
||
jobs: | ||
build: | ||
name: Build Windows x86 | ||
runs-on: windows-2019 | ||
steps: | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.8 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Go Build Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: /home/runner/.cache/go-build | ||
key: ${{ runner.os }}-go-x86-build-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-x86-build- | ||
- name: Go Mod Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Build | ||
run: | | ||
go mod tidy | ||
go install github.com/securego/gosec/cmd/gosec@latest | ||
make lint-windows | ||
make build-go-windows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//go:build !windows | ||
// +build !windows | ||
|
||
package cni | ||
|
||
import ( | ||
"github.com/containernetworking/cni/pkg/types" | ||
|
||
"github.com/kubeovn/kube-ovn/pkg/request" | ||
) | ||
|
||
type netConf struct { | ||
types.NetConf | ||
ServerSocket string `json:"server_socket"` | ||
Provider string `json:"provider"` | ||
Routes []request.Route `json:"routes"` | ||
IPAM *ipamConf `json:"ipam"` | ||
// PciAddrs in case of using sriov | ||
DeviceID string `json:"deviceID"` | ||
VfDriver string `json:"vf_driver"` | ||
// for dpdk | ||
VhostUserSocketVolumeName string `json:"vhost_user_socket_volume_name"` | ||
VhostUserSocketName string `json:"vhost_user_socket_name"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package cni | ||
|
||
import ( | ||
"github.com/containernetworking/plugins/pkg/hns" | ||
|
||
"github.com/kubeovn/kube-ovn/pkg/request" | ||
) | ||
|
||
type netConf struct { | ||
hns.NetConf | ||
ServerSocket string `json:"server_socket"` | ||
Provider string `json:"provider"` | ||
Routes []request.Route `json:"routes"` | ||
IPAM *ipamConf `json:"ipam"` | ||
// PciAddrs in case of using sriov | ||
DeviceID string `json:"deviceID"` | ||
VfDriver string `json:"vf_driver"` | ||
// for dpdk | ||
VhostUserSocketVolumeName string `json:"vhost_user_socket_volume_name"` | ||
VhostUserSocketName string `json:"vhost_user_socket_name"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package main | ||
|
||
import "github.com/kubeovn/kube-ovn/cmd/cni" | ||
|
||
func main() { | ||
cni.CmdMain() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//go:build !windows | ||
// +build !windows | ||
|
||
package request | ||
|
||
import ( | ||
"context" | ||
"net" | ||
"net/http" | ||
|
||
"github.com/parnurzeal/gorequest" | ||
) | ||
|
||
// NewCniServerClient return a new cniserver client | ||
func NewCniServerClient(socketAddress string) CniServerClient { | ||
request := gorequest.New() | ||
request.Transport = &http.Transport{DialContext: func(_ context.Context, _, _ string) (net.Conn, error) { | ||
return net.Dial("unix", socketAddress) | ||
}} | ||
return CniServerClient{request} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package request | ||
|
||
import ( | ||
"context" | ||
"net" | ||
"net/http" | ||
|
||
"github.com/Microsoft/go-winio" | ||
"github.com/parnurzeal/gorequest" | ||
) | ||
|
||
// NewCniServerClient return a new cniserver client | ||
func NewCniServerClient(pipePath string) CniServerClient { | ||
request := gorequest.New() | ||
request.Transport = &http.Transport{DialContext: func(ctx context.Context, _, _ string) (net.Conn, error) { | ||
return winio.DialPipeContext(ctx, pipePath) | ||
}} | ||
return CniServerClient{request} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.