Skip to content

Commit

Permalink
[redhat-3.13] blocker: fixing recursed accumulation of path for manag…
Browse files Browse the repository at this point in the history
…ed clair resources (PROJQUAY-7993) (#970)

The scale-down component was never rendered because of the incorrect path.
The clair-postgres and clair-app needed to scale back after the postgres upgrade.

This change ensures following flow in the case where clair is managed:
- Scale down clair-app
- Scale down clair-postgres
- Upgrade clair-postgres
- Scale up clair-postgres
- Scale up clair-app

---------

Co-authored-by: Shubhra Deshpande <shubhrajayant+github.com>
  • Loading branch information
openshift-cherrypick-robot authored Oct 8, 2024
1 parent cc5a566 commit 2d9f2fe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: clair-app
spec:
replicas: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: clair-postgres
spec:
replicas: 2
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
patchesStrategicMerge:
- ./clair.deployment.patch.yaml
resources:
- "../base"
- ./clair-pg-scale-up.patch.yaml
- ./clair.deployment-scale-up.patch.yaml
components:
- ../base
3 changes: 2 additions & 1 deletion pkg/kustomize/kustomize.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,9 @@ func KustomizationFor(
if ctx.NeedsClairPgUpgrade {
if v1.ComponentIsManaged(quay.Spec.Components, v1.ComponentClair) {
componentPaths = append(componentPaths, "../components/clairpgupgrade/scale-down-clair")
} else {
componentPaths = append(componentPaths, "../components/clairpgupgrade/base")
}
componentPaths = append(componentPaths, "../components/clairpgupgrade/base")
}

images := []types.Image{}
Expand Down

0 comments on commit 2d9f2fe

Please sign in to comment.