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

Fork API types. #565

Merged
merged 2 commits into from
Jul 25, 2014
Merged

Fork API types. #565

merged 2 commits into from
Jul 25, 2014

Conversation

brendandburns
Copy link
Contributor

All tests pass (for now...) Rebasing this PR is a pain

@lavalamp
Copy link
Member

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"},
Copy link
Member

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.

@brendandburns
Copy link
Contributor Author

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):
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

@brendandburns
Copy link
Contributor Author

Ok, comments addressed. unit tests & integration tests pass on my machine.

@brendandburns
Copy link
Contributor Author

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) {
Copy link
Member

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 :)

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

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
.

Copy link
Member

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.

@lavalamp
Copy link
Member

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.

@smarterclayton
Copy link
Contributor

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.

@lavalamp
Copy link
Member

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

@brendandburns
Copy link
Contributor Author

I'm around. I'll rebase tonight.

Brendan
On Jul 23, 2014 6:17 PM, "Daniel Smith" notifications@github.com wrote:

@brendandburns https://github.com/brendandburns I'm thinking this PR
should go in before #571
#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.


Reply to this email directly or view it on GitHub
#565 (comment)
.

@brendandburns
Copy link
Contributor Author

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.

lavalamp added a commit that referenced this pull request Jul 25, 2014
@lavalamp lavalamp merged commit 321ce0e into kubernetes:master Jul 25, 2014
@lavalamp
Copy link
Member

Thanks! I'll fix up #571 and we can all argue about whether it's OK to break existing clusters. :)

vishh pushed a commit to vishh/kubernetes that referenced this pull request Apr 6, 2016
Update documentation on running integration tests.
b3atlesfan pushed a commit to b3atlesfan/kubernetes that referenced this pull request Feb 5, 2021
p0lyn0mial pushed a commit to p0lyn0mial/kubernetes that referenced this pull request May 19, 2021
…-skips

Bug 1945091: Don't force-disable IPv6, dual-stack, and SCTP tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants