Skip to content

Commit 01cfd47

Browse files
fix nil pointer (#3453)
Co-authored-by: Stavros Kontopoulos <[email protected]>
1 parent 5eeb76a commit 01cfd47

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

hack/patches/022-serving-ingress-ns-filter.patch

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/vendor/knative.dev/operator/pkg/reconciler/knativeserving/knativeserving.go b/vendor/knative.dev/operator/pkg/reconciler/knativeserving/knativeserving.go
2-
index 4b8eca0b0..0398dfbf9 100644
2+
index 4b8eca0b0..ccf9f2f67 100644
33
--- a/vendor/knative.dev/operator/pkg/reconciler/knativeserving/knativeserving.go
44
+++ b/vendor/knative.dev/operator/pkg/reconciler/knativeserving/knativeserving.go
55
@@ -19,14 +19,15 @@ package knativeserving
@@ -20,21 +20,20 @@ index 4b8eca0b0..0398dfbf9 100644
2020
"knative.dev/operator/pkg/apis/operator/base"
2121
"knative.dev/operator/pkg/apis/operator/v1beta1"
2222
clientset "knative.dev/operator/pkg/client/clientset/versioned"
23-
@@ -86,7 +87,12 @@ func (r *Reconciler) FinalizeKind(ctx context.Context, original *v1beta1.Knative
24-
logger.Error("Unable to fetch installed manifest; no cluster-scoped resources will be finalized", err)
23+
@@ -90,6 +91,12 @@ func (r *Reconciler) FinalizeKind(ctx context.Context, original *v1beta1.Knative
24+
if manifest == nil {
2525
return nil
2626
}
27-
-
2827
+ // we need this to apply the correct namespace to the resources otherwise it defaults to knative-serving
2928
+ *manifest, err = manifest.Transform(overrideKourierNamespace(original))
3029
+ if err != nil {
3130
+ logger.Error("Unable to apply kourier namespace transform", err)
3231
+ return nil
3332
+ }
34-
if manifest == nil {
35-
return nil
36-
}
37-
@@ -97,6 +103,20 @@ func (r *Reconciler) FinalizeKind(ctx context.Context, original *v1beta1.Knative
33+
34+
if err := common.Uninstall(manifest); err != nil {
35+
logger.Error("Failed to finalize platform resources", err)
36+
@@ -97,6 +104,20 @@ func (r *Reconciler) FinalizeKind(ctx context.Context, original *v1beta1.Knative
3837
return nil
3938
}
4039

@@ -55,7 +54,7 @@ index 4b8eca0b0..0398dfbf9 100644
5554
// ReconcileKind compares the actual state with the desired, and attempts to
5655
// converge the two.
5756
func (r *Reconciler) ReconcileKind(ctx context.Context, ks *v1beta1.KnativeServing) pkgreconciler.Event {
58-
@@ -117,6 +137,10 @@ func (r *Reconciler) ReconcileKind(ctx context.Context, ks *v1beta1.KnativeServi
57+
@@ -117,6 +138,10 @@ func (r *Reconciler) ReconcileKind(ctx context.Context, ks *v1beta1.KnativeServi
5958
security.AppendTargetSecurity,
6059
common.AppendAdditionalManifests,
6160
r.appendExtensionManifests,

vendor/knative.dev/operator/pkg/reconciler/knativeserving/knativeserving.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,16 @@ func (r *Reconciler) FinalizeKind(ctx context.Context, original *v1beta1.Knative
8787
logger.Error("Unable to fetch installed manifest; no cluster-scoped resources will be finalized", err)
8888
return nil
8989
}
90+
91+
if manifest == nil {
92+
return nil
93+
}
9094
// we need this to apply the correct namespace to the resources otherwise it defaults to knative-serving
9195
*manifest, err = manifest.Transform(overrideKourierNamespace(original))
9296
if err != nil {
9397
logger.Error("Unable to apply kourier namespace transform", err)
9498
return nil
9599
}
96-
if manifest == nil {
97-
return nil
98-
}
99100

100101
if err := common.Uninstall(manifest); err != nil {
101102
logger.Error("Failed to finalize platform resources", err)

0 commit comments

Comments
 (0)