Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New API group for Events. #49112

Merged
merged 3 commits into from
Nov 23, 2017
Merged

New API group for Events. #49112

merged 3 commits into from
Nov 23, 2017

Conversation

gmarek
Copy link
Contributor

@gmarek gmarek commented Jul 18, 2017

Fix kubernetes/enhancements#383

cc @shyamjvs

Add events.k8s.io api group with v1beta1 API containing redesigned Event type.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 18, 2017
@k8s-github-robot k8s-github-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/new-api size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 18, 2017
@gmarek gmarek force-pushed the eventAPI branch 3 times, most recently from f5fc4e3 to 5ddde7d Compare July 18, 2017 17:24
@k8s-github-robot k8s-github-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 18, 2017
@gmarek
Copy link
Contributor Author

gmarek commented Jul 18, 2017

@caesarxuchao - can you please finish this PR, but adding stuff that's needed for update-all.sh to successfully run? If not you can someone from @kubernetes/sig-api-machinery-api-reviews do that?

As I don't have any idea what needs to be done and it's not documented anywhere I'll need to fall back to just modifying Event type in place in v1.Core group.

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Jul 18, 2017
@caesarxuchao
Copy link
Member

Have you taken a look at the doc updates in kubernetes/community#788?

@gmarek
Copy link
Contributor Author

gmarek commented Jul 19, 2017

No - I've found only last updates from few months back, which weren't merged.

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system.
type EventTwo struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't call this EventTwo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry - that's a placeholder. Current API machinery doesn't allow creating type Event inside group events, because it tries to be smart and creates a type events (plural for type Event) and we get name collision. Is it likely to get fixed in 1.8 timeframe? @kubernetes/sig-api-machinery-bugs @sttts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmarek do you have a gist with the conflict in code?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it the type in the client?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry - I meant to cc @deads2k as he already knows the issue.

@sttts - I can generate it easily enough. I'll do this tomorrow.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@gmarek gmarek Jul 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried patching it, but it didn't help - updated this PR with the result.

@sttts gist for you:

pkg/client/clientset_generated/internalclientset/typed/events/internalversion/event.go:48: events redeclared in this block

Once here:

import (
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	types "k8s.io/apimachinery/pkg/types"
	watch "k8s.io/apimachinery/pkg/watch"
	rest "k8s.io/client-go/rest"
	events "k8s.io/kubernetes/pkg/apis/events"
	scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme"
)

and once here:

// events implements EventInterface
type events struct {
	client rest.Interface
	ns     string
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry - I didn't notice that I need to add overrides. Trying it now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, still doesn't work.

// Required. Time when this Event was first observed.
EventTime metav1.MicroTime
// Optional. Data about the Event series this event represents or nil if it's a singleton Event.
Series *EventSeries
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kensimon speak now or forever hold your peace.

@gmarek gmarek force-pushed the eventAPI branch 5 times, most recently from 9e212e3 to 4f385da Compare July 20, 2017 13:46
Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as-is, but a few nits

@@ -25,8 +25,8 @@ const (
PodStatusField = "status.phase"
SecretTypeField = "type"

EventReasonField = "reason"
EventSourceField = "source"
EventReasonField = "action"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea what these are for - nothing seems to use them in the codebase..


// Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`.
// +optional
ReportingController string `json:"reportingController,omitempty" protobuf:"bytes,4,opt,name=reportingController"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All optional fields should be pointers

@thockin
Copy link
Member

thockin commented Nov 22, 2017

/lgtm
/approve

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 22, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: caesarxuchao, gmarek, thockin

Associated issue: 383

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@thockin thockin added kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Nov 22, 2017
@k8s-github-robot k8s-github-robot removed this from the v1.9 milestone Nov 22, 2017
@enisoc enisoc added priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. and removed priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Nov 23, 2017
@enisoc enisoc added this to the v1.9 milestone Nov 23, 2017
@k8s-github-robot
Copy link

[MILESTONENOTIFIER] Milestone Pull Request Current

@caesarxuchao @derekwaynecarr @gmarek @smarterclayton @sttts @thockin

Note: This pull request is marked as priority/critical-urgent, and must be updated every 1 day during code freeze.

Example update:

ACK.  In progress
ETA: DD/MM/YYYY
Risks: Complicated fix required
Pull Request Labels
  • sig/api-machinery: Pull Request will be escalated to these SIGs if needed.
  • priority/critical-urgent: Never automatically move pull request out of a release milestone; continually escalate to contributor and SIG through all available channels.
  • kind/feature: New functionality.
Help

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to @fejta).

Review the full test history for this PR.

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Nov 23, 2017

@gmarek: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-cross ef6f0b8 link /test pull-kubernetes-cross

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 55952, 49112, 55450, 56178, 56151). If you want to cherry-pick this change to another branch, please follow the instructions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet