Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changes/unreleased/Refactor-20250812-152151.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Refactor
body: 'BREAKING CHANGE: Refactor the automatic external_kind calculation for when posting to custom data integration so that "/" are not turned into "_"'
time: 2025-08-12T15:21:51.825057-04:00
4 changes: 2 additions & 2 deletions workers/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"net/url"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -75,12 +76,11 @@ func (s *K8SWorker) parse(item *unstructured.Unstructured) (opslevel.JSON, error
}

func (s *K8SWorker) sendEvent(kind string, id string, value *unstructured.Unstructured) {
kind = strings.Replace(kind, "/", "_", -1)
if viper.GetBool("dry-run") {
log.Info().Msgf("[DRYRUN] POST %s | %s", kind, id)
log.Debug().Msgf("\t%#v", value)
} else {
url := fmt.Sprintf("%s?external_kind=%s", s.integration, kind)
url := fmt.Sprintf("%s?external_kind=%s", s.integration, url.QueryEscape(kind))
resp, err := s.restClient.R().SetBody(value).Post(url)
if err != nil {
log.Error().Err(err).Msgf("error during post")
Expand Down