Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update golang to 1.22, update Makefiles #258

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/setup-go@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version: 1.21
go-version: 1.22
check-latest: true
cache: true
- name: Print the version of golang
Expand All @@ -37,7 +37,7 @@ jobs:
uses: actions/setup-go@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
go-version: 1.21
go-version: 1.22
check-latest: true
cache: true
- name: Print the version of golang
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/hostplumber-multiarch-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
OVERRIDE_HOSTPLUMBER_VERSION: ${{ secrets.OVERRIDE_HOSTPLUMBER_VERSION || '' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -37,5 +38,5 @@ jobs:

- name: Build/Push image to Quay Container Registry
run:
TEAMCITY_BUILD_ID=${{ github.run_number }}
CI_BUILD_ID=${{ github.run_number }}
make -C hostplumber img-build-push
3 changes: 2 additions & 1 deletion .github/workflows/luigi-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
env:
USERNAME: ${{ secrets.QUAY_USERNAME }}
PASSWORD: ${{ secrets.QUAY_PASSWORD }}
OVERRIDE_LUIGI_VERSION: ${{ secrets.OVERRIDE_LUIGI_VERSION || '' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -35,5 +36,5 @@ jobs:

- name: Build/Push image to Quay Container Registry
run:
TEAMCITY_BUILD_ID=${{ github.run_number }}
CI_BUILD_ID=${{ github.run_number }}
make img-build-push
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
SHELL=/bin/bash
# Image URL to use all building/pushing image targets
#IMG ?= controller:latest
VER_LABEL=$(shell ./get-label.bash)
IMG ?= quay.io/platform9/luigi-plugins:$(VER_LABEL)

ifndef OVERRIDE_LUIGI_VERSION
IMG_TAG = $(shell ./get-label.bash)
else
ifneq ($(strip $(OVERRIDE_LUIGI_VERSION)),)
IMG_TAG ?= $(OVERRIDE_LUIGI_VERSION)
else
IMG_TAG = $(shell ./get-label.bash)
endif
endif

IMG ?= quay.io/platform9/luigi-plugins:$(IMG_TAG)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.27

Expand Down Expand Up @@ -128,7 +138,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.8.0
CONTROLLER_TOOLS_VERSION ?= v0.15.0

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand All @@ -144,10 +154,10 @@ $(CONTROLLER_GEN): $(LOCALBIN)
.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20230216140739-c98506dc3b8e
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

img-test:
docker run --rm -v $(SRCROOT):/luigi -w /luigi golang:1.21 bash -c "GOFLAGS=-buildvcs=false make test"
docker run --rm -v $(SRCROOT):/luigi -w /luigi golang:1.22 bash -c "GOFLAGS=-buildvcs=false make test"

img-build: $(BUILD_DIR) img-test
docker build --network host . -t ${IMG}
Expand Down
4 changes: 2 additions & 2 deletions controllers/networkplugins_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ const (
OvsImage = "quay.io/platform9/openvswitch:v2.17.5-3"
OvsCniImage = "quay.io/kubevirt/ovs-cni-plugin:v0.28.0"
OvsMarkerImage = "quay.io/kubevirt/ovs-cni-marker:v0.28.0"
HostPlumberImage = "quay.io/platform9/hostplumber:v0.5.7"
HostPlumberImage = "quay.io/platform9/hostplumber:v0.5.8"
DhcpControllerImage = "docker.io/platform9/pf9-dhcp-controller:v1.1"
KubemacpoolImage = "quay.io/kubevirt/kubemacpool:v0.41.0"
KubemacpoolRangeStart = "02:55:43:00:00:00"
KubemacpoolRangeEnd = "02:55:43:FF:FF:FF"
KubeRbacProxyImage = "gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0"
KubeRbacProxyImage = "docker.io/brancz/kube-rbac-proxy:v0.18.0"
NfdImage = "docker.io/platform9/node-feature-discovery:v0.11.3-pmk-2877967"
TemplateDir = "/etc/plugin_templates/"
CreateDir = TemplateDir + "create/"
Expand Down
4 changes: 2 additions & 2 deletions dhcp-controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.9.0
CONTROLLER_TOOLS_VERSION ?= v0.15.0

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand All @@ -144,4 +144,4 @@ $(CONTROLLER_GEN): $(LOCALBIN)
.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20230216140739-c98506dc3b8e
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
2 changes: 1 addition & 1 deletion dhcp-controller/dhcpserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21 as builder
FROM golang:1.22 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
4 changes: 2 additions & 2 deletions dhcp-controller/dhcpserver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ IMG_TAG = v0.1
IMG_REGISTRY ?= artifactory.platform9.horse/docker-local
#IMG_REGISTRY = docker.io/platform9
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.24.1
ENVTEST_K8S_VERSION = 1.27
SRCROOT = $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/)
BUILD_DIR :=$(SRCROOT)/bin

Expand Down Expand Up @@ -126,7 +126,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.9.0
CONTROLLER_TOOLS_VERSION ?= v0.15.0

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand Down
19 changes: 14 additions & 5 deletions dhcp-controller/dhcpserver/dhcpserver-image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,22 @@ This follows the scripts provided in kubevirtci repo. This was tested on the fol
Using API: QEMU 4.5.0
Running hypervisor: QEMU 1.5.3

There are three files that you need.
There are three files that you need.

1. cloud-config: This contains the cloud-init script to run in the image. You should add you setup commands in here. If you wish to run some customizations manually, remove the shutdown command in the script. Once you are done with youe changes, you can either shutdown the VM or close the domain with ^].
2. image-url: URL of the image.
3. os-variant: Passed as a parameter to virt-install. You may have to update your osinfo-db if `osinfo-query os` does not contain your os variant. You can do this by downloading the latest db and importing it

wget https://releases.pagure.org/libosinfo/osinfo-db-20221130.tar.xz
osinfo-db-import -v osinfo-db-20221130.tar.xz

### Build and Push it
```shell

wget https://releases.pagure.org/libosinfo/osinfo-db-20221130.tar.xz
osinfo-db-import -v osinfo-db-20221130.tar.xz

```

## Build and Push it

```shell

# Build your dhcpserver image
cd dhcpserver
Expand All @@ -28,3 +35,5 @@ There are three files that you need.
cd dhcpserver/dhcpserver-image
./create-containerdisk.sh fedora
./publish-containerdisk.sh fedora <docker_repo>

```
47 changes: 24 additions & 23 deletions dhcp-controller/dhcpserver/go.mod
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
module dhcpserver

go 1.21
go 1.22.0

toolchain go1.23.1

require (
github.com/fsnotify/fsnotify v1.6.0
github.com/gocarina/gocsv v0.0.0-20220927221512-ad3251f9fa25
github.com/onsi/ginkgo/v2 v2.15.0
github.com/onsi/gomega v1.31.1
k8s.io/api v0.26.10
k8s.io/apimachinery v0.26.10
k8s.io/client-go v0.26.10
k8s.io/api v0.30.5
k8s.io/apimachinery v0.30.5
k8s.io/client-go v0.30.5
kubevirt.io/api v0.58.0
sigs.k8s.io/controller-runtime v0.14.7
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand All @@ -50,7 +52,6 @@ require (
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.8.2 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
Expand All @@ -60,22 +61,22 @@ require (
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.16.1 // indirect
golang.org/x/tools v0.18.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.26.10 // indirect
k8s.io/component-base v0.26.10 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
k8s.io/apiextensions-apiserver v0.26.15 // indirect
k8s.io/component-base v0.26.15 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
kubevirt.io/containerized-data-importer-api v1.50.0 // indirect
kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

Expand Down
Loading
Loading