-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
- Loading branch information
1 parent
21dce30
commit b9018f2
Showing
13 changed files
with
118 additions
and
70 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
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
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,36 @@ | ||
name: cni-win release | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/release-cni-win.yml | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
meta: | ||
timeout-minutes: 3 | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- id: meta | ||
uses: ./.github/actions/version-mode | ||
with: | ||
package: cni-win | ||
outputs: | ||
repo: ${{ steps.meta.outputs.repo }} | ||
mode: ${{ steps.meta.outputs.mode }} | ||
version: ${{ steps.meta.outputs.version }} | ||
|
||
docker-publish: | ||
needs: meta | ||
runs-on: windows-latest | ||
timeout-minutes: 25 | ||
permissions: | ||
id-token: write # needed for signing the images with GitHub OIDC token | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- run: | | ||
docker build -f Dockerfile-cni-plugin-win . | ||
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
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,11 @@ | ||
# syntax=docker/dockerfile:1.4 | ||
FROM --platform=windows/amd64 golang:1.22.1-windowsservercore AS go | ||
WORKDIR /build | ||
COPY --link go.mod go.sum ./ | ||
COPY --link ./cni-win ./cni-win | ||
RUN go mod download | ||
RUN go build -o /go/bin/cni-win -mod=readonly -ldflags -v ./cni-win/ | ||
|
||
FROM --platform=windows/amd64 mcr.microsoft.com/windows/nanoserver:ltsc2022 | ||
COPY --from=go /go/bin/cni-win /go/bin/cni-win | ||
ENTRYPOINT [ "/go/bin/cni-win" ] |
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,52 @@ | ||
// Copyright 2017 CNI authors | ||
// Modifications copyright (c) Linkerd authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// This file was inspired by: | ||
// 1) https://github.com/istio/cni/blob/c63a509539b5ed165a6617548c31b686f13c2133/cmd/istio-cni/main.go | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/containernetworking/cni/pkg/skel" | ||
|
||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
func main() { | ||
// Must log to Stderr because the CNI runtime uses Stdout as its state | ||
logrus.SetOutput(os.Stderr) | ||
logrus.Infof("here is a simple windows executable") | ||
//skel.PluginMain(cmdAdd, cmdCheck, cmdDel, version.All, "") | ||
} | ||
|
||
// cmdAdd is called by the CNI runtime for ADD requests | ||
func cmdAdd(args *skel.CmdArgs) error { | ||
logrus.Infof("Got an add for container: %s", args.ContainerID) | ||
|
||
return nil | ||
} | ||
|
||
func cmdCheck(_ *skel.CmdArgs) error { | ||
logrus.Info("linkerd-cni: check called but not implemented") | ||
return nil | ||
} | ||
|
||
// cmdDel is called for DELETE requests | ||
func cmdDel(_ *skel.CmdArgs) error { | ||
logrus.Info("linkerd-cni: delete called but not implemented") | ||
return nil | ||
} |