This PR fixes an issue where the traefik-mesh-controller/traefik-mesh-prepare script would fail if the version of CoreDNS deployed in your environment contains a prefix. This has been seen on AWS EKS, where a build version is present (i.e: v1.6.6-eksbuild.1).
As described in the #773 issue, this is due to the way hashicorp/go-version handles version string when verified using goversion.NewConstraint(">= 1.3, < 1.8") as it considers any -suffix to be a pre-release version instead of a metadata (expecting a +suffix instead). This can be fixed by using the form version.GreaterThanOrEqual("1.3") && version.LessThan("1.8").
Fixes #773
How to test it
Deploy an AWS EKS v1.17 environment (which would be deployed with CoreDNS v1.6.6-eksbuild.1)
Deploy the traefik-mesh helm chart using this code, which should now be able to be deployed.
The specific use-case describe in the original issue has also been added as a test case in pkg/dns/dns_test.go for future reference.
Additional Notes
This has been tested on an AWS EKS v1.17-eks.3 cluster with the default CNI removed and replaced by Calico.
What does this PR do?
This PR fixes an issue where the
traefik-mesh-controller/traefik-mesh-prepare
script would fail if the version of CoreDNS deployed in your environment contains a prefix. This has been seen on AWS EKS, where a build version is present (i.e:v1.6.6-eksbuild.1
).As described in the #773 issue, this is due to the way hashicorp/go-version handles version string when verified using
goversion.NewConstraint(">= 1.3, < 1.8")
as it considers any-suffix
to be a pre-release version instead of a metadata (expecting a+suffix
instead). This can be fixed by using the formversion.GreaterThanOrEqual("1.3") && version.LessThan("1.8")
.Fixes #773
How to test it
traefik-mesh
helm chart using this code, which should now be able to be deployed.The specific use-case describe in the original issue has also been added as a test case in
pkg/dns/dns_test.go
for future reference.Additional Notes
This has been tested on an AWS EKS v1.17-eks.3 cluster with the default CNI removed and replaced by Calico.