From 5abfcaac832906dc0886456113df1330da89c008 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 component --- ...experimental-build-using-buildtooling.yaml | 38 +++ Dockerfile | 78 +++++ build-tooling.mk | 298 ++++++++++++++++++ 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 + cli/core/go.mod | 2 +- cmd/cli/plugin-admin/builder/go.mod | 2 +- cmd/cli/plugin-admin/test/go.mod | 2 +- cmd/cli/plugin/cluster/go.mod | 2 +- cmd/cli/plugin/isolated-cluster/go.mod | 2 +- cmd/cli/plugin/login/go.mod | 2 +- cmd/cli/plugin/managementcluster/go.mod | 2 +- cmd/cli/plugin/package/go.mod | 2 +- cmd/cli/plugin/secret/go.mod | 2 +- go.mod | 2 +- tkg/go.mod | 2 +- 19 files changed, 442 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/experimental-build-using-buildtooling.yaml create mode 100644 Dockerfile create mode 100644 build-tooling.mk diff --git a/.github/workflows/experimental-build-using-buildtooling.yaml b/.github/workflows/experimental-build-using-buildtooling.yaml new file mode 100644 index 0000000000..c671a9de2c --- /dev/null +++ b/.github/workflows/experimental-build-using-buildtooling.yaml @@ -0,0 +1,38 @@ +name: Build using build tooling[Experimental] + +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 0000000000..162d6fe87c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,78 @@ +# Copyright 2023 VMware, Inc. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This Dockerfile is currently consumed by build tooling https://github.com/vmware-tanzu/build-tooling-for-integrations +# to build components in tanzu-framework, check out build-tooling.mk to understand how this is being consumed. + +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 0000000000..d4f936841d --- /dev/null +++ b/build-tooling.mk @@ -0,0 +1,298 @@ +.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 +# check out step 2 in this documentation on how to set the COMPONENTS variable https://github.com/vmware-tanzu/build-tooling-for-integrations/blob/main/docs/build-tooling-getting-started.md +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 b3a02bb7dc..6fc18ca517 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-20230119181514-3c34115bc248 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 635e109006..a0fcdd580c 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-20230119181514-3c34115bc248 h1:Oxp+iTBH105m9YnkvOF76wH8mNHUdLYPhf+aC70ZTyM= +github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248/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 a9e22810b7..c110430950 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 a599bb5216..612ece7a19 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-20230119181514-3c34115bc248 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-20230119181514-3c34115bc248 + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248 + github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-20230119181514-3c34115bc248 + github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-20230119181514-3c34115bc248 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 4a43dbecc7..0d028cdf97 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-20230119181514-3c34115bc248 h1:mb+EBlaJ5NSS9LIS1zJer9p3u74wv2Wo0iWP0JWTd2k= +github.com/vmware-tanzu/tanzu-framework/apis/core v0.0.0-20230119181514-3c34115bc248/go.mod h1:vjqilqQVGbzt4XpV8gEoLnehe7/IfQ49wikteZpKngU= +github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248 h1:Oxp+iTBH105m9YnkvOF76wH8mNHUdLYPhf+aC70ZTyM= +github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248/go.mod h1:8Kx/YbIyv07c3UZKVkb6i/jp0imJelAQS3YaDwXYM54= +github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-20230119181514-3c34115bc248 h1:VSbPOzDdpJ0cAmCt221Y8+KXAmb/h5XfsMQ84NBgsZ8= +github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-20230119181514-3c34115bc248/go.mod h1:rcIfoGpdav3evsyEMMzYH0xhGZOkIy+Ra3koypM8Aco= +github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-20230119181514-3c34115bc248 h1:LsJU0l37dcA9AMhtCNQUp5EVIzvEJN4tulZ0NQcZvP4= +github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-20230119181514-3c34115bc248/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/cli/core/go.mod b/cli/core/go.mod index 1452065df4..aa52814cd7 100644 --- a/cli/core/go.mod +++ b/cli/core/go.mod @@ -124,7 +124,7 @@ require ( github.com/vito/go-interact v0.0.0-20171111012221-fa338ed9e9ec // indirect github.com/vmware-tanzu/carvel-imgpkg v0.23.1 // indirect github.com/vmware-tanzu/carvel-vendir v0.26.0 // indirect - github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-00010101000000-000000000000 // indirect + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248 // indirect go.opencensus.io v0.24.0 // indirect go.uber.org/atomic v1.9.0 // indirect golang.org/x/crypto v0.4.0 // indirect diff --git a/cmd/cli/plugin-admin/builder/go.mod b/cmd/cli/plugin-admin/builder/go.mod index f749614aff..b02156e638 100644 --- a/cmd/cli/plugin-admin/builder/go.mod +++ b/cmd/cli/plugin-admin/builder/go.mod @@ -112,7 +112,7 @@ require ( github.com/vmware-tanzu/carvel-imgpkg v0.23.1 // indirect github.com/vmware-tanzu/carvel-vendir v0.26.0 // indirect github.com/vmware-tanzu/carvel-ytt v0.40.0 // indirect - github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-00010101000000-000000000000 // indirect + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248 // indirect github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-00010101000000-000000000000 // indirect go.opencensus.io v0.24.0 // indirect go.uber.org/atomic v1.9.0 // indirect diff --git a/cmd/cli/plugin-admin/test/go.mod b/cmd/cli/plugin-admin/test/go.mod index 0b2d9a7b5a..db4d010c17 100644 --- a/cmd/cli/plugin-admin/test/go.mod +++ b/cmd/cli/plugin-admin/test/go.mod @@ -104,7 +104,7 @@ require ( github.com/vmware-tanzu/carvel-vendir v0.26.0 // indirect 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/run v0.0.0-00010101000000-000000000000 // indirect + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248 // indirect github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-00010101000000-000000000000 // indirect go.opencensus.io v0.24.0 // indirect go.uber.org/atomic v1.9.0 // indirect diff --git a/cmd/cli/plugin/cluster/go.mod b/cmd/cli/plugin/cluster/go.mod index 7d2089a6eb..2dee17c684 100644 --- a/cmd/cli/plugin/cluster/go.mod +++ b/cmd/cli/plugin/cluster/go.mod @@ -26,7 +26,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 - github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-00010101000000-000000000000 + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248 github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-00010101000000-000000000000 github.com/vmware-tanzu/tanzu-framework/pkg/v1/tkr v0.0.0-00010101000000-000000000000 github.com/vmware-tanzu/tanzu-framework/tkg v0.0.0-00010101000000-000000000000 diff --git a/cmd/cli/plugin/isolated-cluster/go.mod b/cmd/cli/plugin/isolated-cluster/go.mod index 1418b4e6a7..c646f7ac34 100644 --- a/cmd/cli/plugin/isolated-cluster/go.mod +++ b/cmd/cli/plugin/isolated-cluster/go.mod @@ -26,7 +26,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.6.1 github.com/vmware-tanzu/carvel-imgpkg v0.33.0 - github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-00010101000000-000000000000 + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248 github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-00010101000000-000000000000 github.com/vmware-tanzu/tanzu-framework/tkg v0.0.0-00010101000000-000000000000 golang.org/x/exp v0.0.0-20221215174704-0915cd710c24 diff --git a/cmd/cli/plugin/login/go.mod b/cmd/cli/plugin/login/go.mod index c68c460abd..87d073ccf6 100644 --- a/cmd/cli/plugin/login/go.mod +++ b/cmd/cli/plugin/login/go.mod @@ -108,7 +108,7 @@ require ( github.com/vmware-tanzu/carvel-vendir v0.26.0 // indirect 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/run v0.0.0-00010101000000-000000000000 // indirect + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248 // indirect github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-00010101000000-000000000000 // indirect go.opencensus.io v0.24.0 // indirect go.uber.org/atomic v1.9.0 // indirect diff --git a/cmd/cli/plugin/managementcluster/go.mod b/cmd/cli/plugin/managementcluster/go.mod index 08a27d841d..d8fffea3db 100644 --- a/cmd/cli/plugin/managementcluster/go.mod +++ b/cmd/cli/plugin/managementcluster/go.mod @@ -22,7 +22,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 - github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-00010101000000-000000000000 + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248 github.com/vmware-tanzu/tanzu-framework/cli/core v0.0.0-20220914003300-5b2ed024556a github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-00010101000000-000000000000 github.com/vmware-tanzu/tanzu-framework/tkg v0.0.0-00010101000000-000000000000 diff --git a/cmd/cli/plugin/package/go.mod b/cmd/cli/plugin/package/go.mod index c65c4864eb..a13b3b55cd 100644 --- a/cmd/cli/plugin/package/go.mod +++ b/cmd/cli/plugin/package/go.mod @@ -209,7 +209,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/run v0.0.0-00010101000000-000000000000 // indirect + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248 // indirect github.com/vmware-tanzu/tanzu-framework/cli/core v0.0.0-20220914003300-5b2ed024556a // indirect github.com/vmware-tanzu/tanzu-framework/tkr v0.0.0-00010101000000-000000000000 // indirect github.com/vmware-tanzu/tanzu-framework/util v0.0.0-00010101000000-000000000000 // indirect diff --git a/cmd/cli/plugin/secret/go.mod b/cmd/cli/plugin/secret/go.mod index 2131df7435..8f82bde6d5 100644 --- a/cmd/cli/plugin/secret/go.mod +++ b/cmd/cli/plugin/secret/go.mod @@ -92,7 +92,7 @@ require ( github.com/vmware-tanzu/carvel-secretgen-controller v0.5.0 // indirect github.com/vmware-tanzu/carvel-vendir v0.26.0 // indirect github.com/vmware-tanzu/tanzu-framework/apis/cli v0.0.0-00010101000000-000000000000 // indirect - github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-00010101000000-000000000000 // indirect + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.6.0 // indirect golang.org/x/crypto v0.4.0 // indirect diff --git a/go.mod b/go.mod index 81eb426a36..e1361c2bcf 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 - github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-00010101000000-000000000000 + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248 github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-00010101000000-000000000000 github.com/vmware-tanzu/tanzu-framework/pkg/v1/tkr v0.0.0-00010101000000-000000000000 github.com/vmware-tanzu/tanzu-framework/test/pkg v0.0.0-20221114124829-a8c2eac58dbf diff --git a/tkg/go.mod b/tkg/go.mod index 5bdb698fc2..14d81f542f 100644 --- a/tkg/go.mod +++ b/tkg/go.mod @@ -69,7 +69,7 @@ require ( github.com/vmware-tanzu/carvel-ytt v0.40.0 github.com/vmware-tanzu/tanzu-framework/apis/cli v0.0.0-00010101000000-000000000000 github.com/vmware-tanzu/tanzu-framework/apis/config v0.0.0-20220824221239-af5a644ffef7 - github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-00010101000000-000000000000 + github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230119181514-3c34115bc248 github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-00010101000000-000000000000 github.com/vmware-tanzu/tanzu-framework/cli/core v0.0.0-20220914003300-5b2ed024556a github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-00010101000000-000000000000