Describe the Issue
During the development process of SCC Operator we go through various phases that require different default behaviour. Currently the Operator is not fully able to support every mode we need to test in. We have this behaviour due to varying shifting requirements as it was earlier in development and the recent containerization effort left things behaving a bit odd.
Here are the use-cases I can imagine we need to cover:
|
Use Prod SCC |
Send Rancher version.Version value |
Version Sent |
| Main Dev Cycle |
false |
false |
"other" |
| Dev Prod Integration |
true |
false |
"other" |
| Dev Prod Integration w/Override |
true |
false |
Sends a real previous stable version - via Env override |
| Rancher Alpha's |
false |
false |
"other" |
| Rancher Alpha's w/Override |
true |
false |
Point to Prod SCC and send previous real version via Env overrides |
| Rancher RCs |
true |
false |
Version minus the "-rc.*" (Pre-release part removed) |
| Rancher Stable |
true |
true |
Unmodified Version |
Background
There are some basic requirements to keep in mind while solving this issue, these are:
- The SCC (SUSE Customer Center) does not have a universal "Rancher" Product - every version is a unique Product Label,
- The Product Label is constructed by the SCC library (
connect-ng) using a "product triplet"; consisting of Product, Version, Arch (which is: Rancher, Other/{real version}, unknown)
- If a version is not in the SCC it cannot be used for registration and we must use
"other" as the version instead
- The SCC API URL selection logic (for default value) is based on
CATTLE_DEV_MODE
- The logic to decide to send the raw Rancher version or
"other" is based on CATTLE_DEV_MODE
Proposed Fixes
Roughly speaking, these fixes are still the long term goal. However, the SCC Operator is currently built both with lots of bias to 1 Product = 1 Operator; and SCC-Operator is for Rancher by default. Long story short, fixing this before properly supporting multiple products (even just in theory) will complicate the solution too (and require lots of rebases later).
Product Version picking improvement:
Should implement all these:
Revert "other" version logic back to prior version
Previous versions of the logic (before containerization) actually parsed the Rancher version identify if it is valid SemVer. This logic was able to ensure that if we found a Pre-release section of the version then we sent "other" as the value.
Introduce a Dev override for testing various product versions
Along with above change, we will introduce an Env var that can be used to set a specific version.
Stop using CATTLE_DEV_MODE for selecting version all together
Simple as that.
SCC URL picking improvement
Introduce a new SCC_DEV_MODE to scc-operator
Unlike CATTLE_DEV_MODE the SCC_DEV_MODE dev mode will parse the value set - so it will respect false truthy string values as being false (i.e. disable mode). Where as any value set to CATTLE_DEV_MODE are considered as true.
Modify Rancher's SCC Deployer to use SCC_DEV_MODE
Adjust Rancher deployer to set SCC_DEV_MODE env on the SCC deployment based on: a) if it is set by user on r/r (copy this variable like other Envs), or b) Rancher version is not a prod build with SemVer version set then set SCC_DEV_MODE=true.
Adjust URL picking logic to rely on SCC_DEV_MODE
When set true (and the SCC Environment is set to target SCC; not RMT/RGS/etc) we use Staging SCC URL, otherwise we use Prod URL.
Describe the Issue
During the development process of SCC Operator we go through various phases that require different default behaviour. Currently the Operator is not fully able to support every mode we need to test in. We have this behaviour due to varying shifting requirements as it was earlier in development and the recent containerization effort left things behaving a bit odd.
Here are the use-cases I can imagine we need to cover:
version.Versionvaluefalsefalse"other"truefalse"other"truefalsefalsefalse"other"truefalsetruefalsetruetrueBackground
There are some basic requirements to keep in mind while solving this issue, these are:
connect-ng) using a "product triplet"; consisting of Product, Version, Arch (which is: Rancher, Other/{real version}, unknown)"other"as the version insteadCATTLE_DEV_MODE"other"is based onCATTLE_DEV_MODEProposed Fixes
Roughly speaking, these fixes are still the long term goal. However, the SCC Operator is currently built both with lots of bias to 1 Product = 1 Operator; and SCC-Operator is for Rancher by default. Long story short, fixing this before properly supporting multiple products (even just in theory) will complicate the solution too (and require lots of rebases later).
Product Version picking improvement:
Should implement all these:
Revert
"other"version logic back to prior versionPrevious versions of the logic (before containerization) actually parsed the Rancher version identify if it is valid SemVer. This logic was able to ensure that if we found a Pre-release section of the version then we sent
"other"as the value.Introduce a Dev override for testing various product versions
Along with above change, we will introduce an Env var that can be used to set a specific version.
Stop using
CATTLE_DEV_MODEfor selecting version all togetherSimple as that.
SCC URL picking improvement
Introduce a new
SCC_DEV_MODEto scc-operatorUnlike
CATTLE_DEV_MODEtheSCC_DEV_MODEdev mode will parse the value set - so it will respectfalsetruthy string values as being false (i.e. disable mode). Where as any value set toCATTLE_DEV_MODEare considered as true.Modify Rancher's SCC Deployer to use
SCC_DEV_MODEAdjust Rancher deployer to set
SCC_DEV_MODEenv on the SCC deployment based on: a) if it is set by user onr/r(copy this variable like other Envs), or b) Rancher version is not a prod build with SemVer version set then setSCC_DEV_MODE=true.Adjust URL picking logic to rely on
SCC_DEV_MODEWhen set
true(and the SCC Environment is set to target SCC; not RMT/RGS/etc) we use Staging SCC URL, otherwise we use Prod URL.