diff --git a/Makefile b/Makefile index 17e2c2ee..19a78096 100644 --- a/Makefile +++ b/Makefile @@ -26,8 +26,8 @@ ifeq ($(GIT_TAG),) GIT_TAG := $(shell git describe --always) endif -# Docker image tag derived from Git tag -K3D_IMAGE_TAG := $(GIT_TAG) +# Docker image tag derived from Git tag (with prefix "v" stripped off) +K3D_IMAGE_TAG := $(GIT_TAG:v%=%) # get latest k3s version: grep the tag and replace + with - (difference between git and dockerhub tags) K3S_TAG := $(shell curl --silent "https://update.k3s.io/v1-release/channels/stable" | egrep -o '/v[^ ]+"' | sed -E 's/\/|\"//g' | sed -E 's/\+/\-/') @@ -129,10 +129,10 @@ build-docker-%: # build helper images build-helper-images: - @echo "Building docker image rancher/k3d-proxy:$(GIT_TAG)" - DOCKER_BUILDKIT=1 docker build proxy/ -f proxy/Dockerfile -t rancher/k3d-proxy:$(GIT_TAG) - @echo "Building docker image rancher/k3d-tools:$(GIT_TAG)" - DOCKER_BUILDKIT=1 docker build --no-cache tools/ -f tools/Dockerfile -t rancher/k3d-tools:$(GIT_TAG) --build-arg GIT_TAG=$(GIT_TAG) + @echo "Building docker image rancher/k3d-proxy:$(K3D_IMAGE_TAG)" + DOCKER_BUILDKIT=1 docker build proxy/ -f proxy/Dockerfile -t rancher/k3d-proxy:$(K3D_IMAGE_TAG) + @echo "Building docker image rancher/k3d-tools:$(K3D_IMAGE_TAG)" + DOCKER_BUILDKIT=1 docker build --no-cache tools/ -f tools/Dockerfile -t rancher/k3d-tools:$(K3D_IMAGE_TAG) --build-arg GIT_TAG=$(GIT_TAG) ############################## ########## Cleaning ########## diff --git a/pkg/runtimes/docker/translate.go b/pkg/runtimes/docker/translate.go index 51378ba5..d4bd1481 100644 --- a/pkg/runtimes/docker/translate.go +++ b/pkg/runtimes/docker/translate.go @@ -280,10 +280,10 @@ func TranslateContainerDetailsToNode(containerDetails types.ContainerJSON) (*k3d if clusterNet != nil { parsedIP, err := netaddr.ParseIP(clusterNet.IPAddress) if err != nil { - if nodeState.Running && nodeState.Status != "restarting" { + if nodeState.Running && nodeState.Status != "restarting" { // if the container is not running or currently restarting, it won't have an IP, so we don't error in that case return nil, fmt.Errorf("failed to parse IP '%s' for container '%s': %s\nStatus: %v\n%+v", clusterNet.IPAddress, containerDetails.Name, err, nodeState.Status, containerDetails.NetworkSettings) } else { - log.L.Debugf("failed to parse IP '%s' for container '%s', likely because it's not running (or restarting): %v", clusterNet.IPAddress, containerDetails.Name, err) + log.L.Tracef("failed to parse IP '%s' for container '%s', likely because it's not running (or restarting): %v", clusterNet.IPAddress, containerDetails.Name, err) } } isStaticIP := false diff --git a/tests/assets/config_test_simple.yaml b/tests/assets/config_test_simple.yaml index 67c3fd6d..8bbc031e 100755 --- a/tests/assets/config_test_simple.yaml +++ b/tests/assets/config_test_simple.yaml @@ -6,7 +6,7 @@ agents: 2 kubeAPI: hostIP: "0.0.0.0" hostPort: "6446" -image: rancher/k3s:latest +#image: rancher/k3s:latest volumes: - volume: $HOME:/some/path nodeFilters: diff --git a/tests/assets/config_test_simple_migration_v1alpha2.yaml b/tests/assets/config_test_simple_migration_v1alpha2.yaml index 26140674..49fb1bfe 100755 --- a/tests/assets/config_test_simple_migration_v1alpha2.yaml +++ b/tests/assets/config_test_simple_migration_v1alpha2.yaml @@ -6,7 +6,7 @@ agents: 2 kubeAPI: hostIP: "0.0.0.0" hostPort: "6446" -image: rancher/k3s:latest +#image: rancher/k3s:latest volumes: - volume: /my/path:/some/path nodeFilters: @@ -48,4 +48,4 @@ options: extraAgentArgs: [] kubeconfig: updateDefaultKubeconfig: true - switchCurrentContext: true \ No newline at end of file + switchCurrentContext: true diff --git a/tests/assets/config_test_simple_migration_v1alpha3.yaml b/tests/assets/config_test_simple_migration_v1alpha3.yaml index f2203186..776af36f 100755 --- a/tests/assets/config_test_simple_migration_v1alpha3.yaml +++ b/tests/assets/config_test_simple_migration_v1alpha3.yaml @@ -6,7 +6,7 @@ agents: 2 kubeAPI: hostIP: "0.0.0.0" hostPort: "6446" -image: rancher/k3s:latest +#image: rancher/k3s:latest volumes: - volume: /my/path:/some/path nodeFilters: diff --git a/tests/assets/test_registries.yaml b/tests/assets/test_registries.yaml index c9fa033a..058f41e6 100755 --- a/tests/assets/test_registries.yaml +++ b/tests/assets/test_registries.yaml @@ -1,4 +1,4 @@ mirrors: "my.company.registry": endpoint: - - http://my.company.registry:5000 \ No newline at end of file + - http://my.company.registry:5000 diff --git a/version/version.go b/version/version.go index 53f13d8b..13a2090b 100644 --- a/version/version.go +++ b/version/version.go @@ -37,7 +37,7 @@ var Version string var HelperVersionOverride string // K3sVersion should contain the latest version tag of k3s (hardcoded at build time) -var K3sVersion = "v1.20.0-k3s2" +var K3sVersion = "v1.21.4-k3s2" // GetVersion returns the version for cli, it gets it from "git describe --tags" or returns "dev" when doing simple go build func GetVersion() string {