-
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
Integration test for reading Pods via http & file #5785
Integration test for reading Pods via http & file #5785
Conversation
@@ -855,6 +879,29 @@ func ServeCachedManifestFile() (servingAddress string) { | |||
} | |||
|
|||
const ( | |||
testManifestFile = `kind: 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.
This change isn't exactly what we would like to do, because it only tests whether reading Pods works.
Do you have any suggestions how to make it test both scenarios (without significant changes to this file)?
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.
Is anything using this const?
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.
Yes - it is used by ServeCachedManifestFile.
What I would ideally like to do is to have "two modes" - one testing reading pods from http given by manifest, and the other one reading pods from http given PodSpec. But currently all tests are using the same "http endpoint".
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.
FYI: I found an easy way to test both modes (i.e. reading both Pods and ContainerManifest from http channel). Basically, in the integration test we have two Kubelets, so I did small changes that the first one is reading Pods from http, and the second is reading ContainerManifest from http.
I hope that you're fine with that.
@@ -306,37 +306,61 @@ func podRunning(c *client.Client, podNamespace string, podID string) wait.Condit | |||
} | |||
|
|||
func runStaticPodTest(c *client.Client, configFilePath string) { | |||
manifest := `version: v1beta2 | |||
id: static-pod | |||
hostname, _ := os.Hostname() |
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.
@smarterclayton just removed os.Hostname from the integration tests because it was causing issues running them on a mac.
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.
Also we should be using the name from the kubelet (in the integration test, it is always "localhost" for files)
----- Original Message -----
@@ -306,37 +306,61 @@ func podRunning(c *client.Client, podNamespace
string, podID string) wait.Condit
}func runStaticPodTest(c *client.Client, configFilePath string) {
- manifest := `version: v1beta2
-id: static-pod- hostname, _ := os.Hostname()
@smarterclayton just removed os.Hostname from the integration tests because
it was causing issues running them on a mac.
Reply to this email directly or view it on GitHub:
https://github.com/GoogleCloudPlatform/kubernetes/pull/5785/files#r26958255
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.
Yes - I've seen that, but thanks for notifying. I will fix that tomorrow.
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.
Done.
@wojtek-t this is already strictly better than what we have today. We can probably add a Get() to the pods and verify the fields in the pod if you want to also test the values. |
I have no idea how this worked yesterday. Basically, I rebased the PR today morning and it stopped working. But the real problem is that it couldn't parsed the pods in the format that I used yesterday. I spent an hour fighting with it but it didn't lead me anywhere and I gave up. I changed the data format that I was using and now it seems to work. PTAL |
b29973a
to
f80cac1
Compare
When the YAML change landed trailing commas became invalid JSON (the strict Go JSON parser does not allow them, the looser YAML parser did) ----- Original Message -----
|
My problems weren't related to commas. I had the following yaml: Anyway, I think that the current version also tests what we wanted to test. |
We don't support YAML anymore from the API :) ----- Original Message -----
|
Thanks @smarterclayton - I know there are plans for it, but didn't know that it already happened. |
Thanks - that was merged yesterday and that explains why it worked for me yesterday. Anyway, it seems that the current version is exactly what we would like to test. |
BTW - I looked into the test failure and it seems that it's a flake that is unrelated to my changes. |
Thanks @wojtek-t I kicked off Travis and will merge when that is green :) it's half-way through |
Integration test for reading Pods via http & file
Thanks! |
|
Extend hack/integration_test.sh to test reading Pods (in addition to ContainerManifest) via Kubelet http & file channel.
Fixes #3372
It's also part of #5630
cc @vmarmol @yujuhong @bgrant0607