-
Notifications
You must be signed in to change notification settings - Fork 40k
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
add apps/v1beta2 conversion tests #49645
Conversation
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 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. |
@janetkuo As you said, there is no need to add conversion_test.go now. I think I can close this PR. |
@k8s-bot ok to test |
@dixudx it's still nice to have unit tests for those conversion codes. I will review this PR once it's ready |
@janetkuo Thanks. Also I found some conversion bugs during testing these tests. I think we would address other PRs to fix this. |
838dc54
to
b3d9471
Compare
@janetkuo PTAL. Thanks. |
5e22984
to
0b98c42
Compare
0b98c42
to
a282a91
Compare
ping @janetkuo PTAL. This is quite important for |
pkg/apis/apps/v1beta2/defaults.go
Outdated
@@ -126,3 +126,9 @@ func SetDefaults_ReplicaSet(obj *appsv1beta2.ReplicaSet) { | |||
*obj.Spec.Replicas = 1 | |||
} | |||
} | |||
|
|||
func SetDefaults_RollingUpdateDaemonSet(obj *appsv1beta2.RollingUpdateDaemonSet) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
pkg/apis/apps/v1beta2/conversion.go
Outdated
@@ -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 { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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).
/retest |
55c2a3e
to
8e78bd4
Compare
@@ -176,6 +176,9 @@ func SetObjectDefaults_DaemonSet(in *v1beta2.DaemonSet) { | |||
} | |||
} | |||
} | |||
if in.Spec.UpdateStrategy.RollingUpdate != nil { | |||
SetDefaults_RollingUpdateDaemonSet(in.Spec.UpdateStrategy.RollingUpdate) |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janetkuo Updated. PTAL.
pkg/apis/apps/v1beta2/conversion.go
Outdated
@@ -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 { |
There was a problem hiding this comment.
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).
/retest |
8e78bd4
to
1ca59e6
Compare
t.Errorf("%q - %q: unexpected error: %v", k, "from extensions to v1beta2", err) | ||
} | ||
|
||
if !apiequality.Semantic.DeepDerivative(internal1, tc.stsSepc2) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
5349401
to
fac112f
Compare
/lgtm |
@dixudx: The following test failed, say
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. |
fac112f
to
02daf88
Compare
02daf88
to
a76f538
Compare
/lgtm |
ping @liggitt PTAL. Need your approval. Thanks. |
/approve no-issue |
[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 |
Automatic merge from submit-queue (batch tested with PRs 50381, 51307, 49645, 50995, 51523) |
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: