diff --git a/.github/workflows/dockers-dev-container-image.yml b/.github/workflows/dockers-dev-container-image.yml index 99614d4f57..06fa55b581 100644 --- a/.github/workflows/dockers-dev-container-image.yml +++ b/.github/workflows/dockers-dev-container-image.yml @@ -22,22 +22,31 @@ on: - ".github/actions/docker-build/actions.yaml" - ".github/workflows/_docker-image.yaml" - ".github/workflows/dockers-dev-container-image.yml" - - "dockers/ci/**" - "dockers/dev/**" + - "Makefile" + - "Makefile.d/**" + - "versions/GO_VERSION" + - "versions/NGT_VERSION" pull_request: paths: - ".github/actions/docker-build/actions.yaml" - ".github/workflows/_docker-image.yaml" - ".github/workflows/dockers-dev-container-image.yml" - - "dockers/ci/**" - "dockers/dev/**" + - "Makefile" + - "Makefile.d/**" + - "versions/GO_VERSION" + - "versions/NGT_VERSION" pull_request_target: paths: - ".github/actions/docker-build/actions.yaml" - ".github/workflows/_docker-image.yaml" - ".github/workflows/dockers-dev-container-image.yml" - - "dockers/ci/**" - "dockers/dev/**" + - "Makefile" + - "Makefile.d/**" + - "versions/GO_VERSION" + - "versions/NGT_VERSION" schedule: - cron: "0 1 * * *" diff --git a/Makefile b/Makefile index 06f7c4775b..6770023c93 100644 --- a/Makefile +++ b/Makefile @@ -579,3 +579,4 @@ include Makefile.d/kind.mk include Makefile.d/proto.mk include Makefile.d/test.mk include Makefile.d/tools.mk +include Makefile.d/minikube.mk diff --git a/Makefile.d/minikube.mk b/Makefile.d/minikube.mk new file mode 100644 index 0000000000..7ba03e8440 --- /dev/null +++ b/Makefile.d/minikube.mk @@ -0,0 +1,42 @@ +# +# Copyright (C) 2019-2023 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +.PHONY: minikube/install +minikube/install: $(BINDIR)/minikube + +$(BINDIR)/minikube: + mkdir -p $(BINDIR) + curl -L https://storage.googleapis.com/minikube/releases/latest/minikube-$(shell echo $(UNAME) | tr '[:upper:]' '[:lower:]')-$(subst x86_64,amd64,$(shell echo $(ARCH) | tr '[:upper:]' '[:lower:]')) -o $(BINDIR)/minikube + chmod a+x $(BINDIR)/minikube + +# Start minikube with CSI Driver and Volume Snapshots support +# Only use this for development related to Volume Snapshots. Usually k3d is faster. +.PHONY: minikube/start +minikube/start: + minikube start --force + minikube addons enable volumesnapshots + minikube addons enable csi-hostpath-driver + minikube addons disable storage-provisioner + minikube addons disable default-storageclass + kubectl patch storageclass csi-hostpath-sc -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' + +.PHONY: minikube/delete +minikube/delete: + minikube delete + +.PHONY: minikube/restart +minikube/restart: + @make minikube/delete + @make minikube/start diff --git a/Makefile.d/proto.mk b/Makefile.d/proto.mk index a30940bbf1..2462f8e646 100644 --- a/Makefile.d/proto.mk +++ b/Makefile.d/proto.mk @@ -58,8 +58,7 @@ proto/deps: \ $(GOPATH)/src/github.com/planetscale/vtprotobuf \ $(GOPATH)/src/github.com/protocolbuffers/protobuf \ $(GOPATH)/src/google.golang.org/genproto \ - $(GOPATH)/src/google.golang.org/protobuf \ - $(ROOTDIR)/apis/proto/v1/rpc/error_details.proto + $(GOPATH)/src/google.golang.org/protobuf .PHONY: proto/clean/deps ## uninstall all protobuf dependencies @@ -79,8 +78,7 @@ proto/clean/deps: $(GOPATH)/src/github.com/planetscale/vtprotobuf \ $(GOPATH)/src/github.com/protocolbuffers/protobuf \ $(GOPATH)/src/google.golang.org/genproto \ - $(GOPATH)/src/google.golang.org/protobuf \ - $(ROOTDIR)/apis/proto/v1/rpc/error_details.proto + $(GOPATH)/src/google.golang.org/protobuf $(GOPATH)/src/github.com/protocolbuffers/protobuf: diff --git a/dockers/dev/Dockerfile b/dockers/dev/Dockerfile index c967b34c55..1253743ad7 100644 --- a/dockers/dev/Dockerfile +++ b/dockers/dev/Dockerfile @@ -64,4 +64,5 @@ RUN make deps \ # additional deps RUN make k3d/install \ && make buf/install \ - && make k9s/install + && make k9s/install \ + && make minikube/install