Closed ibumarskov closed 2 years ago
hello @ibumarskov, Thanks for reporting your issue and providing a fix for it :) As I said in an earlier issue, Casskop is in a complex state with little support from Orange at this stage. Let's talk in the PR thread :)
Bug Report
If we don't explicitly specify the serverVersion in CR, operator should parse this value from image name. Some deployments can contains proxy for image repository and in this case image name can looks like:
cassandraImage: '127.0.0.1:44301/tungsten/cassandra:3.11.6'
In this case operator can't detect version due to incorrect logic and leave _PRODUCTVERSION env variable empty: https://github.com/Orange-OpenSource/casskop/blob/2d00f1ab1950226b13309e5b633a1bf2ebcd86b6/pkg/controller/cassandracluster/generator.go#L634 it's lead to error in config-builder init container.
Environment
Possible Solution Change appropriate code in following way:
if serverVersion == "" { if len(image) >= 2 { version := strings.Split(image[len(image)-1], "-") serverVersion = version[0] if len(version) != 1 { serverVersion += ".0" } } }