Skip to content

Commit 41a2cae

Browse files
committed
Add new HAProxy 2.8 image reference
Add minimum implementation linking the new HAProxy 2.8 image into image-references. https://redhat.atlassian.net/browse/NE-2218
1 parent 7b7406e commit 41a2cae

8 files changed

Lines changed: 27 additions & 4 deletions

File tree

cmd/ingress-operator/start.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ type StartOptions struct {
5151
// IngressControllerImage is the pullspec of the ingress controller image to
5252
// be managed.
5353
IngressControllerImage string
54+
// ImageHAProxyPrevious is the pullspec of the previous HAProxy image to be managed.
55+
ImageHAProxyPrevious string
5456
// CanaryImage is the pullspec of the ingress operator image
5557
CanaryImage string
5658
// ReleaseVersion is the cluster version which the operator will converge to.
@@ -82,6 +84,7 @@ func NewStartCommand() *cobra.Command {
8284

8385
cmd.Flags().StringVarP(&options.OperatorNamespace, "namespace", "n", operatorcontroller.DefaultOperatorNamespace, "namespace the operator is deployed to (required)")
8486
cmd.Flags().StringVarP(&options.IngressControllerImage, "image", "i", "", "image of the ingress controller the operator will manage (required)")
87+
cmd.Flags().StringVarP(&options.ImageHAProxyPrevious, "image-haproxy-previous", "", "", "image of the previous HAProxy version the operator will manage (required)")
8588
cmd.Flags().StringVarP(&options.CanaryImage, "canary-image", "c", "", "image of the canary container that the operator will manage (optional)")
8689
cmd.Flags().StringVarP(&options.ReleaseVersion, "release-version", "", statuscontroller.UnknownVersionValue, "the release version the operator should converge to (required)")
8790
cmd.Flags().StringVarP(&options.MetricsListenAddr, "metrics-listen-addr", "", "127.0.0.1:60000", "metrics endpoint listen address (required)")
@@ -97,6 +100,9 @@ func NewStartCommand() *cobra.Command {
97100
if err := cmd.MarkFlagRequired("image"); err != nil {
98101
panic(err)
99102
}
103+
if err := cmd.MarkFlagRequired("image-haproxy-previous"); err != nil {
104+
panic(err)
105+
}
100106

101107
return cmd
102108
}
@@ -137,6 +143,7 @@ func start(opts *StartOptions) error {
137143
OperatorReleaseVersion: opts.ReleaseVersion,
138144
Namespace: opts.OperatorNamespace,
139145
IngressControllerImage: opts.IngressControllerImage,
146+
HAProxyImage: opts.ImageHAProxyPrevious,
140147
CanaryImage: opts.CanaryImage,
141148
GatewayAPIOperatorCatalog: opts.GatewayAPIOperatorCatalog,
142149
GatewayAPIOperatorChannel: opts.GatewayAPIOperatorChannel,

manifests/02-deployment-ibm-cloud-managed.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ spec:
3131
- $(WATCH_NAMESPACE)
3232
- --image
3333
- $(IMAGE)
34+
- --image-haproxy-previous
35+
- $(IMAGE_HAPROXY_PREVIOUS)
3436
- --canary-image
3537
- $(CANARY_IMAGE)
3638
- --release-version
@@ -52,6 +54,8 @@ spec:
5254
fieldPath: metadata.namespace
5355
- name: IMAGE
5456
value: openshift/origin-haproxy-router:v4.0
57+
- name: IMAGE_HAPROXY_PREVIOUS
58+
value: openshift/origin-haproxy:v2.8
5559
- name: CANARY_IMAGE
5660
value: openshift/origin-cluster-ingress-operator:latest
5761
- name: GATEWAY_API_OPERATOR_CATALOG

manifests/02-deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ spec:
6060
- "$(WATCH_NAMESPACE)"
6161
- --image
6262
- "$(IMAGE)"
63+
- --image-haproxy-previous
64+
- "$(IMAGE_HAPROXY_PREVIOUS)"
6365
- --canary-image
6466
- "$(CANARY_IMAGE)"
6567
- --release-version
@@ -81,6 +83,8 @@ spec:
8183
fieldPath: metadata.namespace
8284
- name: IMAGE
8385
value: openshift/origin-haproxy-router:v4.0
86+
- name: IMAGE_HAPROXY_PREVIOUS
87+
value: openshift/origin-haproxy:v2.8
8488
- name: CANARY_IMAGE
8589
value: openshift/origin-cluster-ingress-operator:latest
8690
- name: GATEWAY_API_OPERATOR_CATALOG

manifests/image-references

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ spec:
1010
from:
1111
kind: "DockerImage"
1212
name: "openshift/origin-haproxy-router:v4.0"
13+
- name: haproxy-router-haproxy28
14+
from:
15+
kind: "DockerImage"
16+
name: "openshift/origin-haproxy:v2.8"
1317
- name: kube-rbac-proxy
1418
from:
1519
kind: DockerImage

pkg/operator/config/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ type Config struct {
1212
// IngressControllerImage is the ingress controller image to manage.
1313
IngressControllerImage string
1414

15+
// HAProxyImage is the HAProxy image to be managed.
16+
HAProxyImage string
17+
1518
// CanaryImage is the ingress operator image, which runs a canary command.
1619
CanaryImage string
1720

pkg/operator/controller/ingress/controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ func hasName(name string) func(o client.Object) bool {
243243
type Config struct {
244244
Namespace string
245245
IngressControllerImage string
246+
HAProxyImage string
246247
IngressControllerDCMEnabled bool
247248
}
248249

pkg/operator/controller/ingress/deployment.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -830,10 +830,9 @@ func desiredRouterDeployment(ci *operatorv1.IngressController, config *Config, i
830830
// router image.
831831
deployment.Spec.Template.Spec.Containers[0].Image = config.IngressControllerImage
832832

833-
// haproxy image: using router's image for now, but it needs its own image.
834-
// HAProxy images: https://redhat.atlassian.net/browse/NE-2218
835-
// API field: https://redhat.atlassian.net/browse/NE-2217
836-
deployment.Spec.Template.Spec.InitContainers[1].Image = config.IngressControllerImage
833+
// haproxy image.
834+
// Missing API field: https://redhat.atlassian.net/browse/NE-2217
835+
deployment.Spec.Template.Spec.InitContainers[1].Image = config.HAProxyImage
837836

838837
deployment.Spec.Template.Spec.DNSPolicy = corev1.DNSClusterFirst
839838

pkg/operator/operator.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ func New(config operatorconfig.Config, kubeConfig *rest.Config) (*Operator, erro
183183
if _, err := ingresscontroller.New(mgr, ingresscontroller.Config{
184184
Namespace: config.Namespace,
185185
IngressControllerImage: config.IngressControllerImage,
186+
HAProxyImage: config.HAProxyImage,
186187
IngressControllerDCMEnabled: ingressControllerDCMEnabled,
187188
}); err != nil {
188189
return nil, fmt.Errorf("failed to create ingress controller: %v", err)

0 commit comments

Comments
 (0)