Skip to content

Commit 1f90625

Browse files
Merge pull request #233 from alebedev87/stable-1.3
NE-1777: Add new OLM channel for 1.3 release
2 parents 663a245 + f6fc9f4 commit 1f90625

File tree

9 files changed

+71
-45
lines changed

9 files changed

+71
-45
lines changed

Dockerfile.bundle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
55
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
66
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
77
LABEL operators.operatorframework.io.bundle.package.v1=external-dns-operator
8-
LABEL operators.operatorframework.io.bundle.channels.v1=stable-v1.2,stable-v1
8+
LABEL operators.operatorframework.io.bundle.channels.v1=stable-v1.3,stable-v1
99
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable-v1
1010

1111
# Copy files to locations specified by labels.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# To re-generate a bundle for another specific version without changing the standard setup, you can:
44
# - use the BUNDLE_VERSION as arg of the bundle target (e.g make bundle BUNDLE_VERSION=0.0.2)
55
# - use environment variables to overwrite this value (e.g export BUNDLE_VERSION=0.0.2)
6-
BUNDLE_VERSION ?= 1.2.0
6+
BUNDLE_VERSION ?= 1.3.0
77

88
# CHANNELS define the bundle channels used in the bundle.
99
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")

bundle/manifests/external-dns-operator.clusterserviceversion.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,15 @@ metadata:
310310
features.operators.openshift.io/token-auth-aws: "false"
311311
features.operators.openshift.io/token-auth-azure: "false"
312312
features.operators.openshift.io/token-auth-gcp: "false"
313-
olm.skipRange: <1.2.0
313+
olm.skipRange: <1.3.0
314314
operatorframework.io/suggested-namespace: external-dns-operator
315+
operators.openshift.io/valid-subscription: '["OpenShift Kubernetes Engine", "OpenShift
316+
Container Platform", "OpenShift Platform Plus"]'
315317
operators.operatorframework.io/builder: operator-sdk-v1.16.0+git
316318
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
317319
repository: https://github.com/openshift/external-dns-operator
318320
support: Red Hat, Inc.
319-
name: external-dns-operator.v1.2.0
321+
name: external-dns-operator.v1.3.0
320322
namespace: external-dns-operator
321323
spec:
322324
apiservicedefinitions: {}
@@ -597,7 +599,7 @@ spec:
597599
minKubeVersion: 1.22.0
598600
provider:
599601
name: Red Hat, Inc.
600-
version: 1.2.0
602+
version: 1.3.0
601603
webhookdefinitions:
602604
- admissionReviewVersions:
603605
- v1

bundle/metadata/annotations.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ annotations:
33
operators.operatorframework.io.bundle.manifests.v1: "manifests/"
44
operators.operatorframework.io.bundle.metadata.v1: "metadata/"
55
operators.operatorframework.io.bundle.package.v1: "external-dns-operator"
6-
operators.operatorframework.io.bundle.channels.v1: "stable-v1.2,stable-v1"
6+
operators.operatorframework.io.bundle.channels.v1: "stable-v1.3,stable-v1"
77
operators.operatorframework.io.bundle.channel.default.v1: "stable-v1"
88
# should this operator be supported on OCP 4.4 and earlier (old appregistry format)
99
com.redhat.delivery.backport: false

catalog/external-dns-operator/bundle.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
image: quay.io/external-dns-operator/external-dns-operator-bundle:latest
3-
name: external-dns-operator.v1.2.0
3+
name: external-dns-operator.v1.3.0
44
package: external-dns-operator
55
properties:
66
- type: olm.gvk
@@ -16,7 +16,7 @@ properties:
1616
- type: olm.package
1717
value:
1818
packageName: external-dns-operator
19-
version: 1.2.0
19+
version: 1.3.0
2020
- type: olm.csv.metadata
2121
value:
2222
annotations:
@@ -328,8 +328,10 @@ properties:
328328
features.operators.openshift.io/token-auth-aws: "false"
329329
features.operators.openshift.io/token-auth-azure: "false"
330330
features.operators.openshift.io/token-auth-gcp: "false"
331-
olm.skipRange: <1.2.0
331+
olm.skipRange: <1.3.0
332332
operatorframework.io/suggested-namespace: external-dns-operator
333+
operators.openshift.io/valid-subscription: '["OpenShift Kubernetes Engine",
334+
"OpenShift Container Platform", "OpenShift Platform Plus"]'
333335
operators.operatorframework.io/builder: operator-sdk-v1.16.0+git
334336
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
335337
repository: https://github.com/openshift/external-dns-operator

catalog/external-dns-operator/channel.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ schema: olm.channel
33
name: stable-v1
44
package: external-dns-operator
55
entries:
6-
- name: external-dns-operator.v1.2.0
6+
- name: external-dns-operator.v1.3.0
77
---
88
schema: olm.channel
9-
name: stable-v1.2
9+
name: stable-v1.3
1010
package: external-dns-operator
1111
entries:
12-
- name: external-dns-operator.v1.2.0
12+
- name: external-dns-operator.v1.3.0

config/manifests/bases/external-dns-operator.clusterserviceversion.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ metadata:
1414
features.operators.openshift.io/token-auth-aws: "false"
1515
features.operators.openshift.io/token-auth-azure: "false"
1616
features.operators.openshift.io/token-auth-gcp: "false"
17-
olm.skipRange: <1.2.0
17+
olm.skipRange: <1.3.0
1818
operatorframework.io/suggested-namespace: external-dns-operator
19+
operators.openshift.io/valid-subscription: '["OpenShift Kubernetes Engine", "OpenShift
20+
Container Platform", "OpenShift Platform Plus"]'
1921
repository: https://github.com/openshift/external-dns-operator
2022
support: Red Hat, Inc.
21-
name: external-dns-operator.v1.2.0
23+
name: external-dns-operator.v1.3.0
2224
namespace: external-dns-operator
2325
spec:
2426
apiservicedefinitions: {}
@@ -72,4 +74,4 @@ spec:
7274
minKubeVersion: 1.22.0
7375
provider:
7476
name: Red Hat, Inc.
75-
version: 1.2.0
77+
version: 1.3.0

docs/openshift.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ $ ./hack/add-serving-cert.sh --namespace external-dns-operator --service webhook
1414
## Release-branch mapping
1515
| OCP version | ExternalDNS Operator branch |
1616
| :---------: | :-------------------------: |
17+
| 4.17 | release-1.3 |
18+
| 4.16 | release-1.2 |
19+
| 4.15 | release-1.2 |
1720
| 4.14 | release-1.2 |
1821
| 4.13 | release-1.1 |
1922
| 4.12 | release-1.1 |

test/e2e/infoblox.go

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"os"
1111
"strconv"
1212
"strings"
13+
"time"
1314

1415
"github.com/openshift/external-dns-operator/test/common"
1516

@@ -19,6 +20,7 @@ import (
1920
appsv1 "k8s.io/api/apps/v1"
2021
corev1 "k8s.io/api/core/v1"
2122
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23+
"k8s.io/apimachinery/pkg/util/wait"
2224
"sigs.k8s.io/controller-runtime/pkg/client"
2325

2426
operatorv1alpha1 "github.com/openshift/external-dns-operator/api/v1alpha1"
@@ -267,9 +269,9 @@ func (h *infobloxTestHelper) trustGridTLSCert() error {
267269
}
268270

269271
// inject into subscription if there is one
270-
findOperatorSubscription := func() (*olmv1alpha1.Subscription, error) {
272+
findOperatorSubscription := func(ctx context.Context) (*olmv1alpha1.Subscription, error) {
271273
list := &olmv1alpha1.SubscriptionList{}
272-
if err := common.KubeClient.List(context.TODO(), list, client.InNamespace(operatorNs)); err != nil {
274+
if err := common.KubeClient.List(ctx, list, client.InNamespace(operatorNs)); err != nil {
273275
return nil, err
274276
}
275277
for _, sub := range list.Items {
@@ -284,25 +286,33 @@ func (h *infobloxTestHelper) trustGridTLSCert() error {
284286
}
285287
return nil, nil
286288
}
287-
subscription, err := findOperatorSubscription()
288-
if err != nil {
289-
return fmt.Errorf("failed to find operator subscription: %w", err)
290-
}
291-
if subscription != nil {
292-
if subscription.Spec.Config == nil {
293-
subscription.Spec.Config = &olmv1alpha1.SubscriptionConfig{}
289+
290+
if err := wait.PollUntilContextTimeout(context.TODO(), 2*time.Second, 1*time.Minute, true, func(ctx context.Context) (bool, error) {
291+
subscription, err := findOperatorSubscription(ctx)
292+
if err != nil {
293+
fmt.Printf("failed while finding operator subscription: %v, retrying ...\n", err)
294+
return false, nil
294295
}
295-
subscription.Spec.Config.Env = ensureEnvVar(subscription.Spec.Config.Env, trustedCAEnvVar)
296-
if err := common.KubeClient.Update(context.TODO(), subscription); err != nil {
297-
return fmt.Errorf("failed to inject trusted CA environment variable into the subscription: %w", err)
296+
if subscription != nil {
297+
if subscription.Spec.Config == nil {
298+
subscription.Spec.Config = &olmv1alpha1.SubscriptionConfig{}
299+
}
300+
subscription.Spec.Config.Env = ensureEnvVar(subscription.Spec.Config.Env, trustedCAEnvVar)
301+
if err := common.KubeClient.Update(ctx, subscription); err != nil {
302+
fmt.Printf("failed to inject trusted CA environment variable into the subscription: %v, retrying ...\n", err)
303+
return false, nil
304+
}
305+
return true, nil
298306
}
299-
return nil
307+
fmt.Println("no suscription was found, trying to update the deployment directly")
308+
return true, nil
309+
}); err != nil {
310+
return fmt.Errorf("timed out trying to inject trusted CA into the subscription")
300311
}
301312

302-
// no subscription was found, try to update the deployment directly
303-
findOperatorDeployment := func() (*appsv1.Deployment, error) {
313+
findOperatorDeployment := func(ctx context.Context) (*appsv1.Deployment, error) {
304314
list := &appsv1.DeploymentList{}
305-
if err := common.KubeClient.List(context.TODO(), list, client.InNamespace(operatorNs)); err != nil {
315+
if err := common.KubeClient.List(ctx, list, client.InNamespace(operatorNs)); err != nil {
306316
return nil, err
307317
}
308318
for _, depl := range list.Items {
@@ -312,22 +322,29 @@ func (h *infobloxTestHelper) trustGridTLSCert() error {
312322
}
313323
return nil, nil
314324
}
315-
deployment, err := findOperatorDeployment()
316-
if err != nil {
317-
return fmt.Errorf("failed to find operator deployment: %w", err)
318-
}
319-
if deployment == nil {
320-
return fmt.Errorf("no operator deployment found")
321-
}
325+
if err := wait.PollUntilContextTimeout(context.TODO(), 2*time.Second, 1*time.Minute, true, func(ctx context.Context) (bool, error) {
326+
deployment, err := findOperatorDeployment(ctx)
327+
if err != nil {
328+
fmt.Printf("failed while finding operator deployment: %v, retrying ...\n", err)
329+
return false, nil
330+
}
331+
if deployment == nil {
332+
return false, fmt.Errorf("no operator deployment found")
333+
}
322334

323-
for i := range deployment.Spec.Template.Spec.Containers {
324-
if deployment.Spec.Template.Spec.Containers[i].Name == operatorContainerName {
325-
deployment.Spec.Template.Spec.Containers[i].Env = ensureEnvVar(deployment.Spec.Template.Spec.Containers[i].Env, trustedCAEnvVar)
326-
break
335+
for i := range deployment.Spec.Template.Spec.Containers {
336+
if deployment.Spec.Template.Spec.Containers[i].Name == operatorContainerName {
337+
deployment.Spec.Template.Spec.Containers[i].Env = ensureEnvVar(deployment.Spec.Template.Spec.Containers[i].Env, trustedCAEnvVar)
338+
break
339+
}
327340
}
328-
}
329-
if err := common.KubeClient.Update(context.TODO(), deployment); err != nil {
330-
return fmt.Errorf("failed to inject trusted CA environment variable into the deployment: %w", err)
341+
if err := common.KubeClient.Update(ctx, deployment); err != nil {
342+
fmt.Printf("failed to inject trusted CA environment variable into the deployment: %v\n", err)
343+
return false, nil
344+
}
345+
return true, nil
346+
}); err != nil {
347+
return fmt.Errorf("failed trying to inject trusted CA into the subscription: %w", err)
331348
}
332349

333350
return nil

0 commit comments

Comments
 (0)