Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ New deprecation(s):

### Breaking Changes

- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX))
- **Huawei Cloudeye Scaler**: The `minMetricValue` setting is DEPRECATED and is removed - Use `activationTargetMetricValue` instead ([#7436](https://github.com/kedacore/keda/issues/7436))

### Other

Expand Down
9 changes: 1 addition & 8 deletions pkg/scalers/huawei_cloudeye_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type huaweiCloudeyeMetadata struct {

TargetMetricValue float64 `keda:"name=targetMetricValue, order=triggerMetadata"`
ActivationTargetMetricValue float64 `keda:"name=activationTargetMetricValue, order=triggerMetadata, default=0"`
MinMetricValue float64 `keda:"name=minMetricValue, order=triggerMetadata, optional, deprecatedAnnounce=The 'minMetricValue' setting is DEPRECATED and will be removed in v2.20 - Use 'activationTargetMetricValue' instead"`
MinMetricValue float64 `keda:"name=minMetricValue, order=triggerMetadata, optional, deprecated=The 'minMetricValue' setting is DEPRECATED and is removed in v2.20 - Use 'activationTargetMetricValue' instead"`

MetricCollectionTime int64 `keda:"name=metricCollectionTime, order=triggerMetadata, default=300"`
MetricFilter string `keda:"name=metricFilter, order=triggerMetadata, enum=average;max;min;sum, default=average"`
Expand All @@ -53,13 +53,6 @@ type huaweiAuthorizationMetadata struct {
SecretKey string `keda:"name=SecretKey, order=authParams"`
}

func (h *huaweiCloudeyeMetadata) Validate() error {
if h.MinMetricValue != 0 && h.ActivationTargetMetricValue == 0 {
h.ActivationTargetMetricValue = h.MinMetricValue
}
return nil
}

// NewHuaweiCloudeyeScaler creates a new huaweiCloudeyeScaler
func NewHuaweiCloudeyeScaler(config *scalersconfig.ScalerConfig) (Scaler, error) {
metricType, err := GetMetricTargetType(config)
Expand Down
92 changes: 46 additions & 46 deletions pkg/scalers/huawei_cloudeye_scaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,81 +56,81 @@ var testHuaweiAuthenticationWithoutCloud = map[string]string{

var testHuaweiCloudeyeMetadata = []parseHuaweiCloudeyeMetadataTestData{
{map[string]string{
"namespace": "SYS.ELB",
"dimensionName": "lbaas_instance_id",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"metricName": "mb_l7_qps",
"targetMetricValue": "100",
"minMetricValue": "1"},
"namespace": "SYS.ELB",
"dimensionName": "lbaas_instance_id",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"metricName": "mb_l7_qps",
"targetMetricValue": "100",
"activationTargetMetricValue": "1"},
testHuaweiAuthenticationWithCloud,
false,
"auth parameter with Cloud"},
{map[string]string{
"namespace": "SYS.ELB",
"dimensionName": "lbaas_instance_id",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"metricName": "mb_l7_qps",
"targetMetricValue": "100",
"minMetricValue": "1"},
"namespace": "SYS.ELB",
"dimensionName": "lbaas_instance_id",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"metricName": "mb_l7_qps",
"targetMetricValue": "100",
"activationTargetMetricValue": "1"},
testHuaweiAuthenticationWithoutCloud,
false,
"auth parameter without Cloud"},
{map[string]string{
"namespace": "SYS.ELB",
"dimensionName": "lbaas_instance_id",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"metricName": "mb_l7_qps",
"targetMetricValue": "100",
"minMetricValue": "1",
"metricCollectionTime": "300",
"metricFilter": "average",
"metricPeriod": "300"},
"namespace": "SYS.ELB",
"dimensionName": "lbaas_instance_id",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"metricName": "mb_l7_qps",
"targetMetricValue": "100",
"activationTargetMetricValue": "1",
"metricCollectionTime": "300",
"metricFilter": "average",
"metricPeriod": "300"},
testHuaweiAuthenticationWithCloud,
false,
"all parameter"},
{map[string]string{}, testHuaweiAuthenticationWithCloud, true, "Empty structures"},
{map[string]string{
"dimensionName": "lbaas_instance_id",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"metricName": "mb_l7_qps",
"targetMetricValue": "100",
"minMetricValue": "1"},
"dimensionName": "lbaas_instance_id",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"metricName": "mb_l7_qps",
"targetMetricValue": "100",
"activationTargetMetricValue": "1"},
testHuaweiAuthenticationWithCloud,
true,
"metadata miss namespace"},
{map[string]string{
"namespace": "SYS.ELB",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"metricName": "mb_l7_qps",
"targetMetricValue": "100",
"minMetricValue": "1"},
"namespace": "SYS.ELB",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"metricName": "mb_l7_qps",
"targetMetricValue": "100",
"activationTargetMetricValue": "1"},
testHuaweiAuthenticationWithCloud,
true,
"metadata miss dimensionName"},
{map[string]string{
"namespace": "SYS.ELB",
"dimensionName": "lbaas_instance_id",
"metricName": "mb_l7_qps",
"targetMetricValue": "100",
"minMetricValue": "1"},
"namespace": "SYS.ELB",
"dimensionName": "lbaas_instance_id",
"metricName": "mb_l7_qps",
"targetMetricValue": "100",
"activationTargetMetricValue": "1"},
testHuaweiAuthenticationWithCloud,
true,
"metadata miss dimensionValue"},
{map[string]string{
"namespace": "SYS.ELB",
"dimensionName": "lbaas_instance_id",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"targetMetricValue": "100",
"minMetricValue": "1"},
"namespace": "SYS.ELB",
"dimensionName": "lbaas_instance_id",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"targetMetricValue": "100",
"activationTargetMetricValue": "1"},
testHuaweiAuthenticationWithCloud,
true,
"metadata miss metricName"},
{map[string]string{
"namespace": "SYS.ELB",
"dimensionName": "lbaas_instance_id",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"metricName": "mb_l7_qps",
"minMetricValue": "1"},
"namespace": "SYS.ELB",
"dimensionName": "lbaas_instance_id",
"dimensionValue": "5e052238-0346-xxb0-86ea-92d9f33e29d2",
"metricName": "mb_l7_qps",
"activationTargetMetricValue": "1"},
testHuaweiAuthenticationWithCloud,
true,
"metadata miss targetMetricValue"},
Expand Down
2 changes: 1 addition & 1 deletion schema/generated/scalers-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,7 @@
"name": "minMetricValue",
"type": "string",
"optional": true,
"deprecatedAnnounce": "The 'minMetricValue' setting is DEPRECATED and will be removed in v2.20 - Use 'activationTargetMetricValue' instead",
"deprecated": "The 'minMetricValue' setting is DEPRECATED and is removed in v2.20 - Use 'activationTargetMetricValue' instead",
"metadataVariableReadable": true
},
{
Expand Down
2 changes: 1 addition & 1 deletion schema/generated/scalers-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ scalers:
- name: minMetricValue
type: string
optional: true
deprecatedAnnounce: The 'minMetricValue' setting is DEPRECATED and will be removed in v2.20 - Use 'activationTargetMetricValue' instead
deprecated: The 'minMetricValue' setting is DEPRECATED and is removed in v2.20 - Use 'activationTargetMetricValue' instead
metadataVariableReadable: true
- name: metricCollectionTime
type: string
Expand Down
Loading