Skip to content

Commit 7f1f781

Browse files
authored
Revert "[release-1.35][SRVKS-1301] Update knative/operator to fix webhook issues (#3560)" (#3581)
This reverts commit ac79c86.
1 parent a454bfe commit 7f1f781

File tree

10 files changed

+18
-80
lines changed

10 files changed

+18
-80
lines changed

Diff for: go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ require (
2929
k8s.io/client-go v0.31.0
3030
knative.dev/eventing v0.43.3
3131
knative.dev/eventing-kafka-broker v0.37.0
32-
knative.dev/hack v0.0.0-20250117112405-6cb0feb3ac46
32+
knative.dev/hack v0.0.0-20240814130635-06f7aff93954
3333
knative.dev/networking v0.0.0-20240716111826-bab7f2a3e556
34-
knative.dev/operator v0.42.11-0.20250319103414-9c594ced1a3a
34+
knative.dev/operator v0.42.5
3535
knative.dev/pkg v0.0.0-20240716082220-4355f0c73608
36-
knative.dev/serving v0.42.2
36+
knative.dev/serving v0.42.1
3737
sigs.k8s.io/controller-runtime v0.19.0
3838
sigs.k8s.io/yaml v1.4.0
3939
)

Diff for: go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -2563,8 +2563,8 @@ knative.dev/hack v0.0.0-20240814135050-f9643117f6a1 h1:3l9x2gly9549Mn+HFWlyf+r/m
25632563
knative.dev/hack v0.0.0-20240814135050-f9643117f6a1/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
25642564
knative.dev/networking v0.0.0-20240716111826-bab7f2a3e556 h1:9OTyJkrjiFh/burZiti3WucGv8Qtt91VJTnXfO5dC2g=
25652565
knative.dev/networking v0.0.0-20240716111826-bab7f2a3e556/go.mod h1:1PosUDkXqoHNzYxtLIwa7LFqSsIXBShHOseAb6XBeEU=
2566-
knative.dev/operator v0.42.11-0.20250319103414-9c594ced1a3a h1:myjSxDg9JHFtuCkpO4xjr7JqGMOI8zeXgDJggQVKONI=
2567-
knative.dev/operator v0.42.11-0.20250319103414-9c594ced1a3a/go.mod h1:UKR8MNUPxW+eYF42eCd6sGs8H/q8HXrUAnVDWtFiwJc=
2566+
knative.dev/operator v0.42.5 h1:5sSd60uXx2pt/vVpVsqv5+HQKM09ZGmbk4nnCphDRss=
2567+
knative.dev/operator v0.42.5/go.mod h1:fx8kRLwlk8nh1QErnU3frCsv38dmfheZoHK4j1x86ao=
25682568
knative.dev/pkg v0.0.0-20240716082220-4355f0c73608 h1:BOiRzcnRS9Z5ruxlCiS/K1/Hb5bUN0X4W3xCegdcYQE=
25692569
knative.dev/pkg v0.0.0-20240716082220-4355f0c73608/go.mod h1:M67lDZ4KbltYSon0Ox4/6qjlZNOIXW4Ldequ81yofbw=
25702570
knative.dev/reconciler-test v0.0.0-20240716134925-00d94f40c470 h1:cdAPZPUszOYpgJY2LNRzz6lFZgD++U89y56jECV/6eU=

Diff for: hack/patches/020-backstage_plugins_eventmesh_backend.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ index f0d4c777d..f622a4bce 100644
9494
+ r.handleBackstageResources,
9595
manifests.Install,
9696
common.CheckDeployments,
97-
common.InstallWebhookConfigs,
97+
common.DeleteObsoleteResources(ctx, ke, r.installed),

Diff for: vendor/knative.dev/operator/pkg/reconciler/common/deployments.go

+3-19
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,15 @@ package common
1818

1919
import (
2020
"context"
21-
"errors"
2221

2322
mf "github.com/manifestival/manifestival"
2423
appsv1 "k8s.io/api/apps/v1"
2524
corev1 "k8s.io/api/core/v1"
26-
apierrors "k8s.io/apimachinery/pkg/api/errors"
25+
"k8s.io/apimachinery/pkg/api/errors"
2726
"k8s.io/client-go/kubernetes/scheme"
28-
2927
"knative.dev/operator/pkg/apis/operator/base"
3028
)
3129

32-
type deploymentsNotReadyError struct{}
33-
34-
var _ error = deploymentsNotReadyError{}
35-
36-
// Error implements the Error() interface of error.
37-
func (err deploymentsNotReadyError) Error() string {
38-
return "deployments not ready"
39-
}
40-
41-
// IsDeploymentsNotReadyError returns true if the given error is a deploymentsNotReadyError.
42-
func IsDeploymentsNotReadyError(err error) bool {
43-
return errors.Is(err, deploymentsNotReadyError{})
44-
}
45-
4630
// CheckDeployments checks all deployments in the given manifest and updates the given
4731
// status with the status of the deployments.
4832
func CheckDeployments(ctx context.Context, manifest *mf.Manifest, instance base.KComponent) error {
@@ -52,7 +36,7 @@ func CheckDeployments(ctx context.Context, manifest *mf.Manifest, instance base.
5236
resource, err := manifest.Client.Get(&u)
5337
if err != nil {
5438
status.MarkDeploymentsNotReady([]string{"all"})
55-
if apierrors.IsNotFound(err) {
39+
if errors.IsNotFound(err) {
5640
return nil
5741
}
5842
return err
@@ -68,7 +52,7 @@ func CheckDeployments(ctx context.Context, manifest *mf.Manifest, instance base.
6852

6953
if len(nonReadyDeployments) > 0 {
7054
status.MarkDeploymentsNotReady(nonReadyDeployments)
71-
return deploymentsNotReadyError{}
55+
return nil
7256
}
7357

7458
status.MarkDeploymentsAvailable()

Diff for: vendor/knative.dev/operator/pkg/reconciler/common/install.go

+6-37
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,17 @@ import (
2222
"strings"
2323

2424
mf "github.com/manifestival/manifestival"
25-
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
26-
"k8s.io/apimachinery/pkg/runtime/schema"
25+
"knative.dev/pkg/logging"
2726

2827
"knative.dev/operator/pkg/apis/operator/base"
2928
"knative.dev/operator/pkg/apis/operator/v1beta1"
30-
"knative.dev/pkg/logging"
3129
)
3230

3331
var (
34-
role mf.Predicate = mf.Any(mf.ByKind("ClusterRole"), mf.ByKind("Role"))
35-
rolebinding mf.Predicate = mf.Any(mf.ByKind("ClusterRoleBinding"), mf.ByKind("RoleBinding"))
36-
webhook mf.Predicate = mf.Any(mf.ByKind("MutatingWebhookConfiguration"), mf.ByKind("ValidatingWebhookConfiguration"))
37-
webhookDependentResources mf.Predicate = byGV(schema.GroupKind{Group: "networking.internal.knative.dev", Kind: "Certificate"})
38-
gatewayNotMatch = "no matches for kind \"Gateway\""
32+
role mf.Predicate = mf.Any(mf.ByKind("ClusterRole"), mf.ByKind("Role"))
33+
rolebinding mf.Predicate = mf.Any(mf.ByKind("ClusterRoleBinding"), mf.ByKind("RoleBinding"))
34+
webhook mf.Predicate = mf.Any(mf.ByKind("MutatingWebhookConfiguration"), mf.ByKind("ValidatingWebhookConfiguration"))
35+
gatewayNotMatch = "no matches for kind \"Gateway\""
3936
)
4037

4138
// Install applies the manifest resources for the given version and updates the given
@@ -55,7 +52,7 @@ func Install(ctx context.Context, manifest *mf.Manifest, instance base.KComponen
5552
status.MarkInstallFailed(err.Error())
5653
return fmt.Errorf("failed to apply (cluster)rolebindings: %w", err)
5754
}
58-
if err := manifest.Filter(mf.Not(mf.Any(role, rolebinding, webhook, webhookDependentResources))).Apply(); err != nil {
55+
if err := manifest.Filter(mf.Not(mf.Any(role, rolebinding, webhook))).Apply(); err != nil {
5956
status.MarkInstallFailed(err.Error())
6057
if ks, ok := instance.(*v1beta1.KnativeServing); ok && strings.Contains(err.Error(), gatewayNotMatch) &&
6158
(ks.Spec.Ingress == nil || ks.Spec.Ingress.Istio.Enabled) {
@@ -66,32 +63,10 @@ func Install(ctx context.Context, manifest *mf.Manifest, instance base.KComponen
6663

6764
return fmt.Errorf("failed to apply non rbac manifest: %w", err)
6865
}
69-
return nil
70-
}
71-
72-
// InstallWebhookConfigs applies the Webhook manifest resources and updates the given status accordingly.
73-
func InstallWebhookConfigs(ctx context.Context, manifest *mf.Manifest, instance base.KComponent) error {
74-
status := instance.GetStatus()
7566
if err := manifest.Filter(webhook).Apply(); err != nil {
7667
status.MarkInstallFailed(err.Error())
7768
return fmt.Errorf("failed to apply webhooks: %w", err)
7869
}
79-
return nil
80-
}
81-
82-
// InstallWebhookDependentResources applies the Webhook dependent resources updates the given status accordingly.
83-
func InstallWebhookDependentResources(ctx context.Context, manifest *mf.Manifest, instance base.KComponent) error {
84-
status := instance.GetStatus()
85-
if err := manifest.Filter(webhookDependentResources).Apply(); err != nil {
86-
status.MarkInstallFailed(err.Error())
87-
return fmt.Errorf("failed to apply webhooks: %w", err)
88-
}
89-
return nil
90-
}
91-
92-
// MarkStatusSuccess updates the component status to success.
93-
func MarkStatusSuccess(ctx context.Context, manifest *mf.Manifest, instance base.KComponent) error {
94-
status := instance.GetStatus()
9570
status.MarkInstallSucceeded()
9671
status.SetVersion(TargetVersion(instance))
9772
return nil
@@ -108,9 +83,3 @@ func Uninstall(manifest *mf.Manifest) error {
10883
}
10984
return nil
11085
}
111-
112-
func byGV(gk schema.GroupKind) mf.Predicate {
113-
return func(u *unstructured.Unstructured) bool {
114-
return u.GroupVersionKind().GroupKind() == gk
115-
}
116-
}

Diff for: vendor/knative.dev/operator/pkg/reconciler/common/stages.go

-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ type Stages []Stage
3838
func (stages Stages) Execute(ctx context.Context, manifest *mf.Manifest, instance base.KComponent) error {
3939
for _, stage := range stages {
4040
if err := stage(ctx, manifest, instance); err != nil {
41-
if IsDeploymentsNotReadyError(err) {
42-
break
43-
}
4441
return err
4542
}
4643
}

Diff for: vendor/knative.dev/operator/pkg/reconciler/knativeeventing/knativeeventing.go

-3
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ func (r *Reconciler) ReconcileKind(ctx context.Context, ke *v1beta1.KnativeEvent
143143
r.handleBackstageResources,
144144
manifests.Install,
145145
common.CheckDeployments,
146-
common.InstallWebhookConfigs,
147-
manifests.SetManifestPaths,
148-
common.MarkStatusSuccess,
149146
common.DeleteObsoleteResources(ctx, ke, r.installed),
150147
}
151148
manifest := r.manifest.Append()

Diff for: vendor/knative.dev/operator/pkg/reconciler/knativeserving/knativeserving.go

-4
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,6 @@ func (r *Reconciler) ReconcileKind(ctx context.Context, ks *v1beta1.KnativeServi
145145
r.transform,
146146
manifests.Install,
147147
common.CheckDeployments,
148-
common.InstallWebhookConfigs,
149-
common.InstallWebhookDependentResources,
150-
manifests.SetManifestPaths,
151-
common.MarkStatusSuccess,
152148
common.DeleteObsoleteResources(ctx, ks, r.installed),
153149
}
154150
manifest := r.manifest.Append()

Diff for: vendor/knative.dev/operator/pkg/reconciler/manifests/install.go

-5
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ func Install(ctx context.Context, manifest *mf.Manifest, instance base.KComponen
3434
if err != nil {
3535
return err
3636
}
37-
return nil
38-
}
39-
40-
// SetManifestPaths set the manifest paths in the status of the component
41-
func SetManifestPaths(ctx context.Context, manifest *mf.Manifest, instance base.KComponent) error {
4237
status := instance.GetStatus()
4338
path := common.TargetManifestPathArray(instance)
4439
version := common.TargetVersion(instance)

Diff for: vendor/modules.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@ knative.dev/eventing-kafka-broker/third_party/pkg/client/clientset/versioned
14921492
knative.dev/eventing-kafka-broker/third_party/pkg/client/clientset/versioned/scheme
14931493
knative.dev/eventing-kafka-broker/third_party/pkg/client/clientset/versioned/typed/keda/v1alpha1
14941494
knative.dev/eventing-kafka-broker/third_party/pkg/client/injection/client
1495-
# knative.dev/hack v0.0.0-20250117112405-6cb0feb3ac46 => knative.dev/hack v0.0.0-20240814135050-f9643117f6a1
1495+
# knative.dev/hack v0.0.0-20240814130635-06f7aff93954 => knative.dev/hack v0.0.0-20240814135050-f9643117f6a1
14961496
## explicit; go 1.18
14971497
knative.dev/hack
14981498
# knative.dev/networking v0.0.0-20240716111826-bab7f2a3e556 => knative.dev/networking v0.0.0-20240716111826-bab7f2a3e556
@@ -1524,7 +1524,7 @@ knative.dev/networking/pkg/http/proxy
15241524
knative.dev/networking/pkg/http/stats
15251525
knative.dev/networking/pkg/ingress
15261526
knative.dev/networking/pkg/k8s
1527-
# knative.dev/operator v0.42.11-0.20250319103414-9c594ced1a3a
1527+
# knative.dev/operator v0.42.5
15281528
## explicit; go 1.22
15291529
knative.dev/operator/pkg/apis/operator
15301530
knative.dev/operator/pkg/apis/operator/base
@@ -1667,7 +1667,7 @@ knative.dev/reconciler-test/pkg/resources/serviceaccount
16671667
knative.dev/reconciler-test/pkg/state
16681668
knative.dev/reconciler-test/resources/certificate
16691669
knative.dev/reconciler-test/resources/svc
1670-
# knative.dev/serving v0.42.2 => github.com/openshift-knative/serving v0.10.1-0.20240906121033-618992fcbd27
1670+
# knative.dev/serving v0.42.1 => github.com/openshift-knative/serving v0.10.1-0.20240906121033-618992fcbd27
16711671
## explicit; go 1.22
16721672
knative.dev/serving/pkg/apis/autoscaling
16731673
knative.dev/serving/pkg/apis/autoscaling/v1alpha1

0 commit comments

Comments
 (0)