Skip to content

Commit

Permalink
feat: add autoscaler to api types
Browse files Browse the repository at this point in the history
  • Loading branch information
rriski committed Oct 30, 2024
1 parent 65e7e68 commit 7ab38f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/v1alpha1/serviceintegration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/aiven/go-client-codegen/handler/service"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

autoscalerintegration "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/integration/autoscaler"
clickhousekafkauserconfig "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/integration/clickhouse_kafka"
clickhousepostgresqluserconfig "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/integration/clickhouse_postgresql"
datadogintegration "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/integration/datadog"
Expand Down Expand Up @@ -59,6 +60,9 @@ type ServiceIntegrationSpec struct {
// Destination project for the integration (if any)
DestinationProjectName string `json:"destinationProjectName,omitempty"`

// Autoscaler specific user configuration options
AutoscalerUserConfig *autoscalerintegration.AutoscalerUserConfig `json:"autoscaler,omitempty"`

// Datadog specific user configuration options
DatadogUserConfig *datadogintegration.DatadogUserConfig `json:"datadog,omitempty"`

Expand Down Expand Up @@ -130,6 +134,7 @@ func (in *ServiceIntegration) Conditions() *[]metav1.Condition {

func (in *ServiceIntegration) getUserConfigFields() map[service.IntegrationType]any {
return map[service.IntegrationType]any{
service.IntegrationTypeAutoscaler: in.Spec.AutoscalerUserConfig,
service.IntegrationTypeClickhouseKafka: in.Spec.ClickhouseKafkaUserConfig,
service.IntegrationTypeClickhousePostgresql: in.Spec.ClickhousePostgreSQLUserConfig,
service.IntegrationTypeDatadog: in.Spec.DatadogUserConfig,
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/serviceintegrationendpoint_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

autoscaleruserconfig "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/integrationendpoints/autoscaler"
datadoguserconfig "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/integrationendpoints/datadog"
externalawscloudwatchlogsuserconfig "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/integrationendpoints/external_aws_cloudwatch_logs"
externalawscloudwatchmetricsuserconfig "github.com/aiven/aiven-operator/api/v1alpha1/userconfig/integrationendpoints/external_aws_cloudwatch_metrics"
Expand Down Expand Up @@ -37,6 +38,9 @@ type ServiceIntegrationEndpointSpec struct {
// Source endpoint for the integration (if any)
EndpointName string `json:"endpointName,omitempty"`

// Autoscaler configuration values
Autoscaler *autoscaleruserconfig.AutoscalerUserConfig `json:"autoscaler,omitempty"`

// Datadog configuration values
Datadog *datadoguserconfig.DatadogUserConfig `json:"datadog,omitempty"`

Expand Down Expand Up @@ -118,6 +122,7 @@ func (in *ServiceIntegrationEndpoint) Conditions() *[]metav1.Condition {

func (in *ServiceIntegrationEndpoint) getUserConfigFields() map[string]any {
return map[string]any{
"autoscaler": in.Spec.Autoscaler,
"datadog": in.Spec.Datadog,
"external_aws_cloudwatch_logs": in.Spec.ExternalAwsCloudwatchLogs,
"external_aws_cloudwatch_metrics": in.Spec.ExternalAwsCloudwatchMetrics,
Expand Down

0 comments on commit 7ab38f8

Please sign in to comment.