Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

[WIP] An edgy test case with Istio example #697

Closed
wants to merge 4 commits into from

Conversation

errordeveloper
Copy link
Contributor

While playing with Istio, I've encotered an issue with Flux failing to parse a manifest that contains 1 service and 3 deployments.

The reviews service is defind as part of a larger multi-doc manifest. In order to enable it with Istion sidecars, one has to use istioctl kube-inject, and only after that it becomes consumable by Flux. I've checked in the output of istioctl kube-inject into a repo of my own and split the app into smaller multi-docs, and hooked it up to Flux (using v1.0.0-beta).

Flux tripped over this with an obscure error message:

ts=2017-08-09T14:58:11Z caller=loop.go:132 component=sync-loop err="Service default/reviews: running kubectl: error: error validating \"STDIN\": error validating data: field spec.template.spec.containers[0].name for v1.Container is required; if you choose to ignore these errors, turn validation off with --validate=false; Deployment default/reviews-v1: yaml: line 1: mapping values are not allowed in this context"

I've test the manifest using kubectl apply and it worked just fine.

I then broke the manifest into 4 (1 for the service, and one for each of the deployments), and that worked fine with Flux (see reviews*.yaml).
I've then combined deployments into one file, and that gave me a new error:

ts=2017-08-09T16:34:53Z caller=loop.go:132 component=sync-loop err="Deployment default/reviews-v1: running kubectl: The Deployment \"reviews-v3\" is invalid: \n* spec.template.metadata.labels: Invalid value: map[string]string(nil): `selector` does not match template `labels`\n* spec.template.spec.containers: Required value"

So I realised something must be a litte odd here.

In this PR I've added a test case with large multi-doc and after I've made some trivial updates in the tests, I've discovered that we end-up with a bit of a mess:

@squaremo
Copy link
Member

Good to have this extra test case. Can you reduce it to just the thing(s) that upset the parsing? (And I guess we don't need it to be istio-specific, which would remove the licensing concern)

@errordeveloper
Copy link
Contributor Author

errordeveloper commented Aug 13, 2017 via email

@squaremo
Copy link
Member

squaremo commented Dec 8, 2017

a significantly
large manifest may be the key to this behaviour.

#826 increased the buffer used for scanning multidocument YAML files, if that was indeed the problem here.

I'm going to close this PR, but please do raise an issue if you can still reproduce the problem, @errordeveloper.

@squaremo squaremo closed this Dec 8, 2017
@squaremo squaremo deleted the test-istio-reviews-example-1 branch June 22, 2018 10:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants