Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore_docker_version is ignored #2378

Open
yankcrime opened this issue Dec 14, 2020 · 6 comments
Open

ignore_docker_version is ignored #2378

yankcrime opened this issue Dec 14, 2020 · 6 comments

Comments

@yankcrime
Copy link

The ignore_docker_version option appears to be ignored. However, passing --ignore-docker-version works as expected.

RKE version:

rke version v1.2.3

Docker version: (docker version,docker info preferred)

20.10.0 (CE)

Operating system and kernel: (cat /etc/os-release, uname -r preferred)

Ubuntu 20.04

Type/provider of hosts: (VirtualBox/Bare-metal/AWS/GCE/DO)

VMware ESXi

cluster.yml file:

cluster_name: vspherenetes
ssh_agent_auth: true
ignore_docker_version: true
kubernetes_version: "v1.19.4-rancher1-1"

nodes:
    - address: 192.168.1.92
      user: nick
      role:
        - controlplane
        - etcd
    - address: 192.168.1.12
      user: nick
      role:
        - worker
    - address: 192.168.1.27
      user: nick
      role:
        - worker
    - address: 192.168.1.96
      user: nick
      role:
        - worker

Steps to Reproduce:
rke up

Results:

FATA[0000] Unsupported Docker version found [20.10.0] on host [192.168.1.67], supported versions are [1.13.x 17.03.x 17.06.x 17.09.x 18.06.x 18.09.x 19.03.x]
zsh: exit 1     rke up

Retrying with the --ignore-docker-version set results in a successful cluster deployment.

@superseb superseb self-assigned this Dec 15, 2020
@cesarandreslopez
Copy link

Noticed the same issue here

Retrying with the --ignore-docker-version set results in a successful cluster deployment.

@TemaSM
Copy link

TemaSM commented Jan 6, 2021

Confirmed
rke: v1.2.4-rc9
Docker: 20.10.2, build 2291f61
system: Ubuntu-2004-focal-64-minimal 5.4.0-47-generic

@dmpe
Copy link

dmpe commented Jan 7, 2021

Also confirmed

@dekimpew
Copy link

Confirmed for version 1.2.5.
rke: v1.2.5
Docker: 20.10.3, build 48d30b5
OS: CentOS Linux release 7.9.2009 (Core)

@Minizinger
Copy link

Still a problem with rke version v1.3.13 (works with --ignore-docker-version flag)

@superseb superseb removed their assignment Aug 18, 2022
@tashima42
Copy link

After a brief look at the code, I think I may have found the problem, still needs more investigation.

For this scenario, I'm assuming ignore_docker_version: true in cluster.yaml and that the flag --ignore-docker-version isn't provided.

The config is assigned here, so rkeConfig.IgnoreDockerVersion is set to true

rke/cmd/up.go

Line 329 in 5aaec0c

rkeConfig, err = cluster.ParseConfig(clusterFile)

Right after, it replaces the value of rkeConfig.IgnoreDockerVersion with a pointer to the value of the CLI flag ignore-docker-version

rke/cmd/up.go

Lines 336 to 337 in 5aaec0c

ignoreDockerVersion := ctx.Bool("ignore-docker-version")
rkeConfig.IgnoreDockerVersion = &ignoreDockerVersion

The issue is that, by default, if no value was provided, ctx.Bool returns false, so the value will always be false. This can be verified in the code for the release v1.22.5 for the package urfave/cli
https://github.com/urfave/cli/blob/850de854cda08e97afb500b72967f1a56f0330e5/flag_bool.go#L54-L56
https://github.com/urfave/cli/blob/850de854cda08e97afb500b72967f1a56f0330e5/flag_bool.go#L99-L109

A possible solution would be to check if the flag was actually set and only replace the value in the config if it was

if ctx.IsSet("ignore-docker-version") {
  ignoreDockerVersion := ctx.Bool("ignore-docker-version") 
  rkeConfig.IgnoreDockerVersion = &ignoreDockerVersion
}

I'm not sure about the solution, so further investigation is needed, but this can be used as a starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants