From e619c12bbd0d0b82b8368832d2e1423579daea2a Mon Sep 17 00:00:00 2001 From: Harish Yayi Date: Wed, 11 Jan 2023 13:08:59 -0500 Subject: [PATCH] use build tooling for building capabilities --- ...d-using-buildtooling-for-pullrequests.yaml | 38 +++ Dockerfile | 75 +++++ build-tooling.mk | 297 ++++++++++++++++++ capabilities/client/go.mod | 4 +- capabilities/client/go.sum | 2 + capabilities/client/pkg/discovery/fake.go | 2 +- capabilities/controller/go.mod | 14 +- capabilities/controller/go.sum | 8 + go.mod | 3 + go.sum | 4 + 10 files changed, 434 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/build-using-buildtooling-for-pullrequests.yaml create mode 100644 Dockerfile create mode 100644 build-tooling.mk diff --git a/.github/workflows/build-using-buildtooling-for-pullrequests.yaml b/.github/workflows/build-using-buildtooling-for-pullrequests.yaml new file mode 100644 index 00000000000..85a16c1bd0a --- /dev/null +++ b/.github/workflows/build-using-buildtooling-for-pullrequests.yaml @@ -0,0 +1,38 @@ +name: Build using build tooling + +on: [pull_request] +jobs: + build: + name: build + runs-on: ubuntu-latest + steps: + - name: Free some disk space on runner + run: | + echo "free space before cleanup:" + df -h + sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/boost /usr/lib/jvm /usr/lib/firefox /opt/microsoft/powershell /opt/hostedtoolcache + echo "free space after cleanup:" + df -h + + - name: Set up Go 1.x + uses: actions/setup-go@v3 + with: + go-version: 1.18 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: go cache + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: run make docker-build-all + run: | + make docker-build-all -f build-tooling.mk diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..89b3f9b9b4b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,75 @@ +# Copyright 2023 VMware, Inc. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +ARG BUILDER_BASE_IMAGE=golang:1.18 + +FROM --platform=${BUILDPLATFORM} $BUILDER_BASE_IMAGE as base +ARG COMPONENT +ARG GOPROXY_ARG +ENV GOPROXY=${GOPROXY_ARG} +WORKDIR /workspace +COPY "$COMPONENT"/go.* ./ +RUN --mount=type=cache,target=/go/pkg/mod \ + go mod download + +# Linting +FROM harbor-repo.vmware.com/dockerhub-proxy-cache/golangci/golangci-lint:v1.50 AS lint-base +FROM base AS lint +RUN --mount=target=. \ + --mount=from=lint-base,src=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \ + --mount=type=cache,target=/go/pkg/mod \ + --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/root/.cache/golangci-lint \ + cd $COMPONENT && golangci-lint run --config /workspace/.golangci.yaml --timeout 10m0s ./... + +FROM base AS fmt +RUN --mount=target=. \ + --mount=type=cache,target=/go/pkg/mod \ + --mount=type=cache,target=/root/.cache/go-build \ + cd $COMPONENT && go fmt ./... + +FROM base AS vet +RUN --mount=target=. \ + --mount=type=cache,target=/go/pkg/mod \ + --mount=type=cache,target=/root/.cache/go-build \ + cd $COMPONENT && go vet ./... + +# Testing +FROM base AS test +RUN --mount=target=. \ + --mount=type=cache,target=/go/pkg/mod \ + --mount=type=cache,target=/root/.cache/go-build \ + cd $COMPONENT && mkdir /out && go test -v -coverprofile=/out/cover.out ./... + +# Build the manager binary +FROM base as builder +ARG TARGETOS +ARG TARGETARCH +ARG LD_FLAGS +ENV LD_FLAGS="$LD_FLAGS "'-extldflags "-static"' +RUN --mount=target=. \ + --mount=type=cache,target=/go/pkg/mod \ + cd $COMPONENT && CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build -o /out/manager ./main.go + +# Use distroless as minimal base image to package the manager binary +# Refer to https://github.com/GoogleContainerTools/distroless for more details +FROM gcr.io/distroless/static:nonroot as image +WORKDIR / +COPY --from=builder /out/manager . +USER nonroot:nonroot + +ENTRYPOINT ["/manager"] + +FROM scratch AS unit-test-coverage +COPY --from=test /out/cover.out /cover.out + +FROM scratch AS bin-unix +COPY --from=builder /out/manager / + +FROM bin-unix AS bin-linux +FROM bin-unix AS bin-darwin + +FROM scratch AS bin-windows +COPY --from=builder /out/manager /manager.exe + +FROM bin-${TARGETOS} as bin diff --git a/build-tooling.mk b/build-tooling.mk new file mode 100644 index 00000000000..494010b92e4 --- /dev/null +++ b/build-tooling.mk @@ -0,0 +1,297 @@ +.DEFAULT_GOAL := help + +REGISTRY_PORT := 8000 +REGISTRY_ENDPOINT := localhost:$(REGISTRY_PORT) +PACKAGE_PREFIX := $(REGISTRY_ENDPOINT) +REGISTRY_NAME := tanzu-integration-registry + +DOCKER := DOCKER_BUILDKIT=1 docker +MAKE := make -f build-tooling.mk + +IMG_DEFAULT_TAG := latest +IMG_VERSION_OVERRIDE ?= $(IMG_DEFAULT_TAG) +GOPROXY ?= "https://proxy.golang.org,direct" +PLATFORM=local +COMPONENTS ?= capabilities/client capabilities/controller.capabilities-controller-manager.capabilities + +BUILD_TOOLING_CONTAINER_IMAGE ?= ghcr.io/vmware-tanzu/build-tooling +PACKAGING_CONTAINER_IMAGE ?= ghcr.io/vmware-tanzu/package-tooling +VERSION ?= v0.0.2 + +# utility functions to check for main.go in component path +find_main_go = $(shell find $(1) -name main.go) +check_main_go = $(if $(call find_main_go,$(1)),Found,NotFound) + +## +## Project Initialization Targets +## + +# Bootstraps a project by creating a copy of the Tanzu build container Dockerfile +# into the project's root directory (alongside Makefile). +# This target also installs a local registry if the build is being done in a +# non-CI environment and it makes sure that the Tanzu packaging container is up to date. +bootstrap: install-registry check-copy-build-container install-package-container + +install-registry: +ifneq ($(IS_CI),) + @echo "Running in CI mode. Skipping local registry setup." +else +ifeq ($(shell $(DOCKER) ps -q -f name=$(REGISTRY_NAME) 2> /dev/null),) + @echo "Deploying a local Docker registry for Tanzu Integrations" + $(DOCKER) run -d -p $(REGISTRY_PORT):5000 --restart=always --name $(REGISTRY_NAME) registry:2 + @echo +endif + @echo "Registry for Tanzu Integrations available at $(REGISTRY_ENDPOINT)" +endif + +check-copy-build-container: +ifneq ("$(wildcard Dockerfile)","") + $(eval COPY_BUILD_CONTAINER := $(shell bash -c 'read -p "There is already a Dockerfile in this project. Overwrite? [y/N]: " do_copy; echo $$do_copy')) +else + $(eval COPY_BUILD_CONTAINER := Y) +endif + @$(MAKE) -s COPY_BUILD_CONTAINER=$(COPY_BUILD_CONTAINER) copy-build-container + +copy-build-container: +ifneq ($(filter y Y, $(COPY_BUILD_CONTAINER)),) + @$(DOCKER) run --name tanzu-build-tooling $(BUILD_TOOLING_CONTAINER_IMAGE):$(VERSION) + @$(DOCKER) cp tanzu-build-tooling:/Dockerfile ./Dockerfile + @$(DOCKER) cp tanzu-build-tooling:/.golangci.yaml ./.golangci.yaml + @echo Added Dockerfile for containerize build to $(PWD) + @$(DOCKER) rm tanzu-build-tooling 1> /dev/null +endif + +install-package-container: + @$(DOCKER) pull $(PACKAGING_CONTAINER_IMAGE):$(VERSION) + +.PHONY: bootstrap install-registry check-copy-build-container copy-build-container install-package-container + + +.PHONY: init +# Fetch the Dockerfile and pull image needed to build packages +init: + $(DOCKER) run --rm -v ${PWD}:/workspace --entrypoint /bin/sh $(BUILD_TOOLING_CONTAINER_IMAGE):$(VERSION) -c "cp Dockerfile /workspace && cp .golangci.yaml /workspace" + $(DOCKER) pull $(PACKAGING_CONTAINER_IMAGE):$(VERSION) + +## +## Other Targets +## + +.PHONY: docker-build-all +# Run linter, tests and build images +docker-build-all: $(COMPONENTS) + +.PHONY: docker-publish-all +# Push images of all components +docker-publish-all: PUBLISH_IMAGES:=true +docker-publish-all: $(COMPONENTS) + +.PHONY: build-all +# Run linter, tests and build binaries +build-all: BUILD_BIN:=true +build-all: $(COMPONENTS) + +.PHONY: package-all +# Generate package bundles and push them to a registry +package-all: package-bundle-generate-all package-bundle-push-all + +.PHONY: $(COMPONENTS) +$(COMPONENTS): + $(eval COMPONENT_PATH = $(word 1,$(subst ., ,$@))) + $(eval IMAGE_NAME = $(word 2,$(subst ., ,$@))) + $(eval PACKAGE_PATH = $(word 3,$(subst ., ,$@))) + $(eval IMAGE = $(IMAGE_NAME):$(IMG_VERSION_OVERRIDE)) + $(eval DEFAULT_IMAGE = $(IMAGE_NAME):$(IMG_DEFAULT_TAG)) + $(eval IMAGE = $(shell if [ ! -z "$(OCI_REGISTRY)" ]; then echo $(OCI_REGISTRY)/$(IMAGE_NAME):$(IMG_VERSION_OVERRIDE); else echo $(IMAGE); fi)) + $(eval COMPONENT = $(shell if [ -z "$(COMPONENT_PATH)" ]; then echo "."; else echo $(COMPONENT_PATH); fi)) + @if [ "$(PUBLISH_IMAGES)" = "true" ]; then \ + if [ "$(call check_main_go,$(COMPONENT))" = "Found" ]; then \ + $(MAKE) validate-component IMAGE_NAME=$(IMAGE_NAME) PACKAGE_PATH=$(PACKAGE_PATH) || exit 1; \ + $(MAKE) publish IMAGE=$(IMAGE) DEFAULT_IMAGE=$(DEFAULT_IMAGE) PACKAGE_PATH=$(PACKAGE_PATH) BUILD_BIN=$(BUILD_BIN); \ + fi \ + else \ + $(MAKE) build COMPONENT=$(COMPONENT) IMAGE_NAME=$(IMAGE_NAME) IMAGE=$(IMAGE) PACKAGE_PATH=$(PACKAGE_PATH) BUILD_BIN=$(BUILD_BIN); \ + fi + +.PHONY: validate-component +validate-component: +ifeq ($(strip $(IMAGE_NAME)),) + $(error Image name of the component is not set in COMPONENTS variable, check https://github.com/vmware-tanzu/build-tooling-for-integrations/blob/main/docs/build-tooling-getting-started.md#steps-to-use-the-build-tooling for more help) +else ifeq ($(strip $(PACKAGE_PATH)),) + $(error Path to the package of the component is not set in COMPONENTS variable, check https://github.com/vmware-tanzu/build-tooling-for-integrations/blob/main/docs/build-tooling-getting-started.md#steps-to-use-the-build-tooling for more help) +endif + +.PHONY: build +build: + $(MAKE) COMPONENT=$(COMPONENT) test + @if [ "$(call check_main_go,$(COMPONENT))" = "Found" ]; then \ + if [ "$(BUILD_BIN)" = "true" ]; then \ + $(MAKE) COMPONENT=$(COMPONENT) binary-build; \ + else \ + $(MAKE) validate-component IMAGE_NAME=$(IMAGE_NAME) PACKAGE_PATH=$(PACKAGE_PATH) || exit 1; \ + $(MAKE) docker-build IMAGE=$(IMAGE) COMPONENT=$(COMPONENT); \ + fi \ + fi + +.PHONY: publish +publish: + $(MAKE) IMAGE=$(IMAGE) docker-publish + $(MAKE) KBLD_CONFIG_FILE_PATH=packages/$(PACKAGE_PATH)/kbld-config.yaml DEFAULT_IMAGE=$(DEFAULT_IMAGE) IMAGE=$(IMAGE) kbld-image-replace + +.PHONY: lint +# Run linting +lint: +ifneq ($(strip $(COMPONENT)),.) + cp .golangci.yaml $(COMPONENT) + $(DOCKER) build . -f Dockerfile --target lint --build-arg COMPONENT=$(COMPONENT) --build-arg GOPROXY_ARG=$(GOPROXY) + rm -rf $(COMPONENT)/.golangci.yaml +else + $(DOCKER) build . -f Dockerfile --target lint --build-arg COMPONENT=$(COMPONENT) --build-arg GOPROXY_ARG=$(GOPROXY) +endif + +.PHONY: fmt +# Run go fmt against code +fmt: + $(DOCKER) build . -f Dockerfile --target fmt --build-arg COMPONENT=$(COMPONENT) --build-arg GOPROXY_ARG=$(GOPROXY) + +.PHONY: vet +# Perform static analysis of code +vet: + $(DOCKER) build . -f Dockerfile --target vet --build-arg COMPONENT=$(COMPONENT) --build-arg GOPROXY_ARG=$(GOPROXY) + +.PHONY: test +# Run tests +test: fmt vet + $(DOCKER) build . -f Dockerfile --target test --build-arg COMPONENT=$(COMPONENT) --build-arg GOPROXY_ARG=$(GOPROXY) + @$(DOCKER) build . -f Dockerfile --target unit-test-coverage --build-arg COMPONENT=$(COMPONENT) --output build/$(COMPONENT)/coverage + +.PHONY: binary-build +# Build the binary +binary-build: + $(DOCKER) build . -f Dockerfile --build-arg LD_FLAGS="$(LD_FLAGS)" --target bin --output build/$(COMPONENT)/bin --platform ${PLATFORM} --build-arg COMPONENT=$(COMPONENT) --build-arg GOPROXY_ARG=$(GOPROXY) + +.PHONY: docker-build +# Build docker image +docker-build: + $(DOCKER) build . -t $(IMAGE) -f Dockerfile --target image --platform linux/amd64 --build-arg LD_FLAGS="$(LD_FLAGS)" --build-arg COMPONENT=$(COMPONENT) --build-arg GOPROXY_ARG=$(GOPROXY) + +.PHONY: docker-publish +# Publish docker image +docker-publish: + $(DOCKER) push $(IMAGE) + +.PHONY: kbld-image-replace +# Add newImage in kbld-config.yaml +kbld-image-replace: + @$(DOCKER) run \ + -e OPERATIONS=kbld_replace \ + -e KBLD_CONFIG_FILE_PATH=$(KBLD_CONFIG_FILE_PATH) \ + -e DEFAULT_IMAGE=$(DEFAULT_IMAGE) \ + -e NEW_IMAGE=$(IMAGE) \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v $(PWD):/workspace \ + $(PACKAGING_CONTAINER_IMAGE):$(VERSION) + +.PHONY: package-bundle-generate +# Generate package bundle for a particular package +package-bundle-generate: + @$(DOCKER) run \ + -e OPERATIONS=package_bundle_generate \ + -e PACKAGE_NAME=$(PACKAGE_NAME) \ + -e THICK=true \ + -e OCI_REGISTRY=$(OCI_REGISTRY) \ + -e PACKAGE_VERSION=$(PACKAGE_VERSION) \ + -e PACKAGE_SUB_VERSION=$(PACKAGE_SUB_VERSION) \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v $(PWD):/workspace \ + $(PACKAGING_CONTAINER_IMAGE):$(VERSION) + +.PHONY: package-bundle-generate-all +# Generate package bundle for all packages +package-bundle-generate-all: + @$(DOCKER) run \ + -e OPERATIONS=package_bundle_all_generate \ + -e PACKAGE_REPOSITORY=$(PACKAGE_REPOSITORY) \ + -e THICK=true \ + -e OCI_REGISTRY=$(OCI_REGISTRY) \ + -e PACKAGE_VERSION=$(PACKAGE_VERSION) \ + -e PACKAGE_SUB_VERSION=$(PACKAGE_SUB_VERSION) \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v $(PWD):/workspace \ + $(PACKAGING_CONTAINER_IMAGE):$(VERSION) + +.PHONY: package-bundle-push +# Push a particular package bundle +package-bundle-push: + @$(DOCKER) run \ + -e OPERATIONS=package_bundle_push \ + -e PACKAGE_NAME=$(PACKAGE_NAME) \ + -e OCI_REGISTRY=$(OCI_REGISTRY) \ + -e PACKAGE_VERSION=$(PACKAGE_VERSION) \ + -e PACKAGE_SUB_VERSION=$(PACKAGE_SUB_VERSION) \ + -e REGISTRY_USERNAME=$(REGISTRY_USERNAME) \ + -e REGISTRY_PASSWORD=$(REGISTRY_PASSWORD) \ + -e REGISTRY_SERVER=$(REGISTRY_SERVER) \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v $(PWD):/workspace \ + $(PACKAGING_CONTAINER_IMAGE):$(VERSION) + +.PHONY: package-bundle-push-all +# Push all package bundles +package-bundle-push-all: + @$(DOCKER) run \ + -e OPERATIONS=package_bundle_all_push \ + -e PACKAGE_REPOSITORY=$(PACKAGE_REPOSITORY) \ + -e OCI_REGISTRY=$(OCI_REGISTRY) \ + -e PACKAGE_VERSION=$(PACKAGE_VERSION) \ + -e PACKAGE_SUB_VERSION=$(PACKAGE_SUB_VERSION) \ + -e REGISTRY_USERNAME=$(REGISTRY_USERNAME) \ + -e REGISTRY_PASSWORD=$(REGISTRY_PASSWORD) \ + -e REGISTRY_SERVER=$(REGISTRY_SERVER) \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v $(PWD):/workspace \ + $(PACKAGING_CONTAINER_IMAGE):$(VERSION) + +.PHONY: repo-bundle-generate +# Generate repo bundle +repo-bundle-generate: + @$(DOCKER) run \ + -e OPERATIONS=repo_bundle_generate \ + -e PACKAGE_REPOSITORY=$(PACKAGE_REPOSITORY) \ + -e OCI_REGISTRY=$(OCI_REGISTRY) \ + -e REPO_BUNDLE_VERSION=$(REPO_BUNDLE_VERSION) \ + -e REPO_BUNDLE_SUB_VERSION=$(REPO_BUNDLE_SUB_VERSION) \ + -e PACKAGE_VALUES_FILE=$(PACKAGE_VALUES_FILE) \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v $(PWD):/workspace \ + $(PACKAGING_CONTAINER_IMAGE):$(VERSION) + +.PHONY: repo-bundle-push +# Push repo bundle +repo-bundle-push: + @$(DOCKER) run \ + -e OPERATIONS=repo_bundle_push \ + -e PACKAGE_REPOSITORY=$(PACKAGE_REPOSITORY) \ + -e OCI_REGISTRY=$(OCI_REGISTRY) \ + -e REPO_BUNDLE_VERSION=$(REPO_BUNDLE_VERSION) \ + -e REPO_BUNDLE_SUB_VERSION=$(REPO_BUNDLE_SUB_VERSION) \ + -e REGISTRY_USERNAME=$(REGISTRY_USERNAME) \ + -e REGISTRY_PASSWORD=$(REGISTRY_PASSWORD) \ + -e REGISTRY_SERVER=$(REGISTRY_SERVER) \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v $(PWD):/workspace \ + $(PACKAGING_CONTAINER_IMAGE):$(VERSION) + +.PHONY: package-vendir-sync +# Performs vendir sync on each package +package-vendir-sync: + @$(DOCKER) run \ + -e OPERATIONS=vendir_sync \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v $(PWD):/workspace \ + $(PACKAGING_CONTAINER_IMAGE):$(VERSION) + +.PHONY: help +# Show help +help: + @cat $(MAKEFILE_LIST) | $(DOCKER) run --rm -i xanders/make-help diff --git a/capabilities/client/go.mod b/capabilities/client/go.mod index b3a02bb7dcf..4b2f599682d 100644 --- a/capabilities/client/go.mod +++ b/capabilities/client/go.mod @@ -2,11 +2,9 @@ module github.com/vmware-tanzu/tanzu-framework/capabilities/client go 1.18 -replace github.com/vmware-tanzu/tanzu-framework/apis/run => ../../apis/run - require ( github.com/google/gnostic v0.5.7-v3refs - github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-00010101000000-000000000000 + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230110071428-504445fe9371 gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.24.2 k8s.io/apimachinery v0.24.2 diff --git a/capabilities/client/go.sum b/capabilities/client/go.sum index 635e1090069..7e28421b53b 100644 --- a/capabilities/client/go.sum +++ b/capabilities/client/go.sum @@ -514,6 +514,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230110071428-504445fe9371 h1:eMdGdznIM6pwVKOdzcMgbi0CL7I8b/RlC8d4y/waLaw= +github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230110071428-504445fe9371/go.mod h1:8Kx/YbIyv07c3UZKVkb6i/jp0imJelAQS3YaDwXYM54= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/capabilities/client/pkg/discovery/fake.go b/capabilities/client/pkg/discovery/fake.go index a9e22810b78..c1104309505 100644 --- a/capabilities/client/pkg/discovery/fake.go +++ b/capabilities/client/pkg/discovery/fake.go @@ -40,7 +40,7 @@ paths: return openapi_v2.ParseDocument([]byte(schema)) } -// NewFakeClusterQueryClient returns a fake ClusterQueryClient for use in tests. +// NewFakeClusterQueryClientWithSchema returns a fake ClusterQueryClient for use in tests. func NewFakeClusterQueryClientWithSchema(resources []*metav1.APIResourceList, scheme *runtime.Scheme, objs []runtime.Object) (*ClusterQueryClient, error) { fakeDynamicClient := dynamicFake.NewSimpleDynamicClient(scheme, objs...) diff --git a/capabilities/controller/go.mod b/capabilities/controller/go.mod index a599bb52167..f0cf33698f5 100644 --- a/capabilities/controller/go.mod +++ b/capabilities/controller/go.mod @@ -3,11 +3,7 @@ module github.com/vmware-tanzu/tanzu-framework/capabilities/controller go 1.18 replace ( - github.com/vmware-tanzu/tanzu-framework/apis/cli => ../../apis/cli - github.com/vmware-tanzu/tanzu-framework/apis/core => ../../apis/core - github.com/vmware-tanzu/tanzu-framework/apis/run => ../../apis/run - github.com/vmware-tanzu/tanzu-framework/capabilities/client => ../client - github.com/vmware-tanzu/tanzu-framework/cli/runtime => ../../cli/runtime + github.com/vmware-tanzu/tanzu-framework/apis/cli => github.com/vmware-tanzu/tanzu-framework/apis/cli v0.0.0-20230110071428-504445fe9371 sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.2.8 ) @@ -15,10 +11,10 @@ require ( github.com/go-logr/logr v1.2.3 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.19.0 - github.com/vmware-tanzu/tanzu-framework/apis/core v0.0.0-00010101000000-000000000000 - github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-00010101000000-000000000000 - github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-00010101000000-000000000000 - github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-00010101000000-000000000000 + github.com/vmware-tanzu/tanzu-framework/apis/core v0.0.0-20230110071428-504445fe9371 + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230110071428-504445fe9371 + github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-20230110071428-504445fe9371 + github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-20230110071428-504445fe9371 k8s.io/api v0.24.2 k8s.io/apimachinery v0.24.2 k8s.io/client-go v0.24.2 diff --git a/capabilities/controller/go.sum b/capabilities/controller/go.sum index 4a43dbecc75..aa2249f8d03 100644 --- a/capabilities/controller/go.sum +++ b/capabilities/controller/go.sum @@ -493,6 +493,14 @@ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PK github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/vmware-tanzu/tanzu-framework/apis/core v0.0.0-20230110071428-504445fe9371 h1:T32Tzxdf6JBwUOd7r1qnlvqOcoiRVcerIrhwq4jPFqA= +github.com/vmware-tanzu/tanzu-framework/apis/core v0.0.0-20230110071428-504445fe9371/go.mod h1:vjqilqQVGbzt4XpV8gEoLnehe7/IfQ49wikteZpKngU= +github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230110071428-504445fe9371 h1:eMdGdznIM6pwVKOdzcMgbi0CL7I8b/RlC8d4y/waLaw= +github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230110071428-504445fe9371/go.mod h1:8Kx/YbIyv07c3UZKVkb6i/jp0imJelAQS3YaDwXYM54= +github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-20230110071428-504445fe9371 h1:xK5i0LBdi3VzpGlvDGtAnUlUSub42MEyLTTtRP1SoKU= +github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-20230110071428-504445fe9371/go.mod h1:rcIfoGpdav3evsyEMMzYH0xhGZOkIy+Ra3koypM8Aco= +github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-20230110071428-504445fe9371 h1:+MC7yvHXfnxXB9B306BbJOKRTErYSSaEmB/8V5CZqpM= +github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-20230110071428-504445fe9371/go.mod h1:VVSZnVr/a+jvXV0heOJS8CPHtqPG+RPmjGMpOowUsb0= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/go.mod b/go.mod index 838e92eb5c9..1809851e7ef 100644 --- a/go.mod +++ b/go.mod @@ -75,6 +75,8 @@ require ( github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/Microsoft/go-winio v0.5.2 // indirect + github.com/PuerkitoBio/purell v1.1.1 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/adrg/xdg v0.4.0 // indirect github.com/alessio/shellescape v1.4.1 // indirect github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220816024939-bc8df83d7b9d // indirect @@ -213,6 +215,7 @@ require ( github.com/vmware-tanzu/carvel-ytt v0.40.0 // indirect github.com/vmware-tanzu/tanzu-framework/apis/cli v0.0.0-00010101000000-000000000000 // indirect github.com/vmware-tanzu/tanzu-framework/apis/config v0.0.0-20220824221239-af5a644ffef7 // indirect + github.com/vmware-tanzu/tanzu-framework/apis/core v0.0.0-20230110071428-504445fe9371 // indirect github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-00010101000000-000000000000 // indirect github.com/vmware-tanzu/tanzu-framework/cli/core v0.0.0-20220914003300-5b2ed024556a // indirect github.com/vmware-tanzu/tanzu-framework/packageclients v0.0.0-00010101000000-000000000000 // indirect diff --git a/go.sum b/go.sum index 5300e8c5d8d..d73cdd20b98 100644 --- a/go.sum +++ b/go.sum @@ -148,8 +148,10 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/a8m/tree v0.0.0-20210115125333-10a5fd5b637d/go.mod h1:FSdwKX97koS5efgm8WevNf7XS3PqtyFkKDDXrz778cg= @@ -1266,6 +1268,8 @@ github.com/vmware-tanzu/carvel-vendir v0.30.0 h1:JqElRFpSsYJQmI5Hrxl1Fx9wJZ2xeDk github.com/vmware-tanzu/carvel-vendir v0.30.0/go.mod h1:qFV2/3Cu584fhG2wXodoIm8KhX1wKHRFavBiRjK/Ly0= github.com/vmware-tanzu/carvel-ytt v0.40.0 h1:WUWTtwvfqV9CN9v207oDt2xfhmuWHGwc4MMaXJAqIEE= github.com/vmware-tanzu/carvel-ytt v0.40.0/go.mod h1:crDcKbS1GM4Q34puoVxdrajWOXrxjOxvUCwtsNV5Etc= +github.com/vmware-tanzu/tanzu-framework/apis/core v0.0.0-20230110071428-504445fe9371 h1:T32Tzxdf6JBwUOd7r1qnlvqOcoiRVcerIrhwq4jPFqA= +github.com/vmware-tanzu/tanzu-framework/apis/core v0.0.0-20230110071428-504445fe9371/go.mod h1:vjqilqQVGbzt4XpV8gEoLnehe7/IfQ49wikteZpKngU= github.com/vmware-tanzu/tanzu-framework/test/pkg v0.0.0-20221114124829-a8c2eac58dbf h1:KL+cthxghTjH0qrj3AtN26qDWatqXrbp7a/StjcnmMU= github.com/vmware-tanzu/tanzu-framework/test/pkg v0.0.0-20221114124829-a8c2eac58dbf/go.mod h1:WxG7I8d++BA0bcic2Ta3Rm5BHuWkGtH6rpSs0ry9uLA= github.com/vmware/govmomi v0.27.1 h1:Rf3o1btFrkJa9be5KtgJ4CyOO8mbFnBxmNtAVHNyFes=