keda
keda copied to clipboard
[WIP] re-introduce vendor to satisfy reproducible builds requirement
re-introduce vendor to satisfy reproducible builds requirement
Checklist
- [x] Commits are signed with Developer Certificate of Origin (DCO - learn more)
- [ ] Changelog has been updated and is aligned with our changelog requirements
Fixes #3509
/run-e2e internal* Update: You can check the progress here
Can't approve from mobile, > 10k files changed and more than 3kk rows. Is it okey?
Didn't you read all of them?
I am not able to convince mockgen
to properly generate mocks from files in vendor
directory :(
Hava tried several things, something like this:
pkg/mock/mock_scale/mock_interfaces.go: $(shell pwd)/vendor/k8s.io/client-go/scale/interfaces.go
$(MOCKGEN) -destination=$@ -package=mock_scale -source=$^ -build_flags=-mod=vendor
pkg/mock/mock_client/mock_interfaces.go: $(shell pwd)/vendor/sigs.k8s.io/controller-runtime/pkg/client/interfaces.go
$(MOCKGEN) -destination=$@ -package=mock_client -source=$^ -build_flags=-mod=vendor
ends with files like this (note the change in import):
diff --git a/pkg/mock/mock_scale/mock_interfaces.go b/pkg/mock/mock_scale/mock_interfaces.go
index 45c07456..22ffa192 100644
--- a/pkg/mock/mock_scale/mock_interfaces.go
+++ b/pkg/mock/mock_scale/mock_interfaces.go
@@ -1,5 +1,5 @@
// Code generated by MockGen. DO NOT EDIT.
-// Source: /go/pkg/mod/k8s.io/[email protected]/scale/interfaces.go
+// Source: /Users/zroubali/go/src/github.com/kedacore/keda/vendor/k8s.io/client-go/scale/interfaces.go
// Package mock_scale is a generated GoMock package.
package mock_scale
@@ -9,11 +9,11 @@ import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
+ scale "github.com/kedacore/keda/v2/vendor/k8s.io/client-go/scale"
v1 "k8s.io/api/autoscaling/v1"
v10 "k8s.io/apimachinery/pkg/apis/meta/v1"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
- scale "k8s.io/client-go/scale"
)
// MockScalesGetter is a mock of ScalesGetter interface.
the change ulitmately causes failed docker build:
#21 15.44 /workspace/bin/mockgen -destination=pkg/mock/mock_scale/mock_interfaces.go -package=mock_scale -source=/workspace/vendor/k8s.io/client-go/scale/interfaces.go -build_flags=-mod=vendor
#21 15.84 /workspace/bin/mockgen -destination=pkg/mock/mock_client/mock_interfaces.go -package=mock_client -source=/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/client/interfaces.go -build_flags=-mod=vendor
#21 16.21 /workspace/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
#21 70.61 pkg/mock/mock_client/mock_interfaces.go:12:2: github.com/kedacore/keda/v2/vendor/sigs.k8s.io/controller-runtime/pkg/client must be imported as sigs.k8s.io/controller-runtime/pkg/client
#21 70.61 pkg/mock/mock_scale/mock_interfaces.go:12:2: github.com/kedacore/keda/v2/vendor/k8s.io/client-go/scale must be imported as k8s.io/client-go/scale
#21 70.61 Error: not all generators ran successfully
#21 70.61 run `controller-gen object:headerFile=hack/boilerplate.go.txt paths=./... -w` to see all available markers, or `controller-gen object:headerFile=hack/boilerplate.go.txt paths=./... -h` for usage
#21 70.73 make: *** [Makefile:124: generate] Error 1
------
executor failed running [/bin/sh -c VERSION=${BUILD_VERSION} GIT_COMMIT=${GIT_COMMIT} GIT_VERSION=${GIT_VERSION} TARGET_OS=$TARGETOS ARCH=$TARGETARCH make manager]: exit code: 2
💩 💩 💩 💩 💩 💩 💩 💩
/run-e2e internal* Update: You can check the progress here
/run-e2e internal* Update: You can check the progress here