-
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
Fork API types. #565
Fork API types. #565
Conversation
Will try to review quickly, then. Aren't you supposed to be on vacation? :) |
|
||
outer := &EmbeddedTest{ | ||
JSONBase: JSONBase{ID: "outer"}, | ||
JSONBase: JSONBase{ID: "outer", APIVersion: "internal"}, |
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.
Suggest that we use "" to mean internal - same rule that I made for the Kind: field. Set on the wire, blank in memory, because it's implicit in the go type. This will mean much less changes to tests.
want to get this in. rebasing it for a week is going to kill me... (integration tests failing, though. looking into it...) |
select { | ||
case <-done: | ||
break | ||
case <-time.After(10 * time.Second): |
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's an argument to pass to go test to get this timeout behavior-- let's not recreate it in every test?
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.
Hrm, I'd argue that its relevant here because it tells you specifically what is timing out.
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.
If it times out via the test, I believe you get a stack trace, which is even more relevant because you can see where it's stuck.
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.
Personally I find the massive golang stack dumps to be not particularly helpful when debugging a test vs. a focused message. But I don't super care. I've added the timeout to the test script, since that's a good idea anyway. If you feel strongly I'll revert this part of the 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.
Fair enough. They are super long and force me to type 2>&1|less
way more often than I care to.
Ok, comments addressed. unit tests & integration tests pass on my machine. |
e2e tests are failing. Looks like the validation code in the kubelet expects a name and a version. Let's hold this until the etcd changes are in. |
} | ||
|
||
// TODO: switch to registered functions for each type. | ||
func externalize(obj interface{}) (interface{}, error) { |
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.
I don't get it - once we have v1beta2, v1beta3, etc, how do you externalize to those? I liked that the first cut of this had the internalize/externalize in the v1beta1 package - that just seems "righter" to me.
I won't have time to re-review this this week, so I'll roll with whatever you and @lavalamp decide, but I don't get it yet :)
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.
My thought was that when that happens, externalize will have to take a version parameter. We can add that now if it aids clarity.
The old code didn't handle this correctly either, it just placed the conversion in the package.
Probably the right thing to do is to move externalize into the v1beta1 package, and reference it from here.
We can do that in a second pass.
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.
I agree-- the interface for externalize should take the destination version as an additional parameter. I think we can change that later, though. As for placing the translation functions in the v1betaX packages, that may be possible-- I'm OK with it as long as only the api package has to include those other packages. I want to contain the ugly translations and keep it separate from the rest of the codebase as much as possible.
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.
SGTM
On Tue, Jul 22, 2014 at 10:29 PM, Daniel Smith notifications@github.com
wrote:
In pkg/api/helper.go:
}
result.APIVersion = ""
return &result, nil
- default:
fn, ok := internalFuncs[reflect.ValueOf(cObj).Elem().Type().Name()]
if !ok {
fmt.Printf("unknown object to internalize: %s", reflect.ValueOf(cObj).Type().Name())
panic(fmt.Sprintf("unknown object to internalize: %s", reflect.ValueOf(cObj).Type().Name()))
}
return fn(cObj)
- }
- return obj, nil
+}
+// TODO: switch to registered functions for each type.
+func externalize(obj interface{}) (interface{}, error) {I agree-- the interface for externalize should take the destination
version as an additional parameter. I think we can change that later,
though. As for placing the translation functions in the v1betaX packages,
that may be possible-- I'm OK with it as long as only the api package has
to include those other packages. I want to contain the ugly translations
and keep it separate from the rest of the codebase as much as possible.Reply to this email directly or view it on GitHub
https://github.com/GoogleCloudPlatform/kubernetes/pull/565/files#r15271699
.
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.
Sounds like we're all on the same page here.
Oh, I bet e2e test broke with @smarterclayton's mega-PR, which starts using @thockin's validation thingy in the kubelet. I think I saw some chatter about this in an issue or on IRC or somewhere. |
brendan got the bulk of the e2e failures - I'm going to add some tests so I can't break this in the future this badly. |
@brendandburns I'm thinking this PR should go in before #571, which will need a few things added to your switches. That way we only make one breaking change to the data we store in etcd, which is going to break existing clusters. But I don't want to rebase on top of your commit and write that if it's going to change a lot. |
I'm around. I'll rebase tonight. Brendan
|
Ok, e2e tests now pass. (well basic.sh is flakey, but I got it to pass at least once) I expect Travis will also go green as soon as my latests commits finish running. Merge when ready. |
Thanks! I'll fix up #571 and we can all argue about whether it's OK to break existing clusters. :) |
Update documentation on running integration tests.
network manager: Improve logging
…-skips Bug 1945091: Don't force-disable IPv6, dual-stack, and SCTP tests
All tests pass (for now...) Rebasing this PR is a pain