手动编译可能会遇到卡在 lint 校验,依赖文件无法拉取的问题,举个例子
比如这边我只改动了kube-ovn-controller,
那么就禁用lint,仅编译kube-ovn-controller,将外链文件转到内部直接下载
[root@hci-dev-mst-1 kube-ovn]# git diff
diff --git a/Makefile b/Makefile
index fc571c74..867939c0 100644
--- a/Makefile
+++ b/Makefile
@@ -65,12 +65,8 @@ base-arm64:
docker buildx build --platform linux/arm64 --build-arg ARCH=arm64 -t $(REGISTRY)/kube-ovn-base:$(RELEASE_TAG)-arm64 -o type=docker -f dist/images/Dockerfile.base dist/images/
.PHONY: release
-release: lint build-go
+release: build-go
docker buildx build --platform linux/amd64 --build-arg ARCH=amd64 -t $(REGISTRY)/kube-ovn:$(RELEASE_TAG) -o type=docker -f dist/images/Dockerfile dist/images/
- docker buildx build --platform linux/amd64 --build-arg ARCH=amd64 -t $(REGISTRY)/kube-ovn:$(RELEASE_TAG)-dpdk -o type=docker -f dist/images/Dockerfile.dpdk dist/images/
- docker buildx build --platform linux/amd64 --build-arg ARCH=amd64 -t $(REGISTRY)/vpc-nat-gateway:$(RELEASE_TAG) -o type=docker -f dist/images/vpcnatgateway/Dockerfile dist/images/vpcnatgateway
- docker buildx build --platform linux/amd64 --build-arg ARCH=amd64 -t $(REGISTRY)/centos7-compile:$(RELEASE_TAG) -o type=docker -f dist/images/compile/centos7/Dockerfile fastpath/
-# docker buildx build --platform linux/amd64 --build-arg ARCH=amd64 -t $(REGISTRY)/centos8-compile:$(RELEASE_TAG) -o type=docker -f dist/images/compile/centos8/Dockerfile fastpath/
.PHONY: release-arm
release-arm: build-go-arm
diff --git a/dist/images/Dockerfile b/dist/images/Dockerfile
index cfceeaef..630a1727 100644
--- a/dist/images/Dockerfile
+++ b/dist/images/Dockerfile
@@ -3,10 +3,8 @@ FROM kubeovn/kube-ovn-base:v1.10.0
ARG ARCH
ENV DUMB_INIT_VERSION="1.2.5"
-RUN dump_arch="x86_64"; \
- if [ "$ARCH" = "arm64" ]; then dump_arch="aarch64"; fi; \
- curl -sSf -L --retry 5 -o /usr/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_${dump_arch} && \
- chmod +x /usr/bin/dumb-init
+RUN curl -sSf -L --retry 5 -o /usr/bin/dumb-init http://10.120.25.50:8000/dumb-init_1.2.5_x86_64
+RUN chmod +x /usr/bin/dumb-init
COPY *.sh /kube-ovn/
COPY kubectl-ko /kube-ovn/kubectl-ko
diff --git a/pkg/controller/vpc_nat_gateway.go b/pkg/controller/vpc_nat_gateway.go
index f05d7113..035f7d03 100644
--- a/pkg/controller/vpc_nat_gateway.go
+++ b/pkg/controller/vpc_nat_gateway.go
@@ -271,16 +271,7 @@ func (c *Controller) handleAddOrUpdateVpcNatGw(key string) error {
return err
}
return nil
- } else {
- _, err := c.config.KubeClient.AppsV1().Deployments(c.config.PodNamespace).
- Update(context.Background(), newDp, metav1.UpdateOptions{})
-
- if err != nil {
- klog.Errorf("failed to update deployment '%s', err: %v", newDp.Name, err)
- return err
- }
}
-
pod, err := c.getNatGwPod(key)
if err != nil {
if k8serrors.IsNotFound(err) {
网友评论