-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test/e2e: use vSphere projects from Boskos
- Loading branch information
1 parent
f237a0f
commit 2fc54af
Showing
23 changed files
with
1,803 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
.golangci.yml | ||
bin/ | ||
**/*.yaml | ||
hack/ | ||
out/ | ||
docs/ | ||
packaging/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# syntax=docker/dockerfile:1.4 | ||
|
||
# Copyright 2024 The Kubernetes Authors. | ||
# | ||
# 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. | ||
|
||
# Build the manager binary | ||
# Run this with docker build --build-arg builder_image=<golang:x.y.z> | ||
ARG builder_image | ||
|
||
# Build architecture | ||
ARG ARCH | ||
|
||
# Ignore Hadolint rule "Always tag the version of an image explicitly." | ||
# It's an invalid finding since the image is explicitly set in the Makefile. | ||
# https://github.com/hadolint/hadolint/wiki/DL3006 | ||
# hadolint ignore=DL3006 | ||
FROM ${builder_image} as builder | ||
WORKDIR /workspace | ||
|
||
# Run this with docker build --build-arg goproxy=$(go env GOPROXY) to override the goproxy | ||
ARG goproxy=https://proxy.golang.org | ||
# Run this with docker build --build-arg package=./controlplane/kubeadm or --build-arg package=./bootstrap/kubeadm | ||
ENV GOPROXY=$goproxy | ||
|
||
# Copy the Go Modules manifests | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
|
||
# Cache deps before building and copying source so that we don't need to re-download as much | ||
# and so that source changes don't invalidate our downloaded layer | ||
RUN --mount=type=cache,target=/go/pkg/mod \ | ||
go mod download | ||
|
||
# Copy the sources | ||
COPY ./ ./ | ||
|
||
# Cache the go build into the Go’s compiler cache folder so we take benefits of compiler caching across docker build calls | ||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
go build . | ||
|
||
# Build | ||
ARG ldflags | ||
|
||
# Do not force rebuild of up-to-date packages (do not use -a) and use the compiler cache folder | ||
RUN ls | ||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ | ||
go build -trimpath -ldflags "${ldflags} -extldflags '-static'" \ | ||
-o boskosctl ./hack/tools/boskosctl | ||
|
||
# Production image | ||
FROM gcr.io/distroless/static:nonroot-amd64 | ||
|
||
WORKDIR / | ||
COPY --from=builder /workspace/boskosctl . | ||
# Use uid of nonroot user (65532) because kubernetes expects numeric user when applying pod security policies | ||
USER 65532 | ||
ENTRYPOINT ["/boskosctl"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright 2019 The Kubernetes Authors. | ||
# | ||
# 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. | ||
|
||
# | ||
# Go. | ||
# | ||
GO_VERSION ?= 1.22.3 | ||
GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION) | ||
|
||
# Use GOPROXY environment variable if set | ||
GOPROXY := $(shell go env GOPROXY) | ||
ifeq ($(GOPROXY),) | ||
GOPROXY := https://proxy.golang.org | ||
endif | ||
export GOPROXY | ||
|
||
# Active module mode, as we use go modules to manage dependencies | ||
export GO111MODULE=on | ||
|
||
all: build | ||
|
||
VERSION ?= $(shell git describe --always --dirty) | ||
IMAGE_NAME ?= gcr.io/k8s-staging-capi-vsphere/extra/boskosctl | ||
IMAGE_TAG ?= $(IMAGE_NAME):$(VERSION) | ||
|
||
build: | ||
cd ../../../; DOCKER_BUILDKIT=1 docker build --build-arg builder_image=docker.io/library/golang:$(GO_VERSION) --build-arg goproxy=$(GOPROXY) . -t $(IMAGE_TAG) --file hack/tools/boskosctl/Dockerfile | ||
docker tag $(IMAGE_TAG) $(IMAGE_NAME):latest | ||
.PHONY: build | ||
|
||
push: | ||
docker push $(IMAGE_TAG) | ||
docker push $(IMAGE_NAME):latest | ||
.PHONY: push |
Oops, something went wrong.