diff --git a/.chloggen/k8sobjects_checkapi.yaml b/.chloggen/k8sobjects_checkapi.yaml new file mode 100644 index 000000000000..27d983fcb720 --- /dev/null +++ b/.chloggen/k8sobjects_checkapi.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: k8sobjectsreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Do not export the function `NewTicker` + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [26304] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [api] diff --git a/cmd/checkapi/allowlist.txt b/cmd/checkapi/allowlist.txt index 53c927380f3e..6fc1ce506bf1 100644 --- a/cmd/checkapi/allowlist.txt +++ b/cmd/checkapi/allowlist.txt @@ -31,7 +31,6 @@ receiver/dockerstatsreceiver receiver/fluentforwardreceiver receiver/jaegerreceiver receiver/journaldreceiver -receiver/k8sobjectsreceiver receiver/kafkareceiver receiver/mongodbatlasreceiver receiver/mongodbreceiver diff --git a/receiver/k8sobjectsreceiver/receiver.go b/receiver/k8sobjectsreceiver/receiver.go index 2c226d8e8626..5354f0630f31 100644 --- a/receiver/k8sobjectsreceiver/receiver.go +++ b/receiver/k8sobjectsreceiver/receiver.go @@ -108,7 +108,7 @@ func (kr *k8sobjectsreceiver) startPull(ctx context.Context, config *K8sObjectsC kr.mu.Lock() kr.stopperChanList = append(kr.stopperChanList, stopperChan) kr.mu.Unlock() - ticker := NewTicker(config.Interval) + ticker := newTicker(config.Interval) listOption := metav1.ListOptions{ FieldSelector: config.FieldSelector, LabelSelector: config.LabelSelector, @@ -219,7 +219,7 @@ func getResourceVersion(ctx context.Context, config *K8sObjectsConfig, resource // Start ticking immediately. // Ref: https://stackoverflow.com/questions/32705582/how-to-get-time-tick-to-tick-immediately -func NewTicker(repeat time.Duration) *time.Ticker { +func newTicker(repeat time.Duration) *time.Ticker { ticker := time.NewTicker(repeat) oc := ticker.C nc := make(chan time.Time, 1)