Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,4 @@ jobs:

- name: Push Latest
if: env.DOCKER_USR != ''
run: ./crossplane xpkg push -f conformance.xpkg index.docker.io/crossplane/conformance-testdata-configuration
run: ./crossplane xpkg push -f conformance.xpkg index.docker.io/crossplane/conformance-testdata-configuration:latest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this work? 🤔 I didn't think you could tag a package as latest.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it does indeed appear to work ✅

Using the same commands from ci.yml to my own jbw976 org:

crossplane xpkg build -f testdata/configuration -o conformance.xpkg
crossplane xpkg push -f conformance.xpkg index.docker.io/jbw976/conformance-testdata-configuration:latest

Looks successful with the latest tag existing on https://hub.docker.com/repository/docker/jbw976/conformance-testdata-configuration/tags/latest/sha256-9451b504ec1485dcea1d526b7b69fd0550f8579b042a2a1f004d3419ca90debf

and a docker pull works OK too:

docker pull index.docker.io/jbw976/conformance-testdata-configuration:latest
latest: Pulling from jbw976/conformance-testdata-configuration
5626454dae94: Pull complete
Digest: sha256:9451b504ec1485dcea1d526b7b69fd0550f8579b042a2a1f004d3419ca90debf
Status: Downloaded newer image for jbw976/conformance-testdata-configuration:latest
docker.io/jbw976/conformance-testdata-configuration:latest

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ GOLANGCILINT_VERSION = 2.2.2
-include build/makelib/golang.mk

# Setup Images
DOCKER_REGISTRY = crossplane
REGISTRY_ORGS ?= docker.io/crossplane
IMAGES = conformance
OSBASEIMAGE = gcr.io/distroless/static:nonroot
OSBASEIMAGE = gcr.io/distroless/static-debian12:nonroot
-include build/makelib/imagelight.mk

fallthrough: submodules
Expand Down
34 changes: 24 additions & 10 deletions cluster/images/conformance/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,39 @@ include ../../../build/makelib/common.mk

IMAGE = $(BUILD_REGISTRY)/conformance-$(ARCH)

# Note that this is actually the 'debug' variant of the static image, which
# includes a busybox shell with just enough functionality to turn regular old
# Go test output into the gzipped tarball of junit XML that Sonobuoy craves.
OSBASEIMAGE = gcr.io/distroless/static@sha256:aea3063d00e3969d57cc8903709b58c8ee813576fbba56a977eeb915515e4ff0
# Note that this is actually the 'debug-nonroot' variant of the static-debian12
# image, which includes a busybox shell with just enough functionality to turn
# regular old Go test output into the gzipped tarball of junit XML that Sonobuoy
# craves.
OSBASEIMAGE = gcr.io/distroless/static-debian12@sha256:f556e84ce8fb32fdd5a4478550b720330a22f13ff52dab68d7a7bb3a4266829d
include ../../../build/makelib/imagelight.mk

ifeq ($(PLATFORM),$(filter $(PLATFORM),darwin_amd64 windows_amd64))
ifeq ($(PLATFORM),$(filter $(PLATFORM),darwin_amd64 darwin_arm64 windows_amd64))
$(info Skipping image build for $(PLATFORM))
img.build:
else
img.build:
@$(INFO) docker build $(IMAGE)
@$(MAKE) BUILD_ARGS="--load" img.build.shared
@$(OK) docker build $(IMAGE)
endif

ifeq ($(PLATFORM),$(filter $(PLATFORM),darwin_amd64 darwin_arm64 windows_amd64))
$(info Skipping image publish for $(PLATFORM))
img.publish:
else
img.publish:
@$(INFO) docker publish $(IMAGE)
@$(MAKE) BUILD_ARGS="--push" img.build.shared

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@$(OK) docker publish $(IMAGE)
endif

img.build.shared:
@cp Dockerfile $(IMAGE_TEMP_DIR) || $(FAIL)
@cp $(OUTPUT_DIR)/tests/$(OS)_$(ARCH)/tests $(IMAGE_TEMP_DIR)/conformance || $(FAIL)
@cp $(OUTPUT_DIR)/tests/linux_$(ARCH)/tests $(IMAGE_TEMP_DIR)/conformance || $(FAIL)
@cp ../../../run.sh $(IMAGE_TEMP_DIR) || $(FAIL)
@cd $(IMAGE_TEMP_DIR) && $(SED_CMD) 's|BASEIMAGE|$(OSBASEIMAGE)|g' Dockerfile || $(FAIL)
@docker build $(BUILD_ARGS) \
@docker buildx build $(BUILD_ARGS) \
--platform linux/$(ARCH) \
-t $(IMAGE) \
$(IMAGE_TEMP_DIR) || $(FAIL)
@$(OK) docker build $(IMAGE)
endif
$(IMAGE_TEMP_DIR) || $(FAIL)
Loading