Skip to content

Commit

Permalink
Multiple minor corrections (#6404)
Browse files Browse the repository at this point in the history
* Correct namesapce

Signed-off-by: rickbrouwer <[email protected]>

* Remove period

Signed-off-by: rickbrouwer <[email protected]>

* At space

Signed-off-by: rickbrouwer <[email protected]>

* Remove forgotten test

Signed-off-by: rickbrouwer <[email protected]>

* Remove unnecessary optional when default

Signed-off-by: Rick Brouwer <[email protected]>

* Fix scorecard badge

Signed-off-by: rickbrouwer <[email protected]>

* Fix

Signed-off-by: Rick Brouwer <[email protected]>

* Delete space

Signed-off-by: Rick Brouwer <[email protected]>

---------

Signed-off-by: rickbrouwer <[email protected]>
Signed-off-by: Rick Brouwer <[email protected]>
  • Loading branch information
rickbrouwer authored Jan 6, 2025
1 parent 720af45 commit 3e87999
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 138 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<a href="https://github.com/kedacore/keda/actions?query=workflow%3Amain-build"><img src="https://github.com/kedacore/keda/actions/workflows/main-build.yml/badge.svg" alt="main build"></a>
<a href="https://github.com/kedacore/keda/actions?query=workflow%3Anightly-e2e-test"><img src="https://github.com/kedacore/keda/actions/workflows/nightly-e2e.yml/badge.svg" alt="nightly e2e"></a>
<a href="https://bestpractices.coreinfrastructure.org/projects/3791"><img src="https://bestpractices.coreinfrastructure.org/projects/3791/badge"></a>
<a href="https://scorecard.dev/viewer/?uri=github.com/kedacore/keda"><img src="https://img.shields.io/ossf-scorecard/github.com/kedacore/keda?label=openssf%20scorecard&style=flat"></a>
<a href="https://api.scorecard.dev/projects/github.com/kedacore/keda/badge"><img src="https://img.shields.io/ossf-scorecard/github.com/kedacore/keda?label=openssf%20scorecard&style=flat"></a>
<a href="https://artifacthub.io/packages/helm/kedacore/keda"><img src="https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kedacore"></a>
<a href="https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fkedacore%2Fkeda?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fkedacore%2Fkeda.svg?type=shield"/></a>
<a href="https://twitter.com/kedaorg"><img src="https://img.shields.io/twitter/follow/kedaorg?style=social" alt="Twitter"></a></p>
Expand Down
2 changes: 1 addition & 1 deletion pkg/common/message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package message

const (
ScalerIsBuiltMsg = "Scaler %s is built."
ScalerIsBuiltMsg = "Scaler %s is built"

ScalerStartMsg = "Started scalers watch"

Expand Down
6 changes: 3 additions & 3 deletions pkg/eventemitter/eventemitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type EventEmitter struct {
type EventHandler interface {
DeleteCloudEventSource(cloudEventSource eventingv1alpha1.CloudEventSourceInterface) error
HandleCloudEventSource(ctx context.Context, cloudEventSource eventingv1alpha1.CloudEventSourceInterface) error
Emit(object runtime.Object, namesapce string, eventType string, cloudeventType eventingv1alpha1.CloudEventType, reason string, message string)
Emit(object runtime.Object, namespace string, eventType string, cloudeventType eventingv1alpha1.CloudEventType, reason string, message string)
}

// EventDataHandler defines the behavior for different event handlers
Expand Down Expand Up @@ -328,7 +328,7 @@ func (e *EventEmitter) checkEventHandlers(ctx context.Context, cloudEventSourceI
}

// Emit is emitting event to both local kubernetes and custom CloudEventSource handler. After emit event to local kubernetes, event will inqueue and waitng for handler's consuming.
func (e *EventEmitter) Emit(object runtime.Object, namesapce string, eventType string, cloudeventType eventingv1alpha1.CloudEventType, reason, message string) {
func (e *EventEmitter) Emit(object runtime.Object, namespace string, eventType string, cloudeventType eventingv1alpha1.CloudEventType, reason, message string) {
e.recorder.Event(object, eventType, reason, message)

e.eventHandlersCacheLock.RLock()
Expand All @@ -340,7 +340,7 @@ func (e *EventEmitter) Emit(object runtime.Object, namesapce string, eventType s
objectName, _ := meta.NewAccessor().Name(object)
objectType, _ := meta.NewAccessor().Kind(object)
eventData := eventdata.EventData{
Namespace: namesapce,
Namespace: namespace,
CloudEventType: cloudeventType,
ObjectName: strings.ToLower(objectName),
ObjectType: strings.ToLower(objectType),
Expand Down
4 changes: 2 additions & 2 deletions pkg/scalers/activemq_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ type activeMQMetadata struct {
CorsHeader string `keda:"name=corsHeader, order=triggerMetadata, optional"`

RestAPITemplate string `keda:"name=restAPITemplate, order=triggerMetadata, optional"`
TargetQueueSize int64 `keda:"name=targetQueueSize, order=triggerMetadata, optional, default=10"`
ActivationTargetQueueSize int64 `keda:"name=activationTargetQueueSize, order=triggerMetadata, optional, default=0"`
TargetQueueSize int64 `keda:"name=targetQueueSize, order=triggerMetadata, default=10"`
ActivationTargetQueueSize int64 `keda:"name=activationTargetQueueSize, order=triggerMetadata, default=0"`
}

func (a *activeMQMetadata) Validate() error {
Expand Down
20 changes: 10 additions & 10 deletions pkg/scalers/artemis_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ type artemisScaler struct {
//revive:disable:var-naming breaking change on restApiTemplate, wouldn't bring any benefit to users
type artemisMetadata struct {
TriggerIndex int
ManagementEndpoint string `keda:"name=managementEndpoint, order=triggerMetadata, optional"`
QueueName string `keda:"name=queueName, order=triggerMetadata, optional"`
BrokerName string `keda:"name=brokerName, order=triggerMetadata, optional"`
BrokerAddress string `keda:"name=brokerAddress, order=triggerMetadata, optional"`
Username string `keda:"name=username, order=authParams;triggerMetadata;resolvedEnv"`
Password string `keda:"name=password, order=authParams;triggerMetadata;resolvedEnv"`
RestAPITemplate string `keda:"name=restApiTemplate, order=triggerMetadata, optional"`
QueueLength int64 `keda:"name=queueLength, order=triggerMetadata, optional, default=10"`
ActivationQueueLength int64 `keda:"name=activationQueueLength, order=triggerMetadata, optional, default=10"`
CorsHeader string `keda:"name=corsHeader, order=triggerMetadata, optional"`
ManagementEndpoint string `keda:"name=managementEndpoint, order=triggerMetadata, optional"`
QueueName string `keda:"name=queueName, order=triggerMetadata, optional"`
BrokerName string `keda:"name=brokerName, order=triggerMetadata, optional"`
BrokerAddress string `keda:"name=brokerAddress, order=triggerMetadata, optional"`
Username string `keda:"name=username, order=authParams;triggerMetadata;resolvedEnv"`
Password string `keda:"name=password, order=authParams;triggerMetadata;resolvedEnv"`
RestAPITemplate string `keda:"name=restApiTemplate, order=triggerMetadata, optional"`
QueueLength int64 `keda:"name=queueLength, order=triggerMetadata, default=10"`
ActivationQueueLength int64 `keda:"name=activationQueueLength, order=triggerMetadata, default=10"`
CorsHeader string `keda:"name=corsHeader, order=triggerMetadata, optional"`
}

//revive:enable:var-naming
Expand Down
26 changes: 13 additions & 13 deletions pkg/scalers/aws_cloudwatch_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ type awsCloudwatchMetadata struct {
awsAuthorization awsutils.AuthorizationMetadata

triggerIndex int
Namespace string `keda:"name=namespace, order=triggerMetadata, optional"`
MetricsName string `keda:"name=metricName, order=triggerMetadata, optional"`
DimensionName []string `keda:"name=dimensionName, order=triggerMetadata, optional, separator=;"`
Namespace string `keda:"name=namespace, order=triggerMetadata, optional"`
MetricsName string `keda:"name=metricName, order=triggerMetadata, optional"`
DimensionName []string `keda:"name=dimensionName, order=triggerMetadata, optional, separator=;"`
DimensionValue []string `keda:"name=dimensionValue, order=triggerMetadata, optional, separator=;"`
Expression string `keda:"name=expression, order=triggerMetadata, optional"`
Expression string `keda:"name=expression, order=triggerMetadata, optional"`

TargetMetricValue float64 `keda:"name=targetMetricValue, order=triggerMetadata"`
TargetMetricValue float64 `keda:"name=targetMetricValue, order=triggerMetadata"`
ActivationTargetMetricValue float64 `keda:"name=activationTargetMetricValue, order=triggerMetadata, optional"`
MinMetricValue float64 `keda:"name=minMetricValue, order=triggerMetadata"`
IgnoreNullValues bool `keda:"name=ignoreNullValues, order=triggerMetadata, optional, default=true"`
MinMetricValue float64 `keda:"name=minMetricValue, order=triggerMetadata"`
IgnoreNullValues bool `keda:"name=ignoreNullValues, order=triggerMetadata, default=true"`

MetricCollectionTime int64 `keda:"name=metricCollectionTime, order=triggerMetadata, optional, default=300"`
MetricStat string `keda:"name=metricStat, order=triggerMetadata, optional, default=Average"`
MetricUnit string `keda:"name=metricUnit, order=triggerMetadata, optional"` // Need to check the metric unit
MetricStatPeriod int64 `keda:"name=metricStatPeriod, order=triggerMetadata, optional, default=300"`
MetricEndTimeOffset int64 `keda:"name=metricEndTimeOffset, order=triggerMetadata, optional, default=0"`
MetricCollectionTime int64 `keda:"name=metricCollectionTime, order=triggerMetadata, default=300"`
MetricStat string `keda:"name=metricStat, order=triggerMetadata, default=Average"`
MetricUnit string `keda:"name=metricUnit, order=triggerMetadata, optional"` // Need to check the metric unit
MetricStatPeriod int64 `keda:"name=metricStatPeriod, order=triggerMetadata, default=300"`
MetricEndTimeOffset int64 `keda:"name=metricEndTimeOffset, order=triggerMetadata, default=0"`

AwsRegion string `keda:"name=awsRegion, order=triggerMetadata;authParams"`
AwsRegion string `keda:"name=awsRegion, order=triggerMetadata;authParams"`
AwsEndpoint string `keda:"name=awsEndpoint, order=triggerMetadata, optional"`
}

Expand Down
10 changes: 5 additions & 5 deletions pkg/scalers/beanstalkd_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ type BeanstalkdScaler struct {
}

type BeanstalkdMetadata struct {
Server string `keda:"name=server, order=triggerMetadata"`
Tube string `keda:"name=tube, order=triggerMetadata"`
Value float64 `keda:"name=value, order=triggerMetadata"`
Server string `keda:"name=server, order=triggerMetadata"`
Tube string `keda:"name=tube, order=triggerMetadata"`
Value float64 `keda:"name=value, order=triggerMetadata"`
ActivationValue float64 `keda:"name=activationValue, order=triggerMetadata, optional"`
IncludeDelayed bool `keda:"name=includeDelayed, order=triggerMetadata, optional"`
Timeout uint `keda:"name=timeout, order=triggerMetadata, optional, default=30"`
IncludeDelayed bool `keda:"name=includeDelayed, order=triggerMetadata, optional"`
Timeout uint `keda:"name=timeout, order=triggerMetadata, default=30"`
TriggerIndex int
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/scalers/cassandra_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type cassandraScaler struct {
type cassandraMetadata struct {
Username string `keda:"name=username, order=triggerMetadata"`
Password string `keda:"name=password, order=authParams"`
TLS string `keda:"name=tls, order=authParams, enum=enable;disable, default=disable, optional"`
TLS string `keda:"name=tls, order=authParams, enum=enable;disable, default=disable"`
Cert string `keda:"name=cert, order=authParams, optional"`
Key string `keda:"name=key, order=authParams, optional"`
CA string `keda:"name=ca, order=authParams, optional"`
Expand Down
18 changes: 9 additions & 9 deletions pkg/scalers/couchdb_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ type couchDBScaler struct {
}

type couchDBMetadata struct {
ConnectionString string `keda:"name=connectionString,order=authParams;triggerMetadata;resolvedEnv,optional"`
Host string `keda:"name=host,order=authParams;triggerMetadata,optional"`
Port string `keda:"name=port,order=authParams;triggerMetadata,optional"`
Username string `keda:"name=username,order=authParams;triggerMetadata,optional"`
Password string `keda:"name=password,order=authParams;triggerMetadata;resolvedEnv,optional"`
DBName string `keda:"name=dbName,order=authParams;triggerMetadata,optional"`
Query string `keda:"name=query,order=triggerMetadata,optional"`
QueryValue int64 `keda:"name=queryValue,order=triggerMetadata,optional"`
ActivationQueryValue int64 `keda:"name=activationQueryValue,order=triggerMetadata,default=0,optional"`
ConnectionString string `keda:"name=connectionString, order=authParams;triggerMetadata;resolvedEnv,optional"`
Host string `keda:"name=host, order=authParams;triggerMetadata,optional"`
Port string `keda:"name=port, order=authParams;triggerMetadata,optional"`
Username string `keda:"name=username, order=authParams;triggerMetadata,optional"`
Password string `keda:"name=password, order=authParams;triggerMetadata;resolvedEnv,optional"`
DBName string `keda:"name=dbName, order=authParams;triggerMetadata,optional"`
Query string `keda:"name=query, order=triggerMetadata,optional"`
QueryValue int64 `keda:"name=queryValue, order=triggerMetadata,optional"`
ActivationQueryValue int64 `keda:"name=activationQueryValue, order=triggerMetadata,default=0"`
TriggerIndex int
}

Expand Down
18 changes: 9 additions & 9 deletions pkg/scalers/etcd_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ type etcdScaler struct {
type etcdMetadata struct {
triggerIndex int

Endpoints []string `keda:"name=endpoints, order=triggerMetadata"`
WatchKey string `keda:"name=watchKey, order=triggerMetadata"`
Value float64 `keda:"name=value, order=triggerMetadata"`
ActivationValue float64 `keda:"name=activationValue, order=triggerMetadata, optional, default=0"`
WatchProgressNotifyInterval int `keda:"name=watchProgressNotifyInterval, order=triggerMetadata, optional, default=600"`
Endpoints []string `keda:"name=endpoints, order=triggerMetadata"`
WatchKey string `keda:"name=watchKey, order=triggerMetadata"`
Value float64 `keda:"name=value, order=triggerMetadata"`
ActivationValue float64 `keda:"name=activationValue, order=triggerMetadata, default=0"`
WatchProgressNotifyInterval int `keda:"name=watchProgressNotifyInterval, order=triggerMetadata, default=600"`

Username string `keda:"name=username,order=authParams;resolvedEnv, optional"`
Password string `keda:"name=password,order=authParams;resolvedEnv, optional"`

// TLS
EnableTLS string `keda:"name=tls, order=authParams, optional, default=disable"`
Cert string `keda:"name=cert, order=authParams, optional"`
Key string `keda:"name=key, order=authParams, optional"`
EnableTLS string `keda:"name=tls, order=authParams, default=disable"`
Cert string `keda:"name=cert, order=authParams, optional"`
Key string `keda:"name=key, order=authParams, optional"`
KeyPassword string `keda:"name=keyPassword, order=authParams, optional"`
Ca string `keda:"name=ca, order=authParams, optional"`
Ca string `keda:"name=ca, order=authParams, optional"`
}

func (meta *etcdMetadata) Validate() error {
Expand Down
22 changes: 11 additions & 11 deletions pkg/scalers/mongo_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ type mongoDBScaler struct {
}

type mongoDBMetadata struct {
ConnectionString string `keda:"name=connectionString,order=authParams;triggerMetadata;resolvedEnv,optional"`
Scheme string `keda:"name=scheme,order=authParams;triggerMetadata,default=mongodb,optional"`
Host string `keda:"name=host,order=authParams;triggerMetadata,optional"`
Port string `keda:"name=port,order=authParams;triggerMetadata,optional"`
Username string `keda:"name=username,order=authParams;triggerMetadata,optional"`
Password string `keda:"name=password,order=authParams;triggerMetadata;resolvedEnv,optional"`
DBName string `keda:"name=dbName,order=authParams;triggerMetadata"`
Collection string `keda:"name=collection,order=triggerMetadata"`
Query string `keda:"name=query,order=triggerMetadata"`
QueryValue int64 `keda:"name=queryValue,order=triggerMetadata"`
ActivationQueryValue int64 `keda:"name=activationQueryValue,order=triggerMetadata,default=0"`
ConnectionString string `keda:"name=connectionString, order=authParams;triggerMetadata;resolvedEnv,optional"`
Scheme string `keda:"name=scheme, order=authParams;triggerMetadata,default=mongodb"`
Host string `keda:"name=host, order=authParams;triggerMetadata,optional"`
Port string `keda:"name=port, order=authParams;triggerMetadata,optional"`
Username string `keda:"name=username, order=authParams;triggerMetadata,optional"`
Password string `keda:"name=password, order=authParams;triggerMetadata;resolvedEnv,optional"`
DBName string `keda:"name=dbName, order=authParams;triggerMetadata"`
Collection string `keda:"name=collection, order=triggerMetadata"`
Query string `keda:"name=query, order=triggerMetadata"`
QueryValue int64 `keda:"name=queryValue, order=triggerMetadata"`
ActivationQueryValue int64 `keda:"name=activationQueryValue, order=triggerMetadata,default=0"`
TriggerIndex int
}

Expand Down
14 changes: 7 additions & 7 deletions pkg/scalers/postgresql_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ type postgreSQLScaler struct {
}

type postgreSQLMetadata struct {
TargetQueryValue float64 `keda:"name=targetQueryValue, order=triggerMetadata, optional"`
TargetQueryValue float64 `keda:"name=targetQueryValue, order=triggerMetadata, optional"`
ActivationTargetQueryValue float64 `keda:"name=activationTargetQueryValue, order=triggerMetadata, optional"`
Connection string `keda:"name=connection, order=authParams;resolvedEnv, optional"`
Query string `keda:"name=query, order=triggerMetadata"`
Connection string `keda:"name=connection, order=authParams;resolvedEnv, optional"`
Query string `keda:"name=query, order=triggerMetadata"`
triggerIndex int
azureAuthContext azureAuthContext

Host string `keda:"name=host, order=authParams;triggerMetadata, optional"`
Port string `keda:"name=port, order=authParams;triggerMetadata, optional"`
Host string `keda:"name=host, order=authParams;triggerMetadata, optional"`
Port string `keda:"name=port, order=authParams;triggerMetadata, optional"`
UserName string `keda:"name=userName, order=authParams;triggerMetadata, optional"`
DBName string `keda:"name=dbName, order=authParams;triggerMetadata, optional"`
SslMode string `keda:"name=sslmode, order=authParams;triggerMetadata, optional"`
DBName string `keda:"name=dbName, order=authParams;triggerMetadata, optional"`
SslMode string `keda:"name=sslmode, order=authParams;triggerMetadata, optional"`

Password string `keda:"name=password, order=authParams;resolvedEnv, optional"`
}
Expand Down
Loading

0 comments on commit 3e87999

Please sign in to comment.