Skip to content

Commit

Permalink
Merge pull request #5149 from RainbowMango/pr_skip_modify_proto_in_ve…
Browse files Browse the repository at this point in the history
…ndor

Skip generating proto for kubernetes apis in vendor
  • Loading branch information
karmada-bot committed Jul 8, 2024
2 parents c8acebc + 07dfd3a commit 39d17e4
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions hack/update-estimator-protobuf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,20 @@ PACKAGES=(
)

APIMACHINERY_PKGS=(
+k8s.io/apimachinery/pkg/util/intstr
+k8s.io/apimachinery/pkg/api/resource
+k8s.io/apimachinery/pkg/runtime/schema
+k8s.io/apimachinery/pkg/runtime
k8s.io/apimachinery/pkg/apis/meta/v1
k8s.io/api/core/v1
-k8s.io/apimachinery/pkg/util/intstr
-k8s.io/apimachinery/pkg/api/resource
-k8s.io/apimachinery/pkg/runtime/schema
-k8s.io/apimachinery/pkg/runtime
-k8s.io/apimachinery/pkg/apis/meta/v1
-k8s.io/api/core/v1
)

go-to-protobuf \
--go-header-file=./hack/boilerplate/boilerplate.go.txt \
--apimachinery-packages=$(IFS=, ; echo "${APIMACHINERY_PKGS[*]}") \
--packages=$(IFS=, ; echo "${PACKAGES[*]}") \
--proto-import="${KARMADA_ROOT}/vendor" \
--proto-import="${KARMADA_ROOT}/third_party/protobuf"
--proto-import="${KARMADA_ROOT}/third_party/protobuf" \
--output-base="${GOPATH}/src"

go generate ./pkg/estimator/service

# The `go-to-protobuf` tool will modify all import proto files in vendor, so we should use go mod vendor to prevent.
export GOPATH=${DEFAULT_GOPATH}
go mod vendor

0 comments on commit 39d17e4

Please sign in to comment.