Skip to content

Commit

Permalink
Refer directly to the humio API package for the query ownership type
Browse files Browse the repository at this point in the history
  • Loading branch information
SaaldjorMike committed Aug 8, 2024
1 parent eb00c56 commit 05fafa4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions pkg/humio/filteralert_transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import (
)

const (
FilterAlertIdentifierAnnotation = "humio.com/filter-alert-id"
FilterAlertQueryOwnershipTypeDefault = "Organization"
FilterAlertIdentifierAnnotation = "humio.com/filter-alert-id"
)

func FilterAlertTransform(hfa *humiov1alpha1.HumioFilterAlert) (*humioapi.FilterAlert, error) {
Expand All @@ -21,7 +20,7 @@ func FilterAlertTransform(hfa *humiov1alpha1.HumioFilterAlert) (*humioapi.Filter
Enabled: hfa.Spec.Enabled,
ActionNames: hfa.Spec.Actions,
Labels: hfa.Spec.Labels,
QueryOwnershipType: FilterAlertQueryOwnershipTypeDefault,
QueryOwnershipType: humioapi.QueryOwnershipTypeOrganization,
}

if _, ok := hfa.ObjectMeta.Annotations[FilterAlertIdentifierAnnotation]; ok {
Expand Down
5 changes: 2 additions & 3 deletions pkg/humio/scheduledsearch_transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import (
)

const (
ScheduledSearchIdentifierAnnotation = "humio.com/scheduled-search-id"
ScheduledSearchQueryOwnershipTypeDefault = "Organization"
ScheduledSearchIdentifierAnnotation = "humio.com/scheduled-search-id"
)

func ScheduledSearchTransform(hss *humiov1alpha1.HumioScheduledSearch) (*humioapi.ScheduledSearch, error) {
Expand All @@ -24,7 +23,7 @@ func ScheduledSearchTransform(hss *humiov1alpha1.HumioScheduledSearch) (*humioap
Enabled: hss.Spec.Enabled,
ActionNames: hss.Spec.Actions,
Labels: hss.Spec.Labels,
QueryOwnershipType: ScheduledSearchQueryOwnershipTypeDefault,
QueryOwnershipType: humioapi.QueryOwnershipTypeOrganization,
}

if _, ok := hss.ObjectMeta.Annotations[ScheduledSearchIdentifierAnnotation]; ok {
Expand Down

0 comments on commit 05fafa4

Please sign in to comment.