Skip to content

Instantly share code, notes, and snippets.

@makocchi-git
Last active June 8, 2020 05:21
Show Gist options
  • Save makocchi-git/e4b3e1478ef16566561f9ac3879f5221 to your computer and use it in GitHub Desktop.
Save makocchi-git/e4b3e1478ef16566561f9ac3879f5221 to your computer and use it in GitHub Desktop.
Validate your Kubernetes manifests with Conftest in the GitHub Actions
package main
import data.lib.kubernetes
violation[msg] {
kubernetes.containers[container]
[image_name, "latest"] = kubernetes.split_image(container.image)
msg = kubernetes.format(sprintf("%s in the %s %s has an image, %s, using the latest tag", [container.name, kubernetes.kind, image_name, kubernetes.name]))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment