Skip to content

Commit

Permalink
Merge pull request #909 from humio/mike/optional_tagfields
Browse files Browse the repository at this point in the history
Fix issue with HumioParser where creates/updates would fail when TagF…
  • Loading branch information
SaaldjorMike authored Feb 5, 2025
2 parents c1a02cd + bd24151 commit 770b203
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/humio/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,18 @@ func (h *ClientConfig) DeleteIngestToken(ctx context.Context, client *humioapi.C
}

func (h *ClientConfig) AddParser(ctx context.Context, client *humioapi.Client, _ reconcile.Request, hp *humiov1alpha1.HumioParser) error {
tagFields := []string{}
if hp.Spec.TagFields != nil {
tagFields = hp.Spec.TagFields
}
_, err := humiographql.CreateParserOrUpdate(
ctx,
client,
hp.Spec.RepositoryName,
hp.Spec.Name,
hp.Spec.ParserScript,
humioapi.TestDataToParserTestCaseInput(hp.Spec.TestData),
hp.Spec.TagFields,
tagFields,
[]string{},
false,
)
Expand Down

0 comments on commit 770b203

Please sign in to comment.