-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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
update PodSpec.Host to PodSpec.NodeName #8853
Conversation
// the the scheduler simply schedules this pod onto that host, assuming that it fits | ||
// resource requirements. | ||
Host string `json:"host,omitempty" description:"host requested for this pod"` | ||
NodeName string `json:"nodeName,omitempty" description:"host requested for this pod"` |
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.
Please change the description tag, also: node requested for this pod.
Fails gofmt |
Ref #7018 |
75a58ff
to
7c53f20
Compare
Updated. PTAL. Thanks. |
Doesn't build. Regenerate pkg/api/deep_copy_generated.go |
@wojtek-t We're having trouble with the generated conversions. Is it obvious what we're doing wrong? |
Hi @wojtek-t, no big deals, I just want to know what's the best practice when one tried to update the api, e.g., update PodSpec.Host to PodSpec.Nodename. here are the steps that I want to take, but these don't work:
So I have to manually update various -generated.go, and then these update- scripts are happy. However, at this point, I have already made all the changes manually, there is no work left for these update-* scripts. Please let me know if there is a better way. Thanks. |
@@ -19,6 +19,8 @@ package controller | |||
import ( | |||
"fmt" | |||
|
|||
"sync/atomic" |
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 this change?
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.
There is something wrong with the goimports. I will fix it. Thanks.
Building the generator should not build the previously generated code. That seems wrong. |
In cmd/genconversion/conversion.go:
So to build the generator, it requires the conversion_generated.go files in these packages to be correct. |
I understand that's the way it is. I was saying it shouldn't be that way. :-) The generated code just needs to build, though, right? It doesn't need to work? If you commented out the lines it complained about, would the generator build and then regenerate the conversions? |
Yeah, that should work. That seems to be the best option. |
@caesarxuchao - yes, unfortunately this is the easiest way to do it. Basically, what you can do is to remove the whole code from */conversions_generated.go files, and running: |
@wojtek-t Please add that to the instructions. |
@bgrant0607 - I thought about it and I know how to fix the problem. Will fix the real issue instead of updating documentation :) |
"remove the whole code from */conversions_generated.go" won't work, because some functions in conversion.go depend on code in conversions_generated.go @wojtek-t, I'm looking forward to your fix : ) |
if newPod.Spec.Host != oldPod.Spec.Host { | ||
allErrs = append(allErrs, errs.NewFieldInvalid("status.host", newPod.Spec.Host, "pod host cannot be changed directly")) | ||
if newPod.Spec.NodeName != oldPod.Spec.NodeName { | ||
allErrs = append(allErrs, errs.NewFieldInvalid("status.nodeName", newPod.Spec.NodeName, "pod host cannot be changed directly")) |
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.
s/host/node/ in error message
@caesarxuchao unfortunately my fix doesn't work because what you wrote. Updated instructions are in #8921 |
Tests failing:
|
241087d
to
89cd3ab
Compare
@bgrant0607 Updated and rebased. Let's wait for the Shippable results. Thanks. |
Shippable failed already:
|
There is something wrong in field.selector. I'm taking a look. |
@bgrant0607 Shippable is green |
Please squash the commits. |
LGTM once squashed. |
…/api/v1beta3/types.go
93e7baa
to
9c11533
Compare
Squashed. Thanks. |
update PodSpec.Host to PodSpec.NodeName
update PodSpec.Host to PodSpec.NodeName in /pkg/api/types.go and /pkg/api/v1/types.go
fix #6895
@bgrant0607 @krousey