Merge pull request #85134 from LukeShu/lukeshu/event-docs-non-api

client-go/tools: Docs: Clarify what's "old" core/v1 and what's "new" events/v1beta1

Kubernetes-commit: 760af28f69a7cf7090abeca59e1e0703d161ace8
This commit is contained in:
Kubernetes Publisher 2019-11-12 09:06:48 -08:00
commit 74d7a2e0eb
3 changed files with 25 additions and 5 deletions

19
tools/events/doc.go Normal file
View File

@ -0,0 +1,19 @@
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package events has all client logic for recording and reporting
// "k8s.io/api/events/v1beta1".Event events.
package events // import "k8s.io/client-go/tools/events"

View File

@ -14,5 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// Package record has all client logic for recording and reporting events. // Package record has all client logic for recording and reporting
// "k8s.io/api/core/v1".Event events.
package record // import "k8s.io/client-go/tools/record" package record // import "k8s.io/client-go/tools/record"

View File

@ -132,14 +132,14 @@ type EventBroadcaster interface {
Shutdown() Shutdown()
} }
// EventRecorderAdapter is a wrapper around EventRecorder implementing the // EventRecorderAdapter is a wrapper around a "k8s.io/client-go/tools/record".EventRecorder
// new EventRecorder interface. // implementing the new "k8s.io/client-go/tools/events".EventRecorder interface.
type EventRecorderAdapter struct { type EventRecorderAdapter struct {
recorder EventRecorder recorder EventRecorder
} }
// NewEventRecorderAdapter returns an adapter implementing new EventRecorder // NewEventRecorderAdapter returns an adapter implementing the new
// interface. // "k8s.io/client-go/tools/events".EventRecorder interface.
func NewEventRecorderAdapter(recorder EventRecorder) *EventRecorderAdapter { func NewEventRecorderAdapter(recorder EventRecorder) *EventRecorderAdapter {
return &EventRecorderAdapter{ return &EventRecorderAdapter{
recorder: recorder, recorder: recorder,