#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.

###########################################################################
# NOTE: This check (and associated special agent) is deprecated and will be
#       removed in Checkmk version 2.2.
###########################################################################

from cmk.base.check_legacy_includes.k8s import *  # pylint: disable=wildcard-import,unused-wildcard-import


def inv_k8s_service_info(info, inventory_tree):
    parsed = parse_k8s(info)

    path = "software.applications.kubernetes.service_info."
    inv_node = inventory_tree.get_dict(path)

    for key, value in sorted(parsed.items()):
        inv_node[key] = value


inv_info["k8s_service_info"] = {
    "inv_function": inv_k8s_service_info,
}
