From 2903d9d14fee4b4c60d731cbd677289045126bfc Mon Sep 17 00:00:00 2001 From: StarryWang Date: Tue, 16 Jul 2024 15:54:12 +0800 Subject: [PATCH] Update go module path & CI goreleaser scripts --- .github/workflows/ci.yaml | 32 ++- .github/workflows/release.yaml | 41 ++-- .gitignore | 2 + .goreleaser.yaml | 67 ++++++ Makefile | 201 +++--------------- cni/main.go | 15 +- go.mod | 2 +- main.go | 22 +- package/cni/Dockerfile | 11 +- package/deploy/Dockerfile | 7 +- package/operator/Dockerfile | 7 +- pkg/admission/server.go | 4 +- pkg/admission/webhook/subnet.go | 4 +- pkg/admission/webhook/subnet_test.go | 2 +- pkg/admission/webhook/webhook.go | 10 +- pkg/admission/webhook/workload.go | 4 +- .../v1/zz_generated_register.go | 2 +- pkg/cni/commands/add.go | 18 +- pkg/cni/commands/check.go | 14 +- pkg/cni/commands/common.go | 8 +- pkg/cni/commands/del.go | 6 +- pkg/cni/ipvlan/ipvlan.go | 2 +- pkg/cni/kubeclient/kubeclient.go | 4 +- pkg/cni/macvlan/macvlan.go | 2 +- pkg/cni/route/flatnetwork.go | 4 +- pkg/cni/route/route.go | 4 +- pkg/codegen/main.go | 4 +- pkg/controller/flatnetworkip/flatnetworkip.go | 12 +- .../flatnetworkip/flatnetworkip_test.go | 4 +- pkg/controller/flatnetworkip/ipcalc.go | 4 +- pkg/controller/flatnetworkip/mac.go | 4 +- pkg/controller/flatnetworkip/remove.go | 4 +- .../flatnetworksubnet/flatnetworksubnet.go | 12 +- .../flatnetworksubnet_test.go | 2 +- pkg/controller/flatnetworksubnet/remove.go | 4 +- pkg/controller/flatnetworksubnet/utils.go | 2 +- pkg/controller/ingress/ingress.go | 8 +- pkg/controller/namespace/namespace.go | 6 +- pkg/controller/pod/pod.go | 14 +- pkg/controller/pod/utils.go | 4 +- pkg/controller/pod/workload.go | 2 +- pkg/controller/service/endpoint.go | 2 +- pkg/controller/service/endpointslice.go | 2 +- pkg/controller/service/flatnetwork_service.go | 4 +- pkg/controller/service/service.go | 8 +- pkg/controller/service/utils.go | 4 +- pkg/controller/workload/workload.go | 10 +- pkg/controller/wrangler/context.go | 26 +-- .../clientset/versioned/clientset.go | 2 +- .../versioned/fake/clientset_generated.go | 6 +- .../clientset/versioned/fake/register.go | 2 +- .../clientset/versioned/scheme/register.go | 2 +- .../fake_flatnetwork.pandaria.io_client.go | 2 +- .../v1/fake/fake_flatnetworkip.go | 2 +- .../v1/fake/fake_flatnetworksubnet.go | 2 +- .../v1/flatnetwork.pandaria.io_client.go | 4 +- .../v1/flatnetworkip.go | 4 +- .../v1/flatnetworksubnet.go | 4 +- pkg/generated/controllers/apps/interface.go | 2 +- pkg/generated/controllers/batch/interface.go | 2 +- pkg/generated/controllers/core/interface.go | 2 +- .../controllers/discovery.k8s.io/interface.go | 2 +- .../flatnetwork.pandaria.io/interface.go | 2 +- .../v1/flatnetworkip.go | 2 +- .../v1/flatnetworksubnet.go | 2 +- .../flatnetwork.pandaria.io/v1/interface.go | 2 +- .../networking.k8s.io/interface.go | 2 +- .../informers/externalversions/factory.go | 6 +- .../flatnetwork.pandaria.io/interface.go | 4 +- .../v1/flatnetworkip.go | 8 +- .../v1/flatnetworksubnet.go | 8 +- .../flatnetwork.pandaria.io/v1/interface.go | 2 +- .../informers/externalversions/generic.go | 2 +- .../internalinterfaces/factory_interfaces.go | 2 +- .../v1/flatnetworkip.go | 2 +- .../v1/flatnetworksubnet.go | 2 +- pkg/ipcalc/ipcalc.go | 4 +- pkg/ipcalc/ipcalc_test.go | 2 +- pkg/utils/utils.go | 2 +- scripts/build.sh | 29 --- scripts/{package-helm.sh => chart.sh} | 18 +- scripts/image-push.sh | 36 ---- scripts/image.sh | 41 ++-- scripts/package.sh | 13 -- scripts/{validate.sh => verify.sh} | 0 scripts/version.sh | 44 ---- 86 files changed, 373 insertions(+), 537 deletions(-) create mode 100644 .goreleaser.yaml delete mode 100755 scripts/build.sh rename scripts/{package-helm.sh => chart.sh} (58%) delete mode 100755 scripts/image-push.sh delete mode 100755 scripts/package.sh rename scripts/{validate.sh => verify.sh} (100%) delete mode 100755 scripts/version.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e42947b..942f53c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,16 +14,32 @@ jobs: uses: actions/setup-go@v5 with: go-version: 1.22.x - - name: Analysis + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Lint uses: golangci/golangci-lint-action@v6 with: version: v1.59 - - name: CI + - name: Verify + run: | + make verify + - name: Test + run: | + make test + - name: Build env: - REPO: ${{ vars.PUBLIC_REGISTRY }}/${{ vars.PUBLIC_REGISTRY_REPO }} + TAG: ${{ github.ref_name }} + COMMIT: ${{ github.sha }} + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: "~> v2" + args: build --clean --snapshot + - name: Image Build run: | - ./scripts/validate.sh - ./scripts/test.sh - ./scripts/build.sh - ./scripts/image.sh - ./scripts/package.sh + make image + env: + TAG: ${{ github.ref_name }} + REPO: ${{ vars.PUBLIC_REGISTRY }}/${{ vars.PUBLIC_REGISTRY_REPO }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9b95531..a3695ac 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,17 +4,6 @@ on: push: tags: - 'v*' - -# GitHub settings / example values: -# -# org level vars: -# - PUBLIC_REGISTRY: docker.io -# repo level vars: -# - PUBLIC_REGISTRY_REPO: cnrancher -# repo level secrets: -# - PUBLIC_REGISTRY_USERNAME -# - PUBLIC_REGISTRY_PASSWORD - jobs: release: permissions: @@ -37,25 +26,33 @@ jobs: with: fetch-depth: 0 ref: ${{ github.ref_name}} - - name: Build and push all image variations + - name: Lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.59 + - name: Verify run: | - ./scripts/validate.sh - ./scripts/test.sh - ./scripts/build.sh - ./scripts/image-push.sh - env: - TAG: ${{ github.ref_name }} - REPO: ${{ vars.PUBLIC_REGISTRY }}/${{ vars.PUBLIC_REGISTRY_REPO }} - - name: Create release + make verify + - name: Test + run: | + make test + - name: Go Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required for creating GH release - id: goreleaser + TAG: ${{ github.ref_name }} + COMMIT: ${{ github.sha }} uses: goreleaser/goreleaser-action@v6 with: distribution: goreleaser version: "~> v2" args: release --clean --verbose - - name: Upload charts to release + - name: Image Push + run: | + make image-push + env: + TAG: ${{ github.ref_name }} + REPO: ${{ vars.PUBLIC_REGISTRY }}/${{ vars.PUBLIC_REGISTRY_REPO }} + - name: Upload Charts env: TAG: ${{ github.ref_name }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required for updating GH release diff --git a/.gitignore b/.gitignore index 2f1c5f2..dac51ea 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,5 @@ go.work # vendor /vendor + +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..658cf65 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,67 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines below are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 + +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - amd64 + - arm64 + ldflags: + - -extldflags -static + - -s -w + - -X github.com/cnrancher/rancher-flat-network/pkg/utils.GitCommit={{.Env.COMMIT}} + - -X github.com/cnrancher/rancher-flat-network/pkg/utils.Version={{.Env.TAG}} + main: ./main.go + id: rancher-flat-network-operator + binary: rancher-flat-network-operator + - env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - amd64 + - arm64 + ldflags: + - -extldflags -static + - -s -w + - -X github.com/cnrancher/rancher-flat-network/pkg/utils.GitCommit={{.Env.COMMIT}} + - -X github.com/cnrancher/rancher-flat-network/pkg/utils.Version={{.Env.TAG}} + main: ./cni/main.go + id: rancher-flat-network-cni + binary: rancher-flat-network-cni + + +release: + prerelease: auto + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" diff --git a/Makefile b/Makefile index 854148c..83f5809 100644 --- a/Makefile +++ b/Makefile @@ -1,184 +1,49 @@ -TARGETS := $(shell ls scripts) -GIT_BRANCH?=$(shell git branch --show-current) -GIT_COMMIT?=$(shell git rev-parse HEAD) -GIT_COMMIT_SHORT?=$(shell git rev-parse --short HEAD) -GIT_TAG?=v0.0.0 -ifneq ($(GIT_BRANCH), main) -GIT_TAG?=$(shell git describe --abbrev=0 --tags 2>/dev/null || echo "v0.0.0" ) -endif -TAG?=${GIT_TAG}-${GIT_COMMIT_SHORT} -OPERATOR_CHART?=$(shell find $(ROOT_DIR) -type f -name "rancher-eks-operator-[0-9]*.tgz" -print) -CRD_CHART?=$(shell find $(ROOT_DIR) -type f -name "rancher-eks-operator-crd*.tgz" -print) -CHART_VERSION?=900 # Only used in e2e to avoid downgrades from rancher -REPO?=docker.io/cnrancher/rancher-flat-network -IMAGE = $(REPO):$(TAG) -TARGET_PLATFORMS := linux/amd64,linux/arm64 -MACHINE := rancher -CLUSTER_NAME?="eks-operator-e2e" -E2E_CONF_FILE ?= $(ROOT_DIR)/test/e2e/config/config.yaml +TAG?=$(shell git describe --abbrev=0 --tags 2>/dev/null || echo "v0.0.0" ) +COMMIT?=$(shell git rev-parse --short HEAD) -ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) -BIN_DIR := $(abspath $(ROOT_DIR)/bin) -GO_INSTALL = ./scripts/go_install.sh - -MOCKGEN_VER := v1.6.0 -MOCKGEN_BIN := mockgen -MOCKGEN := $(BIN_DIR)/$(MOCKGEN_BIN)-$(MOCKGEN_VER) - -GINKGO_VER := v2.19.0 -GINKGO_BIN := ginkgo -GINKGO := $(BIN_DIR)/$(GINKGO_BIN)-$(GINKGO_VER) - -GO_APIDIFF_VER := v0.8.2 -GO_APIDIFF_BIN := go-apidiff -GO_APIDIFF := $(BIN_DIR)/$(GO_APIDIFF_BIN)-$(GO_APIDIFF_VER) - -SETUP_ENVTEST_VER := v0.0.0-20211110210527-619e6b92dab9 -SETUP_ENVTEST_BIN := setup-envtest -SETUP_ENVTEST := $(BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER) - -ifeq ($(shell go env GOOS),darwin) # Use the darwin/amd64 binary until an arm64 version is available - KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use --use-env -p path --arch amd64 $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION)) -else - KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use --use-env -p path $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION)) -endif - -default: operator - -.dapper: - @echo Downloading dapper - @curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp - @@chmod +x .dapper.tmp - @./.dapper.tmp -v - @mv .dapper.tmp .dapper - -.PHONY: generate-crd -generate-crd: $(MOCKGEN) - go generate main.go +default: build .PHONY: generate generate: - $(MAKE) generate-go - $(MAKE) generate-crd - -.PHONY: $(TARGETS) -$(TARGETS): .dapper - ./.dapper $@ - -$(MOCKGEN): - GOBIN=$(BIN_DIR) $(GO_INSTALL) github.com/golang/mock/mockgen $(MOCKGEN_BIN) $(MOCKGEN_VER) - -$(GINKGO): - GOBIN=$(BIN_DIR) $(GO_INSTALL) github.com/onsi/ginkgo/v2/ginkgo $(GINKGO_BIN) $(GINKGO_VER) - -$(GO_APIDIFF): - GOBIN=$(BIN_DIR) $(GO_INSTALL) github.com/joelanford/go-apidiff $(GO_APIDIFF_BIN) $(GO_APIDIFF_VER) - -$(SETUP_ENVTEST): - GOBIN=$(BIN_DIR) $(GO_INSTALL) sigs.k8s.io/controller-runtime/tools/setup-envtest $(SETUP_ENVTEST_BIN) $(SETUP_ENVTEST_VER) - -.PHONY: operator -operator: - CGO_ENABLED=0 go build -o bin/eks-operator main.go + @go generate -.PHONY: generate-go -generate-go: $(MOCKGEN) - go generate ./pkg/eks/... +.PHONY: build +build: + COMMIT=$(COMMIT) TAG=$(TAG) goreleaser build --snapshot --clean .PHONY: test -test: $(SETUP_ENVTEST) $(GINKGO) - KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" $(GINKGO) -v -r -p --trace --race ./pkg/... ./controller/... +test: + CGO_ENABLED=0 go test -cover --count=1 ./... .PHONY: clean clean: - rm -rf build bin dist - -ALL_VERIFY_CHECKS = generate + ./scripts/clean.sh .PHONY: verify -verify: $(addprefix verify-,$(ALL_VERIFY_CHECKS)) - -.PHONY: verify-generate -verify-generate: generate - @if !(git diff --quiet HEAD); then \ - git diff; \ - echo "generated files are out of date, run make generate"; exit 1; \ - fi - -.PHONY: operator-chart -operator-chart: - mkdir -p $(BIN_DIR) - cp -rf $(ROOT_DIR)/charts/eks-operator $(BIN_DIR)/chart - sed -i -e 's/tag:.*/tag: '${TAG}'/' $(BIN_DIR)/chart/values.yaml - sed -i -e 's|repository:.*|repository: '${REPO}'|' $(BIN_DIR)/chart/values.yaml - helm package --version ${CHART_VERSION} --app-version ${GIT_TAG} -d $(BIN_DIR)/ $(BIN_DIR)/chart - rm -Rf $(BIN_DIR)/chart - -.PHONY: crd-chart -crd-chart: - mkdir -p $(BIN_DIR) - helm package --version ${CHART_VERSION} --app-version ${GIT_TAG} -d $(BIN_DIR)/ $(ROOT_DIR)/charts/eks-operator-crd - rm -Rf $(BIN_DIR)/chart +verify: + ./scripts/verify.sh -.PHONY: charts -charts: - $(MAKE) operator-chart - $(MAKE) crd-chart +.PHONY: chart +chart: + TAG=$(TAG) ./scripts/chart.sh -buildx-machine: - @docker buildx ls | grep $(MACHINE) || \ - docker buildx create --name=$(MACHINE) --platform=$(TARGET_PLATFORMS) - -.PHONY: image-build -image-build: buildx-machine ## build (and load) the container image targeting the current platform. - docker buildx build -f package/Dockerfile \ - --builder $(MACHINE) --build-arg VERSION=$(TAG) \ - -t "$(IMAGE)" $(BUILD_ACTION) . - @echo "Built $(IMAGE)" +.PHONY: image +image: + TAG=$(TAG) ./scripts/image.sh .PHONY: image-push -image-push: buildx-machine ## build the container image targeting all platforms defined by TARGET_PLATFORMS and push to a registry. - docker buildx build -f package/Dockerfile \ - --builder $(MACHINE) --build-arg VERSION=$(TAG) \ - --platform=$(TARGET_PLATFORMS) -t "$(IMAGE)" --push . - @echo "Pushed $(IMAGE)" - -.PHONY: setup-kind -setup-kind: - CLUSTER_NAME=$(CLUSTER_NAME) $(ROOT_DIR)/scripts/setup-kind-cluster.sh - -.PHONY: e2e-tests -e2e-tests: $(GINKGO) charts - export EXTERNAL_IP=`kubectl get nodes -o jsonpath='{.items[].status.addresses[?(@.type == "InternalIP")].address}'` && \ - export BRIDGE_IP="172.18.0.1" && \ - export CONFIG_PATH=$(E2E_CONF_FILE) && \ - export OPERATOR_CHART=$(OPERATOR_CHART) && \ - export CRD_CHART=$(CRD_CHART) && \ - cd $(ROOT_DIR)/test && $(GINKGO) $(ONLY_DEPLOY) -r -v ./e2e - -.PHONY: kind-e2e-tests -kind-e2e-tests: docker-build-e2e setup-kind - kind load docker-image --name $(CLUSTER_NAME) ${REPO}:${TAG} - $(MAKE) e2e-tests - -kind-deploy-operator: - ONLY_DEPLOY="--label-filter=\"do-nothing\"" $(MAKE) kind-e2e-tests - -.PHONY: docker-build -docker-build-e2e: - DOCKER_BUILDKIT=1 docker build \ - -f test/e2e/Dockerfile.e2e \ - --build-arg "TAG=${GIT_TAG}" \ - --build-arg "COMMIT=${GIT_COMMIT}" \ - --build-arg "COMMITDATE=${COMMITDATE}" \ - -t ${REPO}:${TAG} . - -.PHOHY: delete-local-kind-cluster -delete-local-kind-cluster: ## Delete the local kind cluster - kind delete cluster --name=$(CLUSTER_NAME) - -APIDIFF_OLD_COMMIT ?= $(shell git rev-parse origin/release-v2.9) - -.PHONY: apidiff -apidiff: $(GO_APIDIFF) ## Check for API differences - $(GO_APIDIFF) $(APIDIFF_OLD_COMMIT) --print-compatible +image-push: + TAG=$(TAG) BUILDX_OPTIONS="--push" ./scripts/image.sh + +.PHONY: help +help: + @echo "Usage:" + @echo " make build build binary files" + @echo " make test run unit tests" + @echo " make generate run code generator" + @echo " make verify verify modules" + @echo " make chart package helm charts" + @echo " make image build container images" + @echo " make image-push build container images and push" + @echo " make clean clean up built files" + @echo " make help show this message" diff --git a/cni/main.go b/cni/main.go index a8f8b0a..6ff5ab3 100644 --- a/cni/main.go +++ b/cni/main.go @@ -1,18 +1,29 @@ package main import ( + "fmt" "runtime" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/commands" + "github.com/cnrancher/rancher-flat-network/pkg/cni/commands" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/containernetworking/cni/pkg/skel" "github.com/containernetworking/cni/pkg/version" ) +var ( + about string +) + func init() { // this ensures that main runs only on main thread (thread group leader). // since namespace ops (unshare, setns) are done for a single thread, we // must ensure that the goroutine does not jump from OS thread to thread runtime.LockOSThread() + + about = fmt.Sprintf("rancher-flat-network-cni %v", utils.Version) + if utils.GitCommit != "" { + about += " - " + utils.GitCommit + } } func main() { @@ -22,5 +33,5 @@ func main() { Del: commands.Del, Check: commands.Check, } - skel.PluginMainFuncs(funcs, versions, "rancher-flat-network-cni") + skel.PluginMainFuncs(funcs, versions, about) } diff --git a/go.mod b/go.mod index d59dfd8..293974f 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/cnrancher/rancher-flat-network-operator +module github.com/cnrancher/rancher-flat-network go 1.22.0 diff --git a/main.go b/main.go index 9e62b2b..0b2301e 100644 --- a/main.go +++ b/main.go @@ -11,17 +11,17 @@ import ( "time" nested "github.com/antonfisher/nested-logrus-formatter" - "github.com/cnrancher/rancher-flat-network-operator/pkg/admission" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/flatnetworkip" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/flatnetworksubnet" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/ingress" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/namespace" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/pod" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/service" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/workload" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/wrangler" - "github.com/cnrancher/rancher-flat-network-operator/pkg/logserver" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/admission" + "github.com/cnrancher/rancher-flat-network/pkg/controller/flatnetworkip" + "github.com/cnrancher/rancher-flat-network/pkg/controller/flatnetworksubnet" + "github.com/cnrancher/rancher-flat-network/pkg/controller/ingress" + "github.com/cnrancher/rancher-flat-network/pkg/controller/namespace" + "github.com/cnrancher/rancher-flat-network/pkg/controller/pod" + "github.com/cnrancher/rancher-flat-network/pkg/controller/service" + "github.com/cnrancher/rancher-flat-network/pkg/controller/workload" + "github.com/cnrancher/rancher-flat-network/pkg/controller/wrangler" + "github.com/cnrancher/rancher-flat-network/pkg/logserver" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/rancher/wrangler/v3/pkg/kubeconfig" "github.com/rancher/wrangler/v3/pkg/signals" "github.com/sirupsen/logrus" diff --git a/package/cni/Dockerfile b/package/cni/Dockerfile index ed6a684..358e590 100644 --- a/package/cni/Dockerfile +++ b/package/cni/Dockerfile @@ -1,17 +1,16 @@ FROM registry.suse.com/bci/bci-base:15.6 -ARG ARCH=amd64 +ARG TARGETARCH ARG STATIC_IPAM_VERSION=v1.5.1 - RUN zypper -n install vim curl tar gzip && \ zypper -n clean -a && rm -rf /tmp/* /var/tmp/* /usr/share/doc/packages/* && \ mkdir -p /tmp/bin /opt/cni/bin /etc/rancher/flat-network/ && \ - curl -sLf https://github.com/containernetworking/plugins/releases/download/${STATIC_IPAM_VERSION}/cni-plugins-linux-${ARCH}-${STATIC_IPAM_VERSION}.tgz | tar xvzf - -C /tmp/bin && \ + curl -sLf https://github.com/containernetworking/plugins/releases/download/${STATIC_IPAM_VERSION}/cni-plugins-linux-${TARGETARCH}-${STATIC_IPAM_VERSION}.tgz | tar xvzf - -C /tmp/bin && \ mv /tmp/bin/static /opt/cni/bin/static-ipam && \ rm -rf /tmp/* -ADD package/cni/entrypoint.sh / -ADD package/cni/cni-loglevel.conf /etc/rancher/flat-network/ -ADD bin/rancher-flat-network-cni /opt/cni/bin/ +COPY package/cni/entrypoint.sh / +COPY package/cni/cni-loglevel.conf /etc/rancher/flat-network/ +COPY dist/rancher-flat-network-cni_linux_${TARGETARCH}*/ /opt/cni/bin/ ENTRYPOINT ["/entrypoint.sh"] diff --git a/package/deploy/Dockerfile b/package/deploy/Dockerfile index 270cc4e..bb546a1 100644 --- a/package/deploy/Dockerfile +++ b/package/deploy/Dockerfile @@ -1,12 +1,11 @@ FROM registry.suse.com/bci/bci-base:15.6 -ARG ARCH=amd64 -ARG K8S_VERSION=v1.29.6 - +ARG TARGETARCH +ARG KUBECTL_VERSION=v1.30.2 RUN zypper -n install curl tar gzip ca-certificates bind-utils awk && \ zypper -n clean -a && rm -rf /tmp/* /var/tmp/* /usr/share/doc/packages/* && \ mkdir -p /certs && \ - curl -sLf https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/${ARCH}/kubectl > /bin/kubectl && \ + curl -sLf https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl > /bin/kubectl && \ curl -LO https://dl.k8s.io/easy-rsa/easy-rsa.tar.gz && \ tar xzf easy-rsa.tar.gz && mv easy-rsa-master/easyrsa3 /certs/ && rm -rf ./easy-rsa-master && \ chmod +x /bin/kubectl /certs/easyrsa3/easyrsa diff --git a/package/operator/Dockerfile b/package/operator/Dockerfile index aaac15f..b8a65c1 100644 --- a/package/operator/Dockerfile +++ b/package/operator/Dockerfile @@ -1,17 +1,16 @@ FROM registry.suse.com/bci/bci-base:15.6 +ARG TARGETARCH ARG LOGLEVEL_VERSION=v0.1.6 -ARG ARCH=amd64 - RUN zypper update -y && \ zypper in -y -f vim curl tar gzip && \ zypper clean -a && \ rm -rf /tmp/* /var/tmp/* /usr/share/doc/packages/* && \ - curl -sLf https://github.com/rancher/loglevel/releases/download/${LOGLEVEL_VERSION}/loglevel-${ARCH}-${LOGLEVEL_VERSION}.tar.gz | tar xvzf - -C /usr/bin + curl -sLf https://github.com/rancher/loglevel/releases/download/${LOGLEVEL_VERSION}/loglevel-${TARGETARCH}-${LOGLEVEL_VERSION}.tar.gz | tar xvzf - -C /usr/bin RUN useradd --uid 1007 rancher-flat-network-operator ENV KUBECONFIG /home/rancher-flat-network-operator/.kube/config -COPY bin/rancher-flat-network-operator /usr/bin/ +COPY dist/rancher-flat-network-operator_linux_${TARGETARCH}*/ /usr/bin/ COPY package/operator/entrypoint.sh / USER 1007 diff --git a/pkg/admission/server.go b/pkg/admission/server.go index d744e46..9041976 100644 --- a/pkg/admission/server.go +++ b/pkg/admission/server.go @@ -11,8 +11,8 @@ import ( "github.com/sirupsen/logrus" - "github.com/cnrancher/rancher-flat-network-operator/pkg/admission/webhook" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/wrangler" + "github.com/cnrancher/rancher-flat-network/pkg/admission/webhook" + "github.com/cnrancher/rancher-flat-network/pkg/controller/wrangler" ) type Server struct { diff --git a/pkg/admission/webhook/subnet.go b/pkg/admission/webhook/subnet.go index 62a48d1..330d254 100644 --- a/pkg/admission/webhook/subnet.go +++ b/pkg/admission/webhook/subnet.go @@ -6,12 +6,12 @@ import ( "net" "slices" - "github.com/cnrancher/rancher-flat-network-operator/pkg/ipcalc" + "github.com/cnrancher/rancher-flat-network/pkg/ipcalc" "github.com/sirupsen/logrus" admissionv1 "k8s.io/api/admission/v1" "k8s.io/apimachinery/pkg/labels" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" ) func deserializeMacvlanSubnet(ar *admissionv1.AdmissionReview) (*flv1.FlatNetworkSubnet, error) { diff --git a/pkg/admission/webhook/subnet_test.go b/pkg/admission/webhook/subnet_test.go index 4d51ad2..6fa779e 100644 --- a/pkg/admission/webhook/subnet_test.go +++ b/pkg/admission/webhook/subnet_test.go @@ -4,7 +4,7 @@ import ( "net" "testing" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" "github.com/stretchr/testify/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/pkg/admission/webhook/webhook.go b/pkg/admission/webhook/webhook.go index 322983d..adb411c 100644 --- a/pkg/admission/webhook/webhook.go +++ b/pkg/admission/webhook/webhook.go @@ -6,7 +6,7 @@ import ( "io" "net/http" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/wrangler" + "github.com/cnrancher/rancher-flat-network/pkg/controller/wrangler" "github.com/pkg/errors" "github.com/sirupsen/logrus" admissionv1 "k8s.io/api/admission/v1" @@ -14,10 +14,10 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" - appscontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/apps/v1" - batchcontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/batch/v1" - corecontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/core/v1" - flcontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/flatnetwork.pandaria.io/v1" + appscontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/apps/v1" + batchcontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/batch/v1" + corecontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/core/v1" + flcontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/flatnetwork.pandaria.io/v1" ) type Handler struct { diff --git a/pkg/admission/webhook/workload.go b/pkg/admission/webhook/workload.go index c35ba27..9453dbf 100644 --- a/pkg/admission/webhook/workload.go +++ b/pkg/admission/webhook/workload.go @@ -13,8 +13,8 @@ import ( batchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/ipcalc" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/ipcalc" ) type WorkloadReview struct { diff --git a/pkg/apis/flatnetwork.pandaria.io/v1/zz_generated_register.go b/pkg/apis/flatnetwork.pandaria.io/v1/zz_generated_register.go index 3c47d94..719457e 100644 --- a/pkg/apis/flatnetwork.pandaria.io/v1/zz_generated_register.go +++ b/pkg/apis/flatnetwork.pandaria.io/v1/zz_generated_register.go @@ -21,7 +21,7 @@ limitations under the License. package v1 import ( - flatnetwork "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io" + flatnetwork "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/cni/commands/add.go b/pkg/cni/commands/add.go index 52d4972..81aea48 100644 --- a/pkg/cni/commands/add.go +++ b/pkg/cni/commands/add.go @@ -7,14 +7,14 @@ import ( "net" "time" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/common" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/ipvlan" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/kubeclient" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/logger" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/macvlan" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/route" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/types" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/cni/common" + "github.com/cnrancher/rancher-flat-network/pkg/cni/ipvlan" + "github.com/cnrancher/rancher-flat-network/pkg/cni/kubeclient" + "github.com/cnrancher/rancher-flat-network/pkg/cni/logger" + "github.com/cnrancher/rancher-flat-network/pkg/cni/macvlan" + "github.com/cnrancher/rancher-flat-network/pkg/cni/route" + "github.com/cnrancher/rancher-flat-network/pkg/cni/types" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/containernetworking/cni/pkg/skel" "github.com/containernetworking/plugins/pkg/ip" "github.com/containernetworking/plugins/pkg/ipam" @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/util/retry" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" cnitypes "github.com/containernetworking/cni/pkg/types" types100 "github.com/containernetworking/cni/pkg/types/100" ) diff --git a/pkg/cni/commands/check.go b/pkg/cni/commands/check.go index fc3761a..2a9955d 100644 --- a/pkg/cni/commands/check.go +++ b/pkg/cni/commands/check.go @@ -4,13 +4,13 @@ import ( "context" "fmt" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/ipvlan" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/kubeclient" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/logger" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/macvlan" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/types" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/cni/ipvlan" + "github.com/cnrancher/rancher-flat-network/pkg/cni/kubeclient" + "github.com/cnrancher/rancher-flat-network/pkg/cni/logger" + "github.com/cnrancher/rancher-flat-network/pkg/cni/macvlan" + "github.com/cnrancher/rancher-flat-network/pkg/cni/types" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/containernetworking/cni/pkg/skel" cnitypes "github.com/containernetworking/cni/pkg/types" types100 "github.com/containernetworking/cni/pkg/types/100" diff --git a/pkg/cni/commands/common.go b/pkg/cni/commands/common.go index 5c38f09..5f85537 100644 --- a/pkg/cni/commands/common.go +++ b/pkg/cni/commands/common.go @@ -5,12 +5,12 @@ import ( "fmt" "net" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/common" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/types" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/cni/common" + "github.com/cnrancher/rancher-flat-network/pkg/cni/types" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/sirupsen/logrus" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" cnitypes "github.com/containernetworking/cni/pkg/types" "github.com/containernetworking/cni/pkg/types/create" ) diff --git a/pkg/cni/commands/del.go b/pkg/cni/commands/del.go index 971f79a..8945337 100644 --- a/pkg/cni/commands/del.go +++ b/pkg/cni/commands/del.go @@ -3,9 +3,9 @@ package commands import ( "fmt" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/logger" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/route" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/cni/logger" + "github.com/cnrancher/rancher-flat-network/pkg/cni/route" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/containernetworking/cni/pkg/skel" "github.com/containernetworking/plugins/pkg/ipam" "github.com/containernetworking/plugins/pkg/ns" diff --git a/pkg/cni/ipvlan/ipvlan.go b/pkg/cni/ipvlan/ipvlan.go index 0422e26..75fceb6 100644 --- a/pkg/cni/ipvlan/ipvlan.go +++ b/pkg/cni/ipvlan/ipvlan.go @@ -4,7 +4,7 @@ import ( "fmt" "net" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/utils" types100 "github.com/containernetworking/cni/pkg/types/100" "github.com/containernetworking/plugins/pkg/ip" "github.com/containernetworking/plugins/pkg/ns" diff --git a/pkg/cni/kubeclient/kubeclient.go b/pkg/cni/kubeclient/kubeclient.go index 0dcb6cd..7a8bd71 100644 --- a/pkg/cni/kubeclient/kubeclient.go +++ b/pkg/cni/kubeclient/kubeclient.go @@ -5,8 +5,8 @@ import ( "fmt" "strings" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - clientset "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + clientset "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned" "github.com/containernetworking/cni/pkg/skel" cnitypes "github.com/containernetworking/cni/pkg/types" "gopkg.in/k8snetworkplumbingwg/multus-cni.v4/pkg/types" diff --git a/pkg/cni/macvlan/macvlan.go b/pkg/cni/macvlan/macvlan.go index 6dfe70d..172222f 100644 --- a/pkg/cni/macvlan/macvlan.go +++ b/pkg/cni/macvlan/macvlan.go @@ -4,7 +4,7 @@ import ( "fmt" "net" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/utils" types100 "github.com/containernetworking/cni/pkg/types/100" "github.com/containernetworking/plugins/pkg/ip" "github.com/containernetworking/plugins/pkg/ns" diff --git a/pkg/cni/route/flatnetwork.go b/pkg/cni/route/flatnetwork.go index 88855ce..c2c44b3 100644 --- a/pkg/cni/route/flatnetwork.go +++ b/pkg/cni/route/flatnetwork.go @@ -5,8 +5,8 @@ import ( "net" "strings" - "github.com/cnrancher/rancher-flat-network-operator/pkg/cni/common" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/cni/common" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/containernetworking/plugins/pkg/ns" "github.com/sirupsen/logrus" "github.com/vishvananda/netlink" diff --git a/pkg/cni/route/route.go b/pkg/cni/route/route.go index 82e1dfc..9b5c68d 100644 --- a/pkg/cni/route/route.go +++ b/pkg/cni/route/route.go @@ -9,8 +9,8 @@ import ( "github.com/vishvananda/netlink" "github.com/vishvananda/netlink/nl" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/utils" ) // GetDefaultRoute gets default route diff --git a/pkg/codegen/main.go b/pkg/codegen/main.go index f33d23d..6a7b019 100755 --- a/pkg/codegen/main.go +++ b/pkg/codegen/main.go @@ -18,14 +18,14 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" - flatnetworkv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + flatnetworkv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" ) func main() { os.Unsetenv("GOPATH") controllergen.Run(args.Options{ - OutputPackage: "github.com/cnrancher/rancher-flat-network-operator/pkg/generated", + OutputPackage: "github.com/cnrancher/rancher-flat-network/pkg/generated", Boilerplate: "pkg/codegen/boilerplate.go.txt", Groups: map[string]args.Group{ "flatnetwork.pandaria.io": { diff --git a/pkg/controller/flatnetworkip/flatnetworkip.go b/pkg/controller/flatnetworkip/flatnetworkip.go index f353b3c..f112527 100644 --- a/pkg/controller/flatnetworkip/flatnetworkip.go +++ b/pkg/controller/flatnetworkip/flatnetworkip.go @@ -8,9 +8,9 @@ import ( "sync" "time" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/wrangler" - "github.com/cnrancher/rancher-flat-network-operator/pkg/ipcalc" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/controller/wrangler" + "github.com/cnrancher/rancher-flat-network/pkg/ipcalc" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -19,9 +19,9 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/client-go/util/retry" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - corecontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/core/v1" - flcontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/flatnetwork.pandaria.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + corecontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/core/v1" + flcontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/flatnetwork.pandaria.io/v1" ) const ( diff --git a/pkg/controller/flatnetworkip/flatnetworkip_test.go b/pkg/controller/flatnetworkip/flatnetworkip_test.go index 62835fd..6085900 100644 --- a/pkg/controller/flatnetworkip/flatnetworkip_test.go +++ b/pkg/controller/flatnetworkip/flatnetworkip_test.go @@ -4,8 +4,8 @@ import ( "net" "testing" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/ipcalc" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/ipcalc" "github.com/stretchr/testify/assert" ) diff --git a/pkg/controller/flatnetworkip/ipcalc.go b/pkg/controller/flatnetworkip/ipcalc.go index 905fb6f..eb6253e 100644 --- a/pkg/controller/flatnetworkip/ipcalc.go +++ b/pkg/controller/flatnetworkip/ipcalc.go @@ -4,8 +4,8 @@ import ( "fmt" "net" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/ipcalc" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/ipcalc" ) // alreadyAllocateIP checks if the flat-network IP already allocated diff --git a/pkg/controller/flatnetworkip/mac.go b/pkg/controller/flatnetworkip/mac.go index 62a0bf3..060f073 100644 --- a/pkg/controller/flatnetworkip/mac.go +++ b/pkg/controller/flatnetworkip/mac.go @@ -6,8 +6,8 @@ import ( "net" "slices" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/ipcalc" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/ipcalc" ) func alreadyAllocatedMAC(ip *flv1.FlatNetworkIP) bool { diff --git a/pkg/controller/flatnetworkip/remove.go b/pkg/controller/flatnetworkip/remove.go index eb29294..c328e1f 100644 --- a/pkg/controller/flatnetworkip/remove.go +++ b/pkg/controller/flatnetworkip/remove.go @@ -7,8 +7,8 @@ import ( "slices" "time" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/ipcalc" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/ipcalc" "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/controller/flatnetworksubnet/flatnetworksubnet.go b/pkg/controller/flatnetworksubnet/flatnetworksubnet.go index e40433e..60b07bd 100644 --- a/pkg/controller/flatnetworksubnet/flatnetworksubnet.go +++ b/pkg/controller/flatnetworksubnet/flatnetworksubnet.go @@ -8,9 +8,9 @@ import ( "slices" "time" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/wrangler" - "github.com/cnrancher/rancher-flat-network-operator/pkg/ipcalc" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/controller/wrangler" + "github.com/cnrancher/rancher-flat-network/pkg/ipcalc" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -18,9 +18,9 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/client-go/util/retry" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - corecontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/core/v1" - flcontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/flatnetwork.pandaria.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + corecontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/core/v1" + flcontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/flatnetwork.pandaria.io/v1" ) const ( diff --git a/pkg/controller/flatnetworksubnet/flatnetworksubnet_test.go b/pkg/controller/flatnetworksubnet/flatnetworksubnet_test.go index 3b2f1d4..03666f0 100644 --- a/pkg/controller/flatnetworksubnet/flatnetworksubnet_test.go +++ b/pkg/controller/flatnetworksubnet/flatnetworksubnet_test.go @@ -4,7 +4,7 @@ import ( "net" "testing" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" "github.com/stretchr/testify/assert" ) diff --git a/pkg/controller/flatnetworksubnet/remove.go b/pkg/controller/flatnetworksubnet/remove.go index 0cc5cf7..8c08744 100644 --- a/pkg/controller/flatnetworksubnet/remove.go +++ b/pkg/controller/flatnetworksubnet/remove.go @@ -4,8 +4,8 @@ import ( "fmt" "net" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/labels" ) diff --git a/pkg/controller/flatnetworksubnet/utils.go b/pkg/controller/flatnetworksubnet/utils.go index 61f868c..ec5d19c 100644 --- a/pkg/controller/flatnetworksubnet/utils.go +++ b/pkg/controller/flatnetworksubnet/utils.go @@ -4,7 +4,7 @@ import ( "bytes" "net" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" "github.com/sirupsen/logrus" ) diff --git a/pkg/controller/ingress/ingress.go b/pkg/controller/ingress/ingress.go index d7cec8e..56ab346 100644 --- a/pkg/controller/ingress/ingress.go +++ b/pkg/controller/ingress/ingress.go @@ -10,10 +10,10 @@ import ( networkingv1 "k8s.io/api/networking/v1" "k8s.io/apimachinery/pkg/api/errors" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/wrangler" - corecontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/core/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/controller/wrangler" + corecontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/core/v1" + "github.com/cnrancher/rancher-flat-network/pkg/utils" ) const ( diff --git a/pkg/controller/namespace/namespace.go b/pkg/controller/namespace/namespace.go index f7376ec..1c36261 100644 --- a/pkg/controller/namespace/namespace.go +++ b/pkg/controller/namespace/namespace.go @@ -11,9 +11,9 @@ import ( "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/wrangler" - corecontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/core/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/controller/wrangler" + corecontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/core/v1" + "github.com/cnrancher/rancher-flat-network/pkg/utils" k8scnicncfiov1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" ndClientSet "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned" ) diff --git a/pkg/controller/pod/pod.go b/pkg/controller/pod/pod.go index 0c0a8be..33c478a 100644 --- a/pkg/controller/pod/pod.go +++ b/pkg/controller/pod/pod.go @@ -6,19 +6,19 @@ import ( "strings" "time" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/wrangler" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/controller/wrangler" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/retry" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - appscontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/apps/v1" - batchcontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/batch/v1" - corecontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/core/v1" - flcontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/flatnetwork.pandaria.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + appscontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/apps/v1" + batchcontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/batch/v1" + corecontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/core/v1" + flcontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/flatnetwork.pandaria.io/v1" ) const ( diff --git a/pkg/controller/pod/utils.go b/pkg/controller/pod/utils.go index a73844c..53e639a 100644 --- a/pkg/controller/pod/utils.go +++ b/pkg/controller/pod/utils.go @@ -5,8 +5,8 @@ import ( "net" "strings" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" diff --git a/pkg/controller/pod/workload.go b/pkg/controller/pod/workload.go index 161526f..54d3350 100644 --- a/pkg/controller/pod/workload.go +++ b/pkg/controller/pod/workload.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/controller/service/endpoint.go b/pkg/controller/service/endpoint.go index d08c1e1..229c5f4 100644 --- a/pkg/controller/service/endpoint.go +++ b/pkg/controller/service/endpoint.go @@ -3,7 +3,7 @@ package service import ( "fmt" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" discoveryv1 "k8s.io/api/discovery/v1" diff --git a/pkg/controller/service/endpointslice.go b/pkg/controller/service/endpointslice.go index a2e1afd..0429673 100644 --- a/pkg/controller/service/endpointslice.go +++ b/pkg/controller/service/endpointslice.go @@ -5,7 +5,7 @@ import ( "sort" "strings" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" discoveryv1 "k8s.io/api/discovery/v1" diff --git a/pkg/controller/service/flatnetwork_service.go b/pkg/controller/service/flatnetwork_service.go index 600aedf..9aa00f2 100644 --- a/pkg/controller/service/flatnetwork_service.go +++ b/pkg/controller/service/flatnetwork_service.go @@ -5,8 +5,8 @@ import ( "strings" "time" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/pkg/controller/service/service.go b/pkg/controller/service/service.go index d04c29b..9ab2740 100644 --- a/pkg/controller/service/service.go +++ b/pkg/controller/service/service.go @@ -5,15 +5,15 @@ import ( "fmt" "time" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/wrangler" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/controller/wrangler" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/client-go/util/retry" - corecontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/core/v1" - discoverycontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/discovery.k8s.io/v1" + corecontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/core/v1" + discoverycontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/discovery.k8s.io/v1" ) const ( diff --git a/pkg/controller/service/utils.go b/pkg/controller/service/utils.go index 9b921b0..22ae845 100644 --- a/pkg/controller/service/utils.go +++ b/pkg/controller/service/utils.go @@ -8,7 +8,7 @@ import ( "regexp" "strings" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + "github.com/cnrancher/rancher-flat-network/pkg/utils" "github.com/pkg/errors" "github.com/sirupsen/logrus" "gopkg.in/k8snetworkplumbingwg/multus-cni.v4/pkg/types" @@ -21,7 +21,7 @@ import ( "k8s.io/kubernetes/pkg/api/v1/endpoints" podutil "k8s.io/kubernetes/pkg/api/v1/pod" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" nettypes "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" ) diff --git a/pkg/controller/workload/workload.go b/pkg/controller/workload/workload.go index 9b1685c..47df7e3 100644 --- a/pkg/controller/workload/workload.go +++ b/pkg/controller/workload/workload.go @@ -9,11 +9,11 @@ import ( batchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/controller/wrangler" - appscontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/apps/v1" - batchcontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/batch/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/controller/wrangler" + appscontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/apps/v1" + batchcontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/batch/v1" + "github.com/cnrancher/rancher-flat-network/pkg/utils" ) type Workload interface { diff --git a/pkg/controller/wrangler/context.go b/pkg/controller/wrangler/context.go index d986deb..c57b23a 100644 --- a/pkg/controller/wrangler/context.go +++ b/pkg/controller/wrangler/context.go @@ -4,14 +4,14 @@ import ( "context" "sync" - flscheme "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned/scheme" - "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/apps" - "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/batch" - "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/core" - corecontroller "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/core/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/discovery.k8s.io" - fl "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/flatnetwork.pandaria.io" - "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/networking.k8s.io" + flscheme "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned/scheme" + "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/apps" + "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/batch" + "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/core" + corecontroller "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/core/v1" + "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/discovery.k8s.io" + fl "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/flatnetwork.pandaria.io" + "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/networking.k8s.io" "github.com/rancher/lasso/pkg/controller" "github.com/rancher/wrangler/v3/pkg/leader" "github.com/rancher/wrangler/v3/pkg/start" @@ -25,11 +25,11 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" - appsv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/apps/v1" - batchv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/batch/v1" - discoveryv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/discovery.k8s.io/v1" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/flatnetwork.pandaria.io/v1" - networkingv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/networking.k8s.io/v1" + appsv1 "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/apps/v1" + batchv1 "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/batch/v1" + discoveryv1 "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/discovery.k8s.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/flatnetwork.pandaria.io/v1" + networkingv1 "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/networking.k8s.io/v1" ndClientSet "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned" ) diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index cb72670..2993331 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -22,7 +22,7 @@ import ( "fmt" "net/http" - flatnetworkv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1" + flatnetworkv1 "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index 2324dd2..65cd4df 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -19,9 +19,9 @@ limitations under the License. package fake import ( - clientset "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned" - flatnetworkv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1" - fakeflatnetworkv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake" + clientset "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned" + flatnetworkv1 "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1" + fakeflatnetworkv1 "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go index 703b1dc..96c5b2e 100644 --- a/pkg/generated/clientset/versioned/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - flatnetworkv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + flatnetworkv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go index 38edcb6..6eb2f43 100644 --- a/pkg/generated/clientset/versioned/scheme/register.go +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -19,7 +19,7 @@ limitations under the License. package scheme import ( - flatnetworkv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + flatnetworkv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake/fake_flatnetwork.pandaria.io_client.go b/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake/fake_flatnetwork.pandaria.io_client.go index 4786839..baae4ed 100644 --- a/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake/fake_flatnetwork.pandaria.io_client.go +++ b/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake/fake_flatnetwork.pandaria.io_client.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) diff --git a/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake/fake_flatnetworkip.go b/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake/fake_flatnetworkip.go index 07fd1a6..6b1ce59 100644 --- a/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake/fake_flatnetworkip.go +++ b/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake/fake_flatnetworkip.go @@ -21,7 +21,7 @@ package fake import ( "context" - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" diff --git a/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake/fake_flatnetworksubnet.go b/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake/fake_flatnetworksubnet.go index 0dd3828..abca4ef 100644 --- a/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake/fake_flatnetworksubnet.go +++ b/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/fake/fake_flatnetworksubnet.go @@ -21,7 +21,7 @@ package fake import ( "context" - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" diff --git a/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/flatnetwork.pandaria.io_client.go b/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/flatnetwork.pandaria.io_client.go index d71e2ba..8c6b951 100644 --- a/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/flatnetwork.pandaria.io_client.go +++ b/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/flatnetwork.pandaria.io_client.go @@ -21,8 +21,8 @@ package v1 import ( "net/http" - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned/scheme" + v1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) diff --git a/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/flatnetworkip.go b/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/flatnetworkip.go index dd30c4d..e128b66 100644 --- a/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/flatnetworkip.go +++ b/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/flatnetworkip.go @@ -22,8 +22,8 @@ import ( "context" "time" - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - scheme "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned/scheme" + v1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + scheme "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/flatnetworksubnet.go b/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/flatnetworksubnet.go index 04da4eb..ff73bf8 100644 --- a/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/flatnetworksubnet.go +++ b/pkg/generated/clientset/versioned/typed/flatnetwork.pandaria.io/v1/flatnetworksubnet.go @@ -22,8 +22,8 @@ import ( "context" "time" - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - scheme "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned/scheme" + v1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + scheme "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/generated/controllers/apps/interface.go b/pkg/generated/controllers/apps/interface.go index bb85d07..bd93553 100644 --- a/pkg/generated/controllers/apps/interface.go +++ b/pkg/generated/controllers/apps/interface.go @@ -19,7 +19,7 @@ limitations under the License. package apps import ( - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/apps/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/apps/v1" "github.com/rancher/lasso/pkg/controller" ) diff --git a/pkg/generated/controllers/batch/interface.go b/pkg/generated/controllers/batch/interface.go index cbd46fd..ee48618 100644 --- a/pkg/generated/controllers/batch/interface.go +++ b/pkg/generated/controllers/batch/interface.go @@ -19,7 +19,7 @@ limitations under the License. package batch import ( - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/batch/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/batch/v1" "github.com/rancher/lasso/pkg/controller" ) diff --git a/pkg/generated/controllers/core/interface.go b/pkg/generated/controllers/core/interface.go index 3bd5430..a401b90 100644 --- a/pkg/generated/controllers/core/interface.go +++ b/pkg/generated/controllers/core/interface.go @@ -19,7 +19,7 @@ limitations under the License. package core import ( - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/core/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/core/v1" "github.com/rancher/lasso/pkg/controller" ) diff --git a/pkg/generated/controllers/discovery.k8s.io/interface.go b/pkg/generated/controllers/discovery.k8s.io/interface.go index b16c441..491c1bc 100644 --- a/pkg/generated/controllers/discovery.k8s.io/interface.go +++ b/pkg/generated/controllers/discovery.k8s.io/interface.go @@ -19,7 +19,7 @@ limitations under the License. package discovery import ( - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/discovery.k8s.io/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/discovery.k8s.io/v1" "github.com/rancher/lasso/pkg/controller" ) diff --git a/pkg/generated/controllers/flatnetwork.pandaria.io/interface.go b/pkg/generated/controllers/flatnetwork.pandaria.io/interface.go index fb6507c..1655809 100644 --- a/pkg/generated/controllers/flatnetwork.pandaria.io/interface.go +++ b/pkg/generated/controllers/flatnetwork.pandaria.io/interface.go @@ -19,7 +19,7 @@ limitations under the License. package flatnetwork import ( - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/flatnetwork.pandaria.io/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/flatnetwork.pandaria.io/v1" "github.com/rancher/lasso/pkg/controller" ) diff --git a/pkg/generated/controllers/flatnetwork.pandaria.io/v1/flatnetworkip.go b/pkg/generated/controllers/flatnetwork.pandaria.io/v1/flatnetworkip.go index 49a176f..162017e 100644 --- a/pkg/generated/controllers/flatnetwork.pandaria.io/v1/flatnetworkip.go +++ b/pkg/generated/controllers/flatnetwork.pandaria.io/v1/flatnetworkip.go @@ -23,7 +23,7 @@ import ( "sync" "time" - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" "github.com/rancher/wrangler/v3/pkg/apply" "github.com/rancher/wrangler/v3/pkg/condition" "github.com/rancher/wrangler/v3/pkg/generic" diff --git a/pkg/generated/controllers/flatnetwork.pandaria.io/v1/flatnetworksubnet.go b/pkg/generated/controllers/flatnetwork.pandaria.io/v1/flatnetworksubnet.go index b80f1a8..4330166 100644 --- a/pkg/generated/controllers/flatnetwork.pandaria.io/v1/flatnetworksubnet.go +++ b/pkg/generated/controllers/flatnetwork.pandaria.io/v1/flatnetworksubnet.go @@ -23,7 +23,7 @@ import ( "sync" "time" - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" "github.com/rancher/wrangler/v3/pkg/apply" "github.com/rancher/wrangler/v3/pkg/condition" "github.com/rancher/wrangler/v3/pkg/generic" diff --git a/pkg/generated/controllers/flatnetwork.pandaria.io/v1/interface.go b/pkg/generated/controllers/flatnetwork.pandaria.io/v1/interface.go index 6e1f765..9aabe9c 100644 --- a/pkg/generated/controllers/flatnetwork.pandaria.io/v1/interface.go +++ b/pkg/generated/controllers/flatnetwork.pandaria.io/v1/interface.go @@ -19,7 +19,7 @@ limitations under the License. package v1 import ( - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" "github.com/rancher/lasso/pkg/controller" "github.com/rancher/wrangler/v3/pkg/generic" "github.com/rancher/wrangler/v3/pkg/schemes" diff --git a/pkg/generated/controllers/networking.k8s.io/interface.go b/pkg/generated/controllers/networking.k8s.io/interface.go index 5f86d31..a230456 100644 --- a/pkg/generated/controllers/networking.k8s.io/interface.go +++ b/pkg/generated/controllers/networking.k8s.io/interface.go @@ -19,7 +19,7 @@ limitations under the License. package networking import ( - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/controllers/networking.k8s.io/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/generated/controllers/networking.k8s.io/v1" "github.com/rancher/lasso/pkg/controller" ) diff --git a/pkg/generated/informers/externalversions/factory.go b/pkg/generated/informers/externalversions/factory.go index 561a895..f4c6c3d 100644 --- a/pkg/generated/informers/externalversions/factory.go +++ b/pkg/generated/informers/externalversions/factory.go @@ -23,9 +23,9 @@ import ( sync "sync" time "time" - versioned "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned" - flatnetworkpandariaio "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/informers/externalversions/flatnetwork.pandaria.io" - internalinterfaces "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/informers/externalversions/internalinterfaces" + versioned "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned" + flatnetworkpandariaio "github.com/cnrancher/rancher-flat-network/pkg/generated/informers/externalversions/flatnetwork.pandaria.io" + internalinterfaces "github.com/cnrancher/rancher-flat-network/pkg/generated/informers/externalversions/internalinterfaces" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/interface.go b/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/interface.go index f26297b..eb04189 100644 --- a/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/interface.go +++ b/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/interface.go @@ -19,8 +19,8 @@ limitations under the License. package flatnetwork import ( - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1" - internalinterfaces "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/informers/externalversions/internalinterfaces" + v1 "github.com/cnrancher/rancher-flat-network/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1" + internalinterfaces "github.com/cnrancher/rancher-flat-network/pkg/generated/informers/externalversions/internalinterfaces" ) // Interface provides access to each of this group's versions. diff --git a/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1/flatnetworkip.go b/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1/flatnetworkip.go index db15afb..5611d67 100644 --- a/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1/flatnetworkip.go +++ b/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1/flatnetworkip.go @@ -22,10 +22,10 @@ import ( "context" time "time" - flatnetworkpandariaiov1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - versioned "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned" - internalinterfaces "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/informers/externalversions/internalinterfaces" - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/listers/flatnetwork.pandaria.io/v1" + flatnetworkpandariaiov1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + versioned "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned" + internalinterfaces "github.com/cnrancher/rancher-flat-network/pkg/generated/informers/externalversions/internalinterfaces" + v1 "github.com/cnrancher/rancher-flat-network/pkg/generated/listers/flatnetwork.pandaria.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1/flatnetworksubnet.go b/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1/flatnetworksubnet.go index 28756f3..064e010 100644 --- a/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1/flatnetworksubnet.go +++ b/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1/flatnetworksubnet.go @@ -22,10 +22,10 @@ import ( "context" time "time" - flatnetworkpandariaiov1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - versioned "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned" - internalinterfaces "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/informers/externalversions/internalinterfaces" - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/listers/flatnetwork.pandaria.io/v1" + flatnetworkpandariaiov1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + versioned "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned" + internalinterfaces "github.com/cnrancher/rancher-flat-network/pkg/generated/informers/externalversions/internalinterfaces" + v1 "github.com/cnrancher/rancher-flat-network/pkg/generated/listers/flatnetwork.pandaria.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1/interface.go b/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1/interface.go index 085ac5d..ec5f26e 100644 --- a/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1/interface.go +++ b/pkg/generated/informers/externalversions/flatnetwork.pandaria.io/v1/interface.go @@ -19,7 +19,7 @@ limitations under the License. package v1 import ( - internalinterfaces "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/informers/externalversions/internalinterfaces" + internalinterfaces "github.com/cnrancher/rancher-flat-network/pkg/generated/informers/externalversions/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index f1a429a..ecc2df1 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -21,7 +21,7 @@ package externalversions import ( "fmt" - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) diff --git a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go index 4bb3e39..2eac914 100644 --- a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -21,7 +21,7 @@ package internalinterfaces import ( time "time" - versioned "github.com/cnrancher/rancher-flat-network-operator/pkg/generated/clientset/versioned" + versioned "github.com/cnrancher/rancher-flat-network/pkg/generated/clientset/versioned" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" diff --git a/pkg/generated/listers/flatnetwork.pandaria.io/v1/flatnetworkip.go b/pkg/generated/listers/flatnetwork.pandaria.io/v1/flatnetworkip.go index 2f991c3..a297d6d 100644 --- a/pkg/generated/listers/flatnetwork.pandaria.io/v1/flatnetworkip.go +++ b/pkg/generated/listers/flatnetwork.pandaria.io/v1/flatnetworkip.go @@ -19,7 +19,7 @@ limitations under the License. package v1 import ( - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/generated/listers/flatnetwork.pandaria.io/v1/flatnetworksubnet.go b/pkg/generated/listers/flatnetwork.pandaria.io/v1/flatnetworksubnet.go index 340043e..1bb0525 100644 --- a/pkg/generated/listers/flatnetwork.pandaria.io/v1/flatnetworksubnet.go +++ b/pkg/generated/listers/flatnetwork.pandaria.io/v1/flatnetworksubnet.go @@ -19,7 +19,7 @@ limitations under the License. package v1 import ( - v1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + v1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/ipcalc/ipcalc.go b/pkg/ipcalc/ipcalc.go index 46ebfd7..05aea0b 100644 --- a/pkg/ipcalc/ipcalc.go +++ b/pkg/ipcalc/ipcalc.go @@ -7,8 +7,8 @@ import ( "net" "slices" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" - "github.com/cnrancher/rancher-flat-network-operator/pkg/utils" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" + "github.com/cnrancher/rancher-flat-network/pkg/utils" ) var ( diff --git a/pkg/ipcalc/ipcalc_test.go b/pkg/ipcalc/ipcalc_test.go index 665f99b..0355e3f 100644 --- a/pkg/ipcalc/ipcalc_test.go +++ b/pkg/ipcalc/ipcalc_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" "github.com/stretchr/testify/assert" ) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 525a4c5..117c30e 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - flv1 "github.com/cnrancher/rancher-flat-network-operator/pkg/apis/flatnetwork.pandaria.io/v1" + flv1 "github.com/cnrancher/rancher-flat-network/pkg/apis/flatnetwork.pandaria.io/v1" "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" ) diff --git a/scripts/build.sh b/scripts/build.sh deleted file mode 100755 index 7bc9b6b..0000000 --- a/scripts/build.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -cd $(dirname $0)/../ -WORKINGDIR=$(pwd) - -source ./scripts/version.sh -echo "Version: ${VERSION}" - -BUILD_FLAG="" -if [[ -z "${DEBUG:-}" ]]; then - BUILD_FLAG="-extldflags -static -s -w" -fi -if [[ "${COMMIT}" != "UNKNOW" ]]; then - BUILD_FLAG="${BUILD_FLAG} -X 'github.com/cnrancher/rancher-flat-network-operator/pkg/utils.GitCommit=${COMMIT}'" -fi -BUILD_FLAG="${BUILD_FLAG} -X 'github.com/cnrancher/rancher-flat-network-operator/pkg/utils.Version=${VERSION}'" - -mkdir -p bin && cd bin -echo "Build rancher-flat-network-operator..." -CGO_ENABLED=0 go build -ldflags "${BUILD_FLAG}" -o rancher-flat-network-operator .. -echo "Build rancher-flat-network-cni..." -CGO_ENABLED=0 go build -ldflags "${BUILD_FLAG}" -o rancher-flat-network-cni ../cni/ - -echo "--------------------" -ls -alh rancher-flat-network-operator -ls -alh rancher-flat-network-cni -echo "--------------------" diff --git a/scripts/package-helm.sh b/scripts/chart.sh similarity index 58% rename from scripts/package-helm.sh rename to scripts/chart.sh index 972485c..ef9a026 100755 --- a/scripts/package-helm.sh +++ b/scripts/chart.sh @@ -2,25 +2,25 @@ set -euo pipefail -if ! hash helm 2>/dev/null; then - exit 0 -fi +cd $(dirname $0)/../ -cd $(dirname $0)/.. -WORKINGDIR=$(pwd) -source ./scripts/version.sh +type helm > /dev/null +TAG=${TAG:-'latest'} + +# Cleanup rm -rf build/charts &> /dev/null || true mkdir -p build dist/artifacts &> /dev/null || true cp -rf charts build/ &> /dev/null || true +# Update version sed -i \ - -e 's/^version:.*/version: '${HELM_VERSION}'/' \ - -e 's/appVersion:.*/appVersion: '${HELM_VERSION}'/' \ + -e 's/^version:.*/version: '${TAG/v/}'/' \ + -e 's/appVersion:.*/appVersion: '${TAG/v/}'/' \ build/charts/rancher-flat-network/Chart.yaml sed -i \ - -e 's/tag:.*/tag: '${HELM_TAG}'/' \ + -e 's/tag:.*/tag: '${TAG}'/' \ build/charts/rancher-flat-network/values.yaml helm package -d ./dist/artifacts ./build/charts/rancher-flat-network diff --git a/scripts/image-push.sh b/scripts/image-push.sh deleted file mode 100755 index 1716b1e..0000000 --- a/scripts/image-push.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -cd $(dirname $0)/../ - -source scripts/version.sh - -BUILDER='cnrancher' -TARGET_PLATFORMS='linux/amd64,linux/arm64' - -docker buildx ls | grep ${BUILDER} || \ - docker buildx create --name=${BUILDER} --platform=${TARGET_PLATFORMS} - -set -x - -IMAGE="${REPO}/rancher-flat-network-operator:${TAG}" -docker buildx build -f package/operator/Dockerfile \ - --builder ${BUILDER} --build-arg VERSION=${TAG} \ - -t "$IMAGE" \ - --platform=${TARGET_PLATFORMS} --push . -echo "Pushed $IMAGE" - -IMAGE="${REPO}/rancher-flat-network-deploy:${TAG}" -docker buildx build -f package/deploy/Dockerfile \ - --builder ${BUILDER} --build-arg VERSION=${TAG} \ - -t "$IMAGE" \ - --platform=${TARGET_PLATFORMS} --push . -echo "Pushed $IMAGE" - -IMAGE="${REPO}/rancher-flat-network-cni:${TAG}" -docker buildx build -f package/cni/Dockerfile \ - --builder ${BUILDER} --build-arg VERSION=${TAG} \ - -t "$IMAGE" \ - --platform=${TARGET_PLATFORMS} --push . -echo "Pushed $IMAGE" diff --git a/scripts/image.sh b/scripts/image.sh index 17b53df..52d4693 100755 --- a/scripts/image.sh +++ b/scripts/image.sh @@ -4,33 +4,36 @@ set -euo pipefail cd $(dirname $0)/../ -source scripts/version.sh +REPO=${REPO:-'cnrancher'} +TAG=${TAG:-'latest'} +BUILDER='rancher-flat-network' +TARGET_PLATFORMS='linux/arm64,linux/amd64' -BUILDER='cnrancher' -TARGET_PLATFORMS='linux/amd64,linux/arm64' +LOGLEVEL_VERSION=${LOGLEVEL_VERSION:-'v0.1.6'} +STATIC_IPAM_VERSION=${STATIC_IPAM_VERSION:-'v1.5.1'} +KUBECTL_VERSION=${KUBECTL_VERSION:-'v1.30.2'} + +BUILDX_OPTIONS=${BUILDX_OPTIONS:-''} # Set to '--push' to upload images docker buildx ls | grep ${BUILDER} || \ docker buildx create --name=${BUILDER} --platform=${TARGET_PLATFORMS} +echo "Start build images" set -x -IMAGE="${REPO}/rancher-flat-network-operator:${TAG}" docker buildx build -f package/operator/Dockerfile \ - --builder ${BUILDER} --build-arg VERSION=${TAG} \ - -t "$IMAGE" \ - --platform=${TARGET_PLATFORMS} . -echo "Build $IMAGE" + --builder ${BUILDER} --build-arg LOGLEVEL_VERSION=${LOGLEVEL_VERSION} \ + -t "${REPO}/rancher-flat-network-operator:${TAG}" \ + --platform=${TARGET_PLATFORMS} ${BUILDX_OPTIONS} . + +docker buildx build -f package/cni/Dockerfile \ + --builder ${BUILDER} --build-arg STATIC_IPAM_VERSION=${STATIC_IPAM_VERSION} \ + -t "${REPO}/rancher-flat-network-cni:${TAG}" \ + --platform=${TARGET_PLATFORMS} ${BUILDX_OPTIONS} . -IMAGE="${REPO}/rancher-flat-network-deploy:${TAG}" docker buildx build -f package/deploy/Dockerfile \ - --builder ${BUILDER} --build-arg VERSION=${TAG} \ - -t "$IMAGE" \ - --platform=${TARGET_PLATFORMS} . -echo "Build $IMAGE" + --builder ${BUILDER} --build-arg KUBECTL_VERSION=${KUBECTL_VERSION} \ + -t "${REPO}/rancher-flat-network-deploy:${TAG}" \ + --platform=${TARGET_PLATFORMS} ${BUILDX_OPTIONS} . -IMAGE="${REPO}/rancher-flat-network-cni:${TAG}" -docker buildx build -f package/cni/Dockerfile \ - --builder ${BUILDER} --build-arg VERSION=${TAG} \ - -t "$IMAGE" \ - --platform=${TARGET_PLATFORMS} . -echo "Build $IMAGE" +echo "Image: Done" diff --git a/scripts/package.sh b/scripts/package.sh deleted file mode 100755 index 7540251..0000000 --- a/scripts/package.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -source $(dirname $0)/version.sh -cd $(dirname $0)/.. -WORKINGDIR=$(pwd) - -mkdir -p dist/artifacts -cp bin/rancher-flat-network-operator dist/artifacts/rancher-flat-network-operator${SUFFIX} -cp bin/rancher-flat-network-cni dist/artifacts/rancher-flat-network-cni${SUFFIX} - -./scripts/package-helm.sh diff --git a/scripts/validate.sh b/scripts/verify.sh similarity index 100% rename from scripts/validate.sh rename to scripts/verify.sh diff --git a/scripts/version.sh b/scripts/version.sh deleted file mode 100755 index b3b6f00..0000000 --- a/scripts/version.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# Ensure git installed -type git > /dev/null - -DIRTY="" -if [[ -n "$(git status --porcelain --untracked-files=no)" ]]; then - DIRTY="-dirty" -fi - -COMMIT=$(git rev-parse --short HEAD) -GIT_TAG=${DRONE_TAG:-$(git tag -l --contains HEAD | head -n 1)} - -if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then - VERSION=$GIT_TAG -else - VERSION="v0.0.0-${COMMIT}${DIRTY}" -fi - -if [[ -z "${ARCH:-}" ]]; then - ARCH=$(go env GOHOSTARCH) -fi -if [[ -z "${OS:-}" ]]; then - OS=$(go env GOHOSTOS) -fi - -SUFFIX="-${OS}-${ARCH}" -HELM_TAG=${TAG:-"${VERSION}"} -HELM_VERSION=${HELM_TAG/v/} -TAG=${TAG:-${VERSION}${SUFFIX}} -REPO=${REPO:-cnrancher} - -if [[ $TAG = v0.0.0-* ]]; then - TAG=dev - HELM_TAG=dev - HELM_VERSION="0.0.0-dev" - DEBUG="true" -fi - -if [[ ${VERSION} = *rc* ]] || [[ ${VERSION} = *alpha* ]] || [[ ${VERSION} = *beta* ]]; then - DEBUG="true" -fi