From 2c4bb0fa4db88462a61995d9179fad801b00d69d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 12 Nov 2019 08:30:24 -0500 Subject: [PATCH] client-go/tools: Docs: Clarify what's "old" core/v1 and what's "new" events/v1beta1 --- .../src/k8s.io/client-go/tools/events/BUILD | 1 + .../src/k8s.io/client-go/tools/events/doc.go | 19 +++++++++++++++++++ .../src/k8s.io/client-go/tools/record/doc.go | 3 ++- .../k8s.io/client-go/tools/record/event.go | 8 ++++---- 4 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 staging/src/k8s.io/client-go/tools/events/doc.go diff --git a/staging/src/k8s.io/client-go/tools/events/BUILD b/staging/src/k8s.io/client-go/tools/events/BUILD index a265bdc6ed0..d8a3e39c3f0 100644 --- a/staging/src/k8s.io/client-go/tools/events/BUILD +++ b/staging/src/k8s.io/client-go/tools/events/BUILD @@ -3,6 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", srcs = [ + "doc.go", "event_broadcaster.go", "event_recorder.go", "fake.go", diff --git a/staging/src/k8s.io/client-go/tools/events/doc.go b/staging/src/k8s.io/client-go/tools/events/doc.go new file mode 100644 index 00000000000..795582b0280 --- /dev/null +++ b/staging/src/k8s.io/client-go/tools/events/doc.go @@ -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" diff --git a/staging/src/k8s.io/client-go/tools/record/doc.go b/staging/src/k8s.io/client-go/tools/record/doc.go index 657ddecbcdc..33d5fe78ee0 100644 --- a/staging/src/k8s.io/client-go/tools/record/doc.go +++ b/staging/src/k8s.io/client-go/tools/record/doc.go @@ -14,5 +14,6 @@ See the License for the specific language governing permissions and 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" diff --git a/staging/src/k8s.io/client-go/tools/record/event.go b/staging/src/k8s.io/client-go/tools/record/event.go index 159acee4b7d..66f8bd634e8 100644 --- a/staging/src/k8s.io/client-go/tools/record/event.go +++ b/staging/src/k8s.io/client-go/tools/record/event.go @@ -132,14 +132,14 @@ type EventBroadcaster interface { Shutdown() } -// EventRecorderAdapter is a wrapper around EventRecorder implementing the -// new EventRecorder interface. +// EventRecorderAdapter is a wrapper around a "k8s.io/client-go/tools/record".EventRecorder +// implementing the new "k8s.io/client-go/tools/events".EventRecorder interface. type EventRecorderAdapter struct { recorder EventRecorder } -// NewEventRecorderAdapter returns an adapter implementing new EventRecorder -// interface. +// NewEventRecorderAdapter returns an adapter implementing the new +// "k8s.io/client-go/tools/events".EventRecorder interface. func NewEventRecorderAdapter(recorder EventRecorder) *EventRecorderAdapter { return &EventRecorderAdapter{ recorder: recorder,