With the current implementation of the “Service” route-method of the Blue-Green strategy, if the manifest file contains Service object beforeDeployment ones, then, Service isn’t updated with the right labels selector.
To fix this issue, update getManifestObjects() function in the src/strategyHelpers/blueGreen/blueGreenHelper.ts file to first extract all objects from the manifest file, and then identify “routed” service entities. This way, even if the Deployment object is declared after the “routed” Service, Blue-Green strategy will be able to not update the Service until the routing switch (done in routeBlueGreenForDeploy(), in src/strategyHelpers/blueGreen/route.ts).
With the current implementation of the “Service” route-method of the Blue-Green strategy, if the manifest file contains
Service
object beforeDeployment
ones, then,Service
isn’t updated with the right labels selector.Sample affected manifest file
```yaml apiVersion: v1 kind: Service metadata: name: nginx-service spec: selector: app: nginx ports: - protocol: TCP port: 80 targetPort: 80 --- apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment labels: app: nginx spec: replicas: 1 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx ports: - containerPort: 80 ```To fix this issue, update
getManifestObjects()
function in thesrc/strategyHelpers/blueGreen/blueGreenHelper.ts
file to first extract all objects from the manifest file, and then identify “routed” service entities. This way, even if theDeployment
object is declared after the “routed”Service
, Blue-Green strategy will be able to not update theService
until the routing switch (done inrouteBlueGreenForDeploy()
, insrc/strategyHelpers/blueGreen/route.ts
).