Skip to content

Commit eaed3fc

Browse files
authored
GCP Pub/Sub: remove the deprecated subscriptionSize setting (#8266)
* GCP Pub/Sub: remove the deprecated subscriptionSize setting The setting has been rejected at parse time since v2.20 and is scheduled for code cleanup in v2.22 (#7720). Drop the field and regenerate the scalers schema. A trigger that still sets subscriptionSize is now treated like any other unknown key, so the unit case that expected an error now expects it to be ignored. The SubscriptionSize default for mode stays. Signed-off-by: Sai Ram <4089996+vjsairam@users.noreply.github.com> * GCP Pub/Sub: drop the subscriptionSize test case Removing the row shifts the test table, so the two FromEnv resource-name cases now point at indices 23 and 24. Signed-off-by: Sai Ram <4089996+vjsairam@users.noreply.github.com> --------- Signed-off-by: Sai Ram <4089996+vjsairam@users.noreply.github.com> Co-authored-by: Sai Ram <4089996+vjsairam@users.noreply.github.com>
1 parent 8a0692a commit eaed3fc

4 files changed

Lines changed: 2 additions & 17 deletions

File tree

‎pkg/scalers/gcp_pubsub_scaler.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ type pubsubScaler struct {
3737
}
3838

3939
type pubsubMetadata struct {
40-
SubscriptionSize int `keda:"name=subscriptionSize, order=triggerMetadata, optional, deprecated=The 'subscriptionSize' setting is DEPRECATED and is removed in v2.20 - Use 'mode' and 'value' instead"`
4140
Mode string `keda:"name=mode, order=triggerMetadata, default=SubscriptionSize"`
4241
Value float64 `keda:"name=value, order=triggerMetadata, default=10, deprecatedAnnounce=This scaler is deprecated. More info -> 'https://keda.sh/blog/2025-09-15-gcp-deprecations'"`
4342
ActivationValue float64 `keda:"name=activationValue, order=triggerMetadata, default=0"`

‎pkg/scalers/gcp_pubsub_scaler_test.go‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ var testPubSubMetadata = []parsePubSubMetadataTestData{
7777
{"both subscriptionName and topicName present", nil, map[string]string{"subscriptionName": "mysubscription", "topicName": "mytopic", "value": "7", "credentialsFromEnv": "SAMPLE_CREDS"}, true},
7878
// both subscriptionName and topicName missing
7979
{"both subscriptionName and topicName missing", nil, map[string]string{"value": "7", "credentialsFromEnv": "SAMPLE_CREDS"}, true},
80-
// deprecated subscriptionSize errors
81-
{"deprecated subscriptionSize errors", nil, map[string]string{"subscriptionName": "mysubscription", "subscriptionSize": "7", "credentialsFromEnv": "SAMPLE_CREDS"}, true},
8280
// both subscriptionName and subscriptionNameFromEnv present
8381
{"both subscriptionName and subscriptionNameFromEnv present", nil, map[string]string{"subscriptionName": "mysubscription", "subscriptionNameFromEnv": "MY_ENV_SUBSCRIPTION", "value": "7", "credentialsFromEnv": "SAMPLE_CREDS"}, false},
8482
// both topicName and topicNameFromEnv present
@@ -101,8 +99,8 @@ var gcpResourceNameTests = []gcpPubSubSubscription{
10199
{&testPubSubMetadata[12], 1, "projects/myproject/mysubscription", ""},
102100
{&testPubSubMetadata[17], 1, "mytopic", "myproject"},
103101
{&testPubSubMetadata[18], 1, "projects/myproject/mytopic", ""},
104-
{&testPubSubMetadata[24], 1, "myEnvSubscription", ""},
105-
{&testPubSubMetadata[25], 1, "myEnvTopic", ""},
102+
{&testPubSubMetadata[23], 1, "myEnvSubscription", ""},
103+
{&testPubSubMetadata[24], 1, "myEnvTopic", ""},
106104
}
107105

108106
var gcpSubscriptionDefaults = []gcpPubSubSubscription{

‎schema/generated/scalers-schema.json‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5549,13 +5549,6 @@
55495549
{
55505550
"type": "gcp-pubsub",
55515551
"parameters": [
5552-
{
5553-
"name": "subscriptionSize",
5554-
"type": "string",
5555-
"optional": true,
5556-
"deprecated": "The 'subscriptionSize' setting is DEPRECATED and is removed in v2.20 - Use 'mode' and 'value' instead",
5557-
"metadataVariableReadable": true
5558-
},
55595552
{
55605553
"name": "mode",
55615554
"type": "string",

‎schema/generated/scalers-schema.yaml‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3707,11 +3707,6 @@ scalers:
37073707
metadataVariableReadable: true
37083708
- type: gcp-pubsub
37093709
parameters:
3710-
- name: subscriptionSize
3711-
type: string
3712-
optional: true
3713-
deprecated: The 'subscriptionSize' setting is DEPRECATED and is removed in v2.20 - Use 'mode' and 'value' instead
3714-
metadataVariableReadable: true
37153710
- name: mode
37163711
type: string
37173712
default: SubscriptionSize

0 commit comments

Comments
 (0)