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

Add event ttl flag #7487

Merged
merged 3 commits into from
Oct 12, 2019
Merged

Add event ttl flag #7487

merged 3 commits into from
Oct 12, 2019

Conversation

tioxy
Copy link
Contributor

@tioxy tioxy commented Aug 29, 2019

What type of PR is this?
/kind api-change

What this PR does / why we need it:
Add support for kops to declare event-ttl flag from kube-apiserver

Which issue(s) this PR fixes:
Fixes #7484

Special notes for your reviewer:
Should I remove pkg/apis/kops/types.generated.go from this PR?
This file made this PR longer than it should be 😞
I ran this commented command here

Does this PR introduce a user-facing change?:

Add "event-ttl" flag from kube-apiserver

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

kind: Cluster
spec:
    kubeAPIServer:
        eventTTL: 03h0m0s

@k8s-ci-robot
Copy link
Contributor

Welcome @tioxy!

It looks like this is your first PR to kubernetes/kops 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kops has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 29, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @tioxy. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 29, 2019
@zetaab
Copy link
Member

zetaab commented Aug 29, 2019

Could you explain why we have that big changes in pkg/apis/kops/types.generated.go and protokube/pkg/gossip/mesh/mesh.pb.go otherwise this PR looks good

@fejta-bot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@tioxy tioxy force-pushed the add_event_ttl_flag branch from 30be1fa to 2840a63 Compare August 29, 2019 20:49
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 29, 2019
@tioxy
Copy link
Contributor Author

tioxy commented Aug 29, 2019

Sure @zetaab

The changes inside pkg/apis/kops/types.generated.go I got by running this command order below (my mistake 😉):

make apimachinery
# This line below is commented inside "apimachinery-codegen" function in Makefile
# There is a comment "codecgen works only if invoked from directory where the file is located"
# I thought it was needed to generated code, so I ran it
cd pkg/apis/kops/ && ~/k8s/bin/codecgen -d 1234 -o types.generated.go instancegroup.go cluster.go
make

The changes inside protokube/pkg/gossip/mesh/mesh.pb.go I honestly do not know. It basically created a multiline import statement instead of multiple unique import statements. Got this mesh.pb.go running the standard order:

make apimachinery
make

I pushed changes to the codegen commit removing unnecessary changes 😁

Copy link
Member

@zetaab zetaab left a comment

Choose a reason for hiding this comment

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

/ok-to-test
Now it looks good! Thanks

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 29, 2019
Copy link
Contributor

@rdrgmnzs rdrgmnzs left a comment

Choose a reason for hiding this comment

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

Hi @tioxy this looks good, just requesting 1 change before we look at merging it in.

pkg/apis/kops/componentconfig.go Show resolved Hide resolved
@tioxy
Copy link
Contributor Author

tioxy commented Sep 1, 2019

Hi @rdrgmnzs, I made some research around time.Duration usage in the current scenario:

It seems that time.Duration has problems with JSON marshaling/unmarshaling using the standard library. This is why the apimachinery project has this wrapper arround time.Duration which is the metav1.Duration.

Currently, our Decode function for codecs is also built on top of apimachinery packages(runtime and serializer). I don't think we'll run into compatibility issues anytime soon 😃

@tioxy tioxy force-pushed the add_event_ttl_flag branch from 2840a63 to 49fb81e Compare September 12, 2019 15:00
@tioxy tioxy requested a review from rdrgmnzs September 25, 2019 04:07
@tioxy tioxy force-pushed the add_event_ttl_flag branch from 49fb81e to a1a3d44 Compare October 4, 2019 04:38
@tioxy tioxy requested a review from zetaab October 4, 2019 04:39
@tioxy
Copy link
Contributor Author

tioxy commented Oct 4, 2019

Fixed merge conflicts

@tioxy tioxy force-pushed the add_event_ttl_flag branch 2 times, most recently from 9d44a7b to f429f09 Compare October 10, 2019 15:36
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 10, 2019
@tioxy tioxy force-pushed the add_event_ttl_flag branch 2 times, most recently from ffab979 to ac7e6e4 Compare October 10, 2019 17:13
@tioxy tioxy force-pushed the add_event_ttl_flag branch from ac7e6e4 to 18a2491 Compare October 10, 2019 17:21
tioxy added 3 commits October 10, 2019 14:23
Enable cluster spec to support "event-ttl" flag from kube-apiserver to
change event retention time
Add inside flagbuilder a new test case to check if event-ttl flag is being
generated properly
Run apimachinery & crds to generate "zz_generated*" files and to update
cluster crd
@tioxy tioxy force-pushed the add_event_ttl_flag branch from 18a2491 to 6b8af27 Compare October 10, 2019 17:24
@tioxy
Copy link
Contributor Author

tioxy commented Oct 10, 2019

Added tests for event-ttl flag inside flagbuilder

@tioxy
Copy link
Contributor Author

tioxy commented Oct 10, 2019

/assign @rdrgmnzs

@justinsb
Copy link
Member

Thanks @tioxy

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 12, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb, tioxy

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 12, 2019
@k8s-ci-robot k8s-ci-robot merged commit c8d9c70 into kubernetes:master Oct 12, 2019
k8s-ci-robot added a commit that referenced this pull request Oct 14, 2019
…-origin-release-1.15

Automated cherry pick of #7487: Add Event TTL flag
@tioxy tioxy mentioned this pull request Oct 25, 2019
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 lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "event-ttl" flag support from kube-apiserver
6 participants