Skip to content

Commit

Permalink
Automated Config Connector import.
Browse files Browse the repository at this point in the history
  - f523c9f49f5e251ad8bd2e29a93099ada78ff34b makefile etc changes to support vendor removal by Config Connector Team <[email protected]>
  - a0cc77445614c882adeaa4e506509031f74d86d4 Delete vendor directory by Config Connector Team <[email protected]>

GitOrigin-RevId: f523c9f49f5e251ad8bd2e29a93099ada78ff34b
  • Loading branch information
Config Connector Team authored and copybara-github committed Jun 27, 2023
1 parent e29615f commit 8c8e175
Show file tree
Hide file tree
Showing 9,773 changed files with 19 additions and 5,191,077 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
# limitations under the License.

bin/
third_party/
#third_party/

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

export GOFLAGS=-mod=vendor

PROJECT_ID := $(shell gcloud config get-value project)
SHORT_SHA := $(shell git rev-parse --short=7 HEAD)
BUILDER_IMG ?= gcr.io/${PROJECT_ID}/builder:${SHORT_SHA}
Expand Down Expand Up @@ -105,7 +103,9 @@ vet:
generate:
# Don't run go generate on `pkg/clients/generated` in the normal development flow due to high latency.
# This path will be covered by `generate-go-client` target specifically.
go mod vendor -o temp-vendor # So we can load DCL resources
go generate $$(go list ./pkg/... ./cmd/... ./scripts/resource-autogen/... | grep -v ./pkg/clients/generated)
rm -rf temp-vendor
make fmt

# Build the docker images
Expand Down
9 changes: 5 additions & 4 deletions build/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
# from source (manager, webhook, etc.)
FROM golang:1.19 AS builder

ENV GOFLAGS "-mod=vendor"

# Copy in the Go source code
WORKDIR /go/src/github.com/GoogleCloudPlatform/k8s-config-connector
COPY pkg/ pkg/
COPY cmd/ cmd/
COPY config/ config/
COPY vendor/ vendor/
COPY mockgcp/ mockgcp/
COPY third_party/ third_party/
COPY scripts/generate-third-party-licenses scripts/generate-third-party-licenses
COPY scripts/resource-autogen scripts/resource-autogen
COPY go.mod go.mod
Expand All @@ -37,4 +36,6 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o recorder
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o unmanageddetector github.com/GoogleCloudPlatform/k8s-config-connector/cmd/unmanageddetector
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o manager github.com/GoogleCloudPlatform/k8s-config-connector/cmd/manager

RUN go run scripts/generate-third-party-licenses/main.go
RUN go mod vendor -o temp-vendor # So we can load license files
RUN go run scripts/generate-third-party-licenses/main.go
RUN rm -rf temp-vendor
9 changes: 6 additions & 3 deletions operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,29 @@
# Build the manager binary
FROM golang:1.19 AS builder

ENV GOFLAGS "-mod=vendor"

# Copy in the Go source code
WORKDIR /go/src/github.com/GoogleCloudPlatform/k8s-config-connector
COPY operator/pkg/ operator/pkg/
COPY operator/cmd/ operator/cmd/
COPY operator/channels/ operator/channels/
COPY operator/autopilot-channels/ operator/autopilot-channels/
COPY mockgcp/ mockgcp/
COPY pkg/ pkg/
COPY third_party/ third_party/
COPY config/servicemappings/ config/servicemappings/
COPY scripts/resource-autogen/ scripts/resource-autogen/
COPY vendor/ vendor/
COPY scripts/generate-third-party-licenses scripts/generate-third-party-licenses
COPY go.mod go.mod
COPY go.sum go.sum

# Build the binary from source
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager github.com/GoogleCloudPlatform/k8s-config-connector/operator/cmd/manager
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o gke_addon_poststart github.com/GoogleCloudPlatform/k8s-config-connector/operator/cmd/gke_addon_poststart

# Generate licenses
RUN go mod vendor -o temp-vendor # So we can load license files
RUN go run scripts/generate-third-party-licenses/main.go
RUN rm -rf temp-vendor

# Build a specific version of kubectl to be used by the
# kubebuilder-declarative-pattern library.
Expand Down
2 changes: 0 additions & 2 deletions operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

export GOFLAGS=-mod=vendor

# enable multi-versions feature for CRDs
CRD_OPTIONS ?= "crd"

Expand Down
1 change: 0 additions & 1 deletion operator/scripts/fetch_ext_bins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,4 @@ function setup_envs {
export TEST_ASSET_KUBECTL=/tmp/kubebuilder/bin/kubectl
export TEST_ASSET_KUBE_APISERVER=/tmp/kubebuilder/bin/kube-apiserver
export TEST_ASSET_ETCD=/tmp/kubebuilder/bin/etcd
export GOFLAGS="-mod=vendor"
}
2 changes: 1 addition & 1 deletion pkg/util/repo/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func GetServiceMappingsPathOrLogFatal() string {
}

func GetDCLSchemasPathOrLogFatal() string {
return filepath.Join(GetRootOrLogFatal(), "vendor/github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google")
return filepath.Join(GetRootOrLogFatal(), "temp-vendor/github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google")
}

func GetServiceAccountCRDPath() string {
Expand Down
6 changes: 3 additions & 3 deletions scripts/generate-third-party-licenses/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
)

const (
inputDir = "vendor"
inputDir = "temp-vendor"
thirdPartyNoticeDir = "THIRD_PARTY_NOTICES"
mirroredLibrarySourceDir = "MIRRORED_LIBRARY_SOURCE"
dirMode = 0700
Expand All @@ -53,7 +53,7 @@ func main() {
}

for _, file := range files {
licensePath := strings.TrimLeft(file, "vendor/")
licensePath := strings.TrimLeft(file, "temp-vendor/")
repo, licenseFilename := splitLicensePath(licensePath)
licenseURL := repoToLicenseURL(repo, licenseFilename)
fmt.Println(licenseURL)
Expand Down Expand Up @@ -87,7 +87,7 @@ func main() {
// need to remove the actual dir so 'cp' works
os.Remove(outputSourceDir)

sourceDir := "vendor/" + repo
sourceDir := "temp-vendor/" + repo
cmd := exec.Command("cp", "-r", sourceDir, outputSourceDir)
if output, err := cmd.CombinedOutput(); err != nil {
fmt.Printf("error copying source code for '%v': %v", sourceDir, string(output))
Expand Down
27 changes: 0 additions & 27 deletions vendor/bitbucket.org/creachadair/stringset/LICENSE

This file was deleted.

25 changes: 0 additions & 25 deletions vendor/bitbucket.org/creachadair/stringset/README.md

This file was deleted.

26 changes: 0 additions & 26 deletions vendor/bitbucket.org/creachadair/stringset/bitbucket-pipelines.yml

This file was deleted.

Loading

0 comments on commit 8c8e175

Please sign in to comment.