Skip to content

Commit

Permalink
fix: moved metricType from scraper status to scraper spec (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoL96 authored Nov 14, 2024
1 parent 53d9ce7 commit 8ed1e9e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 3 additions & 0 deletions config/crd/bases/finops.krateo.io_exporterscraperconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ spec:
type: object
scraperConfig:
properties:
metricType:
default: cost
type: string
pollingIntervalHours:
type: integer
scraperDatabaseConfigRef:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/krateoplatformops/finops-operator-exporter
go 1.21

require (
github.com/krateoplatformops/finops-data-types v0.0.0-20241114103324-d1c2aec150da
github.com/krateoplatformops/finops-data-types v0.0.0-20241114164300-a575ba009392
github.com/onsi/ginkgo/v2 v2.14.0
github.com/onsi/gomega v1.30.0
k8s.io/apimachinery v0.29.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/krateoplatformops/finops-data-types v0.0.0-20240822144053-7ce9ae5c26a7 h1:TDJf3NfxxjdENUc43Fpi/CDJ93PE3hSwCFA5+ZOg/74=
github.com/krateoplatformops/finops-data-types v0.0.0-20240822144053-7ce9ae5c26a7/go.mod h1:sBjqLz0E1UCBP5Jnz6i1c9almnmgaf3eZ8Q+fANKzs4=
github.com/krateoplatformops/finops-data-types v0.0.0-20241114103324-d1c2aec150da h1:JbW9RC2eN7oTddgVdCqUI+nhgqbdpwZMQXVQXHvHY2w=
github.com/krateoplatformops/finops-data-types v0.0.0-20241114103324-d1c2aec150da/go.mod h1:sBjqLz0E1UCBP5Jnz6i1c9almnmgaf3eZ8Q+fANKzs4=
github.com/krateoplatformops/finops-data-types v0.0.0-20241114164300-a575ba009392 h1:Cd6K4/yZ/jq8YWTThXcxEJf7JkPMJvYHFKfioLASpZY=
github.com/krateoplatformops/finops-data-types v0.0.0-20241114164300-a575ba009392/go.mod h1:sBjqLz0E1UCBP5Jnz6i1c9almnmgaf3eZ8Q+fANKzs4=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg=
Expand Down
4 changes: 1 addition & 3 deletions internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,13 @@ func CreateScraperCR(ctx context.Context, exporterScraperConfig finopsv1.Exporte
Spec: finopsDataTypes.ScraperConfigSpec{
TableName: exporterScraperConfig.Spec.ScraperConfig.TableName,
Url: url,
MetricType: exporterScraperConfig.Spec.ExporterConfig.MetricType,
PollingIntervalHours: exporterScraperConfig.Spec.ScraperConfig.PollingIntervalHours,
ScraperDatabaseConfigRef: finopsDataTypes.ObjectRef{
Name: exporterScraperConfig.Spec.ScraperConfig.ScraperDatabaseConfigRef.Name,
Namespace: exporterScraperConfig.Spec.ScraperConfig.ScraperDatabaseConfigRef.Namespace,
},
},
Status: finopsDataTypes.ScraperConfigStatus{
MetricType: exporterScraperConfig.Spec.ExporterConfig.MetricType,
},
}
jsonData, err = json.Marshal(scraperConfig)
if err != nil {
Expand Down

0 comments on commit 8ed1e9e

Please sign in to comment.