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

adding timestamp in k8s artifacts #717

Closed
surajnarwade opened this issue Jul 18, 2017 · 9 comments
Closed

adding timestamp in k8s artifacts #717

surajnarwade opened this issue Jul 18, 2017 · 9 comments

Comments

@surajnarwade
Copy link
Contributor

I was validating results from kompose using kubeval, I got following output:

$ kubeval frontend-deployment.yaml 
The document frontend-deployment.yaml contains an invalid Deployment
--> spec.template.metadata.creationTimestamp: Invalid type. Expected: string, given: null
--> metadata.creationTimestamp: Invalid type. Expected: string, given: null

Should we add timestamp in spec ?
any thoughts, @kadel @surajssd @cdrage

@kadel
Copy link
Member

kadel commented Jul 18, 2017

I don't think it should be set, and null should be valid for createationTimestamp

It looks like bug in kubeval

If you look at the reference documentatoin it says
"CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. "

@surajnarwade
Copy link
Contributor Author

@kadel , gotcha, thanks for clarifying

@surajssd
Copy link
Member

surajssd commented Jul 19, 2017

@surajnarwade do you mind reporting it in kubeval ?

@garethr
Copy link

garethr commented Jul 20, 2017

Hey, author of kubeval here.

According to the Kubernetes spec (https://github.com/garethr/kubernetes-json-schema/blob/master/master-standalone/deployment.json#L3511-L3514) the error is correct. Unfortunately Kubernetes doesn't exactly use this spec internally, so kubeval is finding upstream bugs in how the types are output to JSON Schema in the OpenAPI spec in a few places.

I've opened instrumenta/kubeval#16 to track.

@surajnarwade note that kubeval will shortly be available as a Go library as well, so it might be interesting to build the validation in as an optional step into Kompose?

@surajnarwade
Copy link
Contributor Author

@garethr that will be awesome

@surajssd
Copy link
Member

@garethr thanks, having a golang binary will help both kompose and kedge !

cc: @containscafeine @kadel

@garethr
Copy link

garethr commented Jul 21, 2017

Usage as a go library is now in master with a little documentation. https://github.com/garethr/kubeval#library

I'd love any feedback on that interface, or other things folks would like to see.

@garethr
Copy link

garethr commented Jul 24, 2017

@surajnarwade just to let you know I've updated the schemas and the service definition should now work as expected. All the details in instrumenta/kubeval#16 for anyone following along.

@surajnarwade
Copy link
Contributor Author

@garethr awesome, It's working as expected, Thanks :)

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

No branches or pull requests

4 participants