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 apps/v1beta2 conversion tests #49645

Merged
merged 1 commit into from
Sep 1, 2017

Conversation

dixudx
Copy link
Member

@dixudx dixudx commented Jul 26, 2017

What this PR does / why we need it:

add apps/v1beta2 conversion test

Depend on #49751(Merged), #49719(Merged)

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:
/cc @janetkuo

Release note:

add apps/v1beta2 conversion test

@k8s-ci-robot k8s-ci-robot requested a review from janetkuo July 26, 2017 16:17
@k8s-ci-robot k8s-ci-robot added 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 Jul 26, 2017
@k8s-ci-robot
Copy link
Contributor

Hi @dixudx. 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.

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. I understand the commands that are listed here.

@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jul 26, 2017
@dixudx
Copy link
Member Author

dixudx commented Jul 27, 2017

@janetkuo As you said, there is no need to add conversion_test.go now. I think I can close this PR.

@janetkuo
Copy link
Member

@k8s-bot ok to test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 27, 2017
@janetkuo
Copy link
Member

@dixudx it's still nice to have unit tests for those conversion codes. I will review this PR once it's ready

@janetkuo janetkuo added this to the v1.8 milestone Jul 27, 2017
@dixudx
Copy link
Member Author

dixudx commented Jul 27, 2017

@janetkuo Thanks. Also I found some conversion bugs during testing these tests. I think we would address other PRs to fix this.

@dixudx dixudx changed the title [WIP] add V1beta2 conversion tests add apps/v1beta2 conversion tests Jul 28, 2017
@dixudx dixudx force-pushed the v1beta2_conversion_test branch from 838dc54 to b3d9471 Compare July 28, 2017 16:17
@k8s-github-robot k8s-github-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 28, 2017
@dixudx
Copy link
Member Author

dixudx commented Jul 28, 2017

@janetkuo PTAL. Thanks.

@dixudx dixudx force-pushed the v1beta2_conversion_test branch 2 times, most recently from 5e22984 to 0b98c42 Compare July 29, 2017 06:51
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 8, 2017
@dixudx dixudx force-pushed the v1beta2_conversion_test branch from 0b98c42 to a282a91 Compare August 8, 2017 14:04
@k8s-github-robot k8s-github-robot removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 8, 2017
@dixudx
Copy link
Member Author

dixudx commented Aug 25, 2017

ping @janetkuo

PTAL. This is quite important for apps/v1beta2.

@dixudx
Copy link
Member Author

dixudx commented Aug 28, 2017

/assign @kow3ns @liggitt

PTAL. Thanks.

@@ -126,3 +126,9 @@ func SetDefaults_ReplicaSet(obj *appsv1beta2.ReplicaSet) {
*obj.Spec.Replicas = 1
}
}

func SetDefaults_RollingUpdateDaemonSet(obj *appsv1beta2.RollingUpdateDaemonSet) {
Copy link
Member

Choose a reason for hiding this comment

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

This is not called by anyone?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated generated files. Done. PTAL.

@@ -118,6 +118,9 @@ func Convert_extensions_RollingUpdateDaemonSet_To_v1beta2_RollingUpdateDaemonSet
}

func Convert_v1beta2_RollingUpdateDaemonSet_To_extensions_RollingUpdateDaemonSet(in *appsv1beta2.RollingUpdateDaemonSet, out *extensions.RollingUpdateDaemonSet, s conversion.Scope) error {
if in.MaxUnavailable == nil {
Copy link
Member

Choose a reason for hiding this comment

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

It can't be nil (and its value has to be >0)

Copy link
Member

Choose a reason for hiding this comment

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

This should be removed, as appsv1beta2.RollingUpdateDaemonSet is never nil (based on default and validation).

@janetkuo
Copy link
Member

/retest

@dixudx dixudx force-pushed the v1beta2_conversion_test branch from 55c2a3e to 8e78bd4 Compare August 29, 2017 03:05
@@ -176,6 +176,9 @@ func SetObjectDefaults_DaemonSet(in *v1beta2.DaemonSet) {
}
}
}
if in.Spec.UpdateStrategy.RollingUpdate != nil {
SetDefaults_RollingUpdateDaemonSet(in.Spec.UpdateStrategy.RollingUpdate)
Copy link
Member

Choose a reason for hiding this comment

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

This should be removed.

SetDefaults_DaemonSet was called in L45 which sets default RollingUpdateDaemonSet already (and sets MaxUnavailable to 1).

Copy link
Member Author

Choose a reason for hiding this comment

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

@janetkuo Updated. PTAL.

@@ -118,6 +118,9 @@ func Convert_extensions_RollingUpdateDaemonSet_To_v1beta2_RollingUpdateDaemonSet
}

func Convert_v1beta2_RollingUpdateDaemonSet_To_extensions_RollingUpdateDaemonSet(in *appsv1beta2.RollingUpdateDaemonSet, out *extensions.RollingUpdateDaemonSet, s conversion.Scope) error {
if in.MaxUnavailable == nil {
Copy link
Member

Choose a reason for hiding this comment

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

This should be removed, as appsv1beta2.RollingUpdateDaemonSet is never nil (based on default and validation).

@janetkuo
Copy link
Member

/retest

@dixudx dixudx force-pushed the v1beta2_conversion_test branch from 8e78bd4 to 1ca59e6 Compare August 30, 2017 14:50
t.Errorf("%q - %q: unexpected error: %v", k, "from extensions to v1beta2", err)
}

if !apiequality.Semantic.DeepDerivative(internal1, tc.stsSepc2) {
Copy link
Member

Choose a reason for hiding this comment

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

Use apiequality.Semantic.DeepEqual instead of DeepDerivative everywhere in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

@janetkuo Updated. PTAL. Thanks.

}
if tc.adjustment {
if tc.stsSpec1.Template.Spec.SecurityContext == nil {
tc.stsSpec1.Template.Spec.SecurityContext = new(api.PodSecurityContext)
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this?

@dixudx dixudx force-pushed the v1beta2_conversion_test branch 2 times, most recently from 5349401 to fac112f Compare August 31, 2017 02:57
@janetkuo
Copy link
Member

/lgtm

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

k8s-ci-robot commented Aug 31, 2017

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

Test name Commit Details Rerun command
pull-kubernetes-bazel 55c2a3e link /test pull-kubernetes-bazel

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.

@dixudx dixudx force-pushed the v1beta2_conversion_test branch from fac112f to 02daf88 Compare August 31, 2017 08:11
@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 31, 2017
@dixudx dixudx force-pushed the v1beta2_conversion_test branch from 02daf88 to a76f538 Compare August 31, 2017 08:25
@janetkuo
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 31, 2017
@dixudx
Copy link
Member Author

dixudx commented Sep 1, 2017

ping @liggitt

PTAL. Need your approval. Thanks.

@liggitt
Copy link
Member

liggitt commented Sep 1, 2017

/approve no-issue

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dixudx, janetkuo, liggitt

Associated issue: 49751

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

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

Automatic merge from submit-queue (batch tested with PRs 50381, 51307, 49645, 50995, 51523)

@k8s-github-robot k8s-github-robot merged commit 5f405b7 into kubernetes:master Sep 1, 2017
@dixudx dixudx deleted the v1beta2_conversion_test branch September 2, 2017 01:05
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants