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
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

include hack/tools/Makefile.variables
include embedded-bins/Makefile.variables
include inttest/Makefile.variables

Expand Down Expand Up @@ -63,19 +64,17 @@ static/bin/k0s:

static/helm/000-admin-console-$(admin_console_version).tgz: helm
@mkdir -p static/helm
helm pull oci://registry.replicated.com/library/admin-console --version=$(admin_console_version)
$(HELM) pull oci://registry.replicated.com/library/admin-console --version=$(admin_console_version)
mv admin-console-$(admin_console_version).tgz static/helm/000-admin-console-$(admin_console_version).tgz

##@ Development
HELM = $(BIN_DIR)/helm
.PHONY: helm
helm:
@mkdir -p $(BIN_DIR)
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | \
DESIRED_VERSION=v$(helm_version) HELM_INSTALL_DIR=$(BIN_DIR) USE_SUDO=false bash

GOLANGCI_LINT = $(BIN_DIR)/golangci-lint
.PHONY: golangci-lint
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sh -s -- -b $(shell dirname $(GOLANGCI_LINT));\
}
##@ Development

.PHONY: lint
lint: golangci-lint go.sum ## Run golangci-lint linter
Expand All @@ -97,11 +96,12 @@ $(smoketests): build
.PHONY: smoketests
smoketests: $(smoketests)

.PHONY: helm
helm:
GOLANGCI_LINT = $(BIN_DIR)/golangci-lint
.PHONY: golangci-lint
golangci-lint:
@mkdir -p $(BIN_DIR)
curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | \
DESIRED_VERSION=v$(helm_version) HELM_INSTALL_DIR=$(BIN_DIR) USE_SUDO=false bash
curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v$(golangci-lint_version)

go.sum: go.mod
$(GO) mod tidy && touch -c -- '$@'
1 change: 1 addition & 0 deletions hack/tools/Makefile.variables
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
golangci-lint_version = 1.52.2
3 changes: 3 additions & 0 deletions inttest/footloose-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ RUN if [ "$TARGETARCH" != arm ]; then \
&& chmod 755 /usr/local/bin/cri-dockerd; \
fi
ADD cri-dockerd.sh /etc/init.d/cri-dockerd

ADD docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
15 changes: 15 additions & 0 deletions inttest/footloose-alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

# kubelet uses /sys/class/dmi/id/product_name to check if is running on a GCE VM and then attempts to query the metadata server
# this fails and kubelet fails to register the node
fix_product_name() {
if [ -f /sys/class/dmi/id/product_name ]; then
mkdir -p /k0s
echo 'k0svm' > /k0s/product_name
mount -o ro,bind /k0s/product_name /sys/class/dmi/id/product_name
fi
}

fix_product_name

exec $@