Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak dep management to handle vendored tools #599

Merged
merged 2 commits into from
Oct 29, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Tweak dep management to handle vendored tools
jonjohnsonjr committed Oct 28, 2019
commit 840211fdb9cd700ea48c5eb6c60de46e2ecbffad
4 changes: 2 additions & 2 deletions hack/update-code-gen.sh
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ export GOPATH=$(go env GOPATH)
export PATH="${GOPATH}/bin:${PATH}"


go install k8s.io/code-generator/cmd/deepcopy-gen
go install github.com/maxbrunsfeld/counterfeiter
go get k8s.io/code-generator/cmd/deepcopy-gen
go get github.com/maxbrunsfeld/counterfeiter/v6
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partially just reverts https://github.com/google/go-containerregistry/pull/548/files#diff-87ee15ebb32e08fc4ef22a736ce9000d but our switch over to go modules basically broke assumptions in this file (Gopkg.toml does not vendor these packages anymore), and go modules require appending that v6 to the end of counterfeiter for reasons outside of my ability to comprehend. This + go mod vendor should fix the regression (I think).

go run $PROJECT_ROOT/cmd/crane/help/main.go --dir=$PROJECT_ROOT/cmd/crane/doc/
go generate ./...
1 change: 0 additions & 1 deletion hack/update-deps.sh
Original file line number Diff line number Diff line change
@@ -28,4 +28,3 @@ go mod vendor
# Delete all vendored broken symlinks.
# From https://stackoverflow.com/questions/22097130/delete-all-broken-symbolic-links-with-a-line
find vendor/ -type l -exec sh -c 'for x; do [ -e "$x" ] || rm "$x"; done' _ {} +

24 changes: 24 additions & 0 deletions tools.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// +build tools

// Copyright 2019 Google LLC All Rights Reserved.
//
// 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
//
// http://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.

// Package tools imports our tool dependencies because go modules are bad:
// https://github.com/golang/go/issues/25922
package tools

import (
_ "github.com/maxbrunsfeld/counterfeiter/v6"
_ "k8s.io/code-generator/cmd/deepcopy-gen"
)