-
Notifications
You must be signed in to change notification settings - Fork 20
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
Generic k8s interface #70
Conversation
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
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.
LGTM! Love it ❤️
Left a couple of comments, but all of them are nits.
pkg/api/api.go
Outdated
return err | ||
} | ||
|
||
// Create creates a resource in a kubernetes cluster from a yaml manifest |
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.
// Create creates a resource in a kubernetes cluster from a yaml manifest | |
// Create creates a resource in a Kubernetes cluster from a YAML manifest |
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.
The comment is actually wrong as this method does not receive a YAML but an object with the resource specification
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
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 is AWESOME!!! Great job! 🥇 🎉
|
||
var pod = k8s.get(podSpec.kind, podSpec.metadata.name, podSpec.metadata.namespace) | ||
if (podSpec.metadata.name != pod.metadata.name) { | ||
throw new Error("Fetch by name did not return the Service. Expected: " + podSpec.metadata.name + " but got: " + fetched.name) |
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.
Super minor. Error message for the example refers to 'Service' instead of '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.
Good catch. Fixed
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
Implement Generic interface for creating, retrieving, listing, deleting Kubernetes resources of any of a set of supported kinds such as Pod, Job, Secret, Service (among others)
Closes #68