-
Notifications
You must be signed in to change notification settings - Fork 4
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: Or Shoval <oshoval@redhat.com>
- Loading branch information
Showing
3 changed files
with
73 additions
and
0 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 |
---|---|---|
|
@@ -29,3 +29,5 @@ go.work | |
|
||
# output dir for the hack/cluster.sh artifacts and e2e tests | ||
.output | ||
|
||
passt/_kubevirt |
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,22 @@ | ||
FROM docker.io/library/golang:1.22 as builder | ||
|
||
WORKDIR /workspace | ||
|
||
COPY passt/_kubevirt/cmd/cniplugins/passt-binding/cmd/ cmd/cniplugins/passt-binding/cmd/ | ||
COPY passt/_kubevirt/cmd/cniplugins/passt-binding/pkg/ cmd/cniplugins/passt-binding/pkg/ | ||
COPY passt/_kubevirt/pkg/util/ /workspace/pkg/util/ | ||
COPY passt/_kubevirt/staging/ staging/ | ||
|
||
COPY passt/_kubevirt/go.mod go.mod | ||
COPY passt/_kubevirt/go.sum go.sum | ||
RUN go mod edit -replace=kubevirt.io/kubevirt/cmd/cniplugins/passt-binding/pkg/plugin=/workspace/cmd/cniplugins/passt-binding/pkg/plugin | ||
RUN go mod edit -replace=kubevirt.io/kubevirt/pkg/util/sysctl=/workspace/pkg/util/sysctl | ||
RUN go mod edit -replace=kubevirt.io/kubevirt/pkg/util=/workspace/pkg/util | ||
RUN go mod download | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o network-passt-binding cmd/cniplugins/passt-binding/cmd/cni.go | ||
|
||
FROM registry.access.redhat.com/ubi8/ubi-minimal | ||
WORKDIR / | ||
RUN mkdir /cni | ||
COPY --from=builder /workspace/network-passt-binding /cni/network-passt-binding |
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,49 @@ | ||
#!/bin/bash -e | ||
# | ||
# This file is part of the KubeVirt project | ||
# | ||
# 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. | ||
# | ||
# Copyright 2024 Red Hat, Inc. | ||
# | ||
|
||
export KUBEVIRT_COMMIT=01c651ba0677f759220ce0fa43530477bbe8ee23 | ||
|
||
KUBEVIRT_REPO='https://github.com/kubevirt/kubevirt.git' | ||
REPO_PATH=${REPO_PATH:-"passt/_kubevirt"} | ||
|
||
function cluster::_get_repo() { | ||
git --git-dir ${REPO_PATH}/.git config --get remote.origin.url | ||
} | ||
|
||
function cluster::_get_sha() { | ||
git --git-dir ${REPO_PATH}/.git rev-parse HEAD | ||
} | ||
|
||
function cluster::install() { | ||
if [ -d ${REPO_PATH} ]; then | ||
if [ $(cluster::_get_repo) != ${KUBEVIRT_REPO} -o $(cluster::_get_sha) != ${KUBEVIRT_COMMIT} ]; then | ||
rm -rf ${REPO_PATH} | ||
fi | ||
fi | ||
|
||
if [ ! -d ${REPO_PATH} ]; then | ||
git clone ${KUBEVIRT_REPO} ${REPO_PATH} | ||
( | ||
cd ${REPO_PATH} | ||
git checkout ${KUBEVIRT_COMMIT} | ||
) | ||
fi | ||
} | ||
|
||
cluster::install |