fix e2e makefile target

pull/732/head
iwilltry42 3 years ago committed by Thorsten Klein
parent 6d45a15e05
commit 17dc4b7b4d
  1. 12
      Makefile
  2. 4
      pkg/runtimes/docker/translate.go
  3. 2
      tests/assets/config_test_simple.yaml
  4. 4
      tests/assets/config_test_simple_migration_v1alpha2.yaml
  5. 2
      tests/assets/config_test_simple_migration_v1alpha3.yaml
  6. 2
      tests/assets/test_registries.yaml
  7. 2
      version/version.go

@ -26,8 +26,8 @@ ifeq ($(GIT_TAG),)
GIT_TAG := $(shell git describe --always) GIT_TAG := $(shell git describe --always)
endif endif
# Docker image tag derived from Git tag # Docker image tag derived from Git tag (with prefix "v" stripped off)
K3D_IMAGE_TAG := $(GIT_TAG) K3D_IMAGE_TAG := $(GIT_TAG:v%=%)
# get latest k3s version: grep the tag and replace + with - (difference between git and dockerhub tags) # 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/\+/\-/') 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
build-helper-images: build-helper-images:
@echo "Building docker image rancher/k3d-proxy:$(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:$(GIT_TAG) DOCKER_BUILDKIT=1 docker build proxy/ -f proxy/Dockerfile -t rancher/k3d-proxy:$(K3D_IMAGE_TAG)
@echo "Building docker image rancher/k3d-tools:$(GIT_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:$(GIT_TAG) --build-arg GIT_TAG=$(GIT_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 ########## ########## Cleaning ##########

@ -280,10 +280,10 @@ func TranslateContainerDetailsToNode(containerDetails types.ContainerJSON) (*k3d
if clusterNet != nil { if clusterNet != nil {
parsedIP, err := netaddr.ParseIP(clusterNet.IPAddress) parsedIP, err := netaddr.ParseIP(clusterNet.IPAddress)
if err != nil { 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) 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 { } 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 isStaticIP := false

@ -6,7 +6,7 @@ agents: 2
kubeAPI: kubeAPI:
hostIP: "0.0.0.0" hostIP: "0.0.0.0"
hostPort: "6446" hostPort: "6446"
image: rancher/k3s:latest #image: rancher/k3s:latest
volumes: volumes:
- volume: $HOME:/some/path - volume: $HOME:/some/path
nodeFilters: nodeFilters:

@ -6,7 +6,7 @@ agents: 2
kubeAPI: kubeAPI:
hostIP: "0.0.0.0" hostIP: "0.0.0.0"
hostPort: "6446" hostPort: "6446"
image: rancher/k3s:latest #image: rancher/k3s:latest
volumes: volumes:
- volume: /my/path:/some/path - volume: /my/path:/some/path
nodeFilters: nodeFilters:
@ -48,4 +48,4 @@ options:
extraAgentArgs: [] extraAgentArgs: []
kubeconfig: kubeconfig:
updateDefaultKubeconfig: true updateDefaultKubeconfig: true
switchCurrentContext: true switchCurrentContext: true

@ -6,7 +6,7 @@ agents: 2
kubeAPI: kubeAPI:
hostIP: "0.0.0.0" hostIP: "0.0.0.0"
hostPort: "6446" hostPort: "6446"
image: rancher/k3s:latest #image: rancher/k3s:latest
volumes: volumes:
- volume: /my/path:/some/path - volume: /my/path:/some/path
nodeFilters: nodeFilters:

@ -1,4 +1,4 @@
mirrors: mirrors:
"my.company.registry": "my.company.registry":
endpoint: endpoint:
- http://my.company.registry:5000 - http://my.company.registry:5000

@ -37,7 +37,7 @@ var Version string
var HelperVersionOverride string var HelperVersionOverride string
// K3sVersion should contain the latest version tag of k3s (hardcoded at build time) // 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 // GetVersion returns the version for cli, it gets it from "git describe --tags" or returns "dev" when doing simple go build
func GetVersion() string { func GetVersion() string {

Loading…
Cancel
Save