blob: 4118b3914b032497546cca6a4d776e7ca55d363b [file] [log] [blame]
import salt.modules.cmdmod
import re
from salt.exceptions import CommandExecutionError
def main():
grains = {}
try:
raw_k8s_ver = salt.modules.cmdmod._run_quiet('hyperkube --version')
ver = re.search('(v[0-9.-]+)', raw_k8s_ver)
if ver:
grains['kubernetes_version'] = ver.group(1)
except CommandExecutionError:
pass
return grains