Skip to content

Commit

Permalink
Bump to latest upstream operator 1.15.5 (#2886)
Browse files Browse the repository at this point in the history
* Bump to go w/ 1.15.5 (from upstream)

Signed-off-by: Matthias Wessendorf <[email protected]>

* 💫 Updated by ./hack/update-deps via make generated-files

Signed-off-by: Matthias Wessendorf <[email protected]>

---------

Signed-off-by: Matthias Wessendorf <[email protected]>
  • Loading branch information
matzew authored Sep 24, 2024
1 parent 594adac commit c8d8f95
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
knative.dev/eventing-kafka-broker v0.37.0
knative.dev/hack v0.0.0-20240814130635-06f7aff93954
knative.dev/networking v0.0.0-20240716111826-bab7f2a3e556
knative.dev/operator v0.42.4
knative.dev/operator v0.42.5
knative.dev/pkg v0.0.0-20240716082220-4355f0c73608
knative.dev/serving v0.42.1
sigs.k8s.io/controller-runtime v0.17.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1687,8 +1687,8 @@ knative.dev/hack v0.0.0-20240814135050-f9643117f6a1 h1:3l9x2gly9549Mn+HFWlyf+r/m
knative.dev/hack v0.0.0-20240814135050-f9643117f6a1/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/networking v0.0.0-20240716111826-bab7f2a3e556 h1:9OTyJkrjiFh/burZiti3WucGv8Qtt91VJTnXfO5dC2g=
knative.dev/networking v0.0.0-20240716111826-bab7f2a3e556/go.mod h1:1PosUDkXqoHNzYxtLIwa7LFqSsIXBShHOseAb6XBeEU=
knative.dev/operator v0.42.4 h1:WjhOvOrIuM9j0vzoWyKjYf8cij5X17d1WHQmAfbR02U=
knative.dev/operator v0.42.4/go.mod h1:fx8kRLwlk8nh1QErnU3frCsv38dmfheZoHK4j1x86ao=
knative.dev/operator v0.42.5 h1:5sSd60uXx2pt/vVpVsqv5+HQKM09ZGmbk4nnCphDRss=
knative.dev/operator v0.42.5/go.mod h1:fx8kRLwlk8nh1QErnU3frCsv38dmfheZoHK4j1x86ao=
knative.dev/pkg v0.0.0-20240716082220-4355f0c73608 h1:BOiRzcnRS9Z5ruxlCiS/K1/Hb5bUN0X4W3xCegdcYQE=
knative.dev/pkg v0.0.0-20240716082220-4355f0c73608/go.mod h1:M67lDZ4KbltYSon0Ox4/6qjlZNOIXW4Ldequ81yofbw=
knative.dev/reconciler-test v0.0.0-20240716134925-00d94f40c470 h1:cdAPZPUszOYpgJY2LNRzz6lFZgD++U89y56jECV/6eU=
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/operator/pkg/reconciler/common/ha.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func HighAvailabilityTransform(obj base.KComponent) mf.Transformer {
replicas := int64(*ha.Replicas)

// Transform deployments that support HA.
if u.GetKind() == "Deployment" && !haUnSupported(u.GetName()) && !hasHorizontalPodAutoscaler(u.GetName()) {
if u.GetKind() == "Deployment" && !haUnSupported(u.GetName()) && !hasHorizontalPodOrCustomAutoscaler(u.GetName()) {
if err := unstructured.SetNestedField(u.Object, replicas, "spec", "replicas"); err != nil {
return err
}
Expand Down
7 changes: 5 additions & 2 deletions vendor/knative.dev/operator/pkg/reconciler/common/hpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
)

// When a Podspecable has HPA, the replicas should be controlled by HPAs minReplicas instead of operator.
// When a Podspecable has HPA or a custom autoscaling, the replicas should be controlled by it instead of operator.
// Hence, skip changing the spec.replicas for these Podspecables.
func hasHorizontalPodAutoscaler(name string) bool {
func hasHorizontalPodOrCustomAutoscaler(name string) bool {
return sets.NewString(
"webhook",
"activator",
"3scale-kourier-gateway",
"eventing-webhook",
"mt-broker-ingress",
"mt-broker-filter",
"kafka-broker-dispatcher",
"kafka-source-dispatcher",
"kafka-channel-dispatcher",
).Has(name)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func OverridesTransform(overrides []base.WorkloadOverride, log *zap.SugaredLogge
ps = &deployment.Spec.Template

// Do not set replicas, if this resource is controlled by a HPA
if override.Replicas != nil && !hasHorizontalPodAutoscaler(override.Name) {
if override.Replicas != nil && !hasHorizontalPodOrCustomAutoscaler(override.Name) {
deployment.Spec.Replicas = override.Replicas
}
}
Expand All @@ -62,7 +62,7 @@ func OverridesTransform(overrides []base.WorkloadOverride, log *zap.SugaredLogge
ps = &ss.Spec.Template

// Do not set replicas, if this resource is controlled by a HPA
if override.Replicas != nil && !hasHorizontalPodAutoscaler(override.Name) {
if override.Replicas != nil && !hasHorizontalPodOrCustomAutoscaler(override.Name) {
ss.Spec.Replicas = override.Replicas
}
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ knative.dev/networking/pkg/http/proxy
knative.dev/networking/pkg/http/stats
knative.dev/networking/pkg/ingress
knative.dev/networking/pkg/k8s
# knative.dev/operator v0.42.4
# knative.dev/operator v0.42.5
## explicit; go 1.22
knative.dev/operator/pkg/apis/operator
knative.dev/operator/pkg/apis/operator/base
Expand Down

0 comments on commit c8d8f95

Please sign in to comment.