PK!l rtulips/__init__.pyimport importlib from .kind import Kind def class_for_kind(kind: str) -> Kind: """Return Kubernetes ResourceDefintion class. Args: kind (t.AnyStr): Resource name. Raises: ImportError: Resource is not defined. Example: Missing persistentvolumeclaim.py AttributeError: Resource has no Kind class. Example: Missing persistentvolumeclaim.PersistentVolumeClaim Returns: t.Callable[Kind]: Resource operator. """ # load the module, will raise ImportError if module cannot be loaded m = importlib.import_module(f".kind.{kind.lower()}", package=__package__) # get the class, will raise AttributeError if class cannot be found c = getattr(m, kind) return c PK!>%  tulips/kind/__init__.pyimport abc import typing as t import yaml from kubernetes import client as k8s class Kind(metaclass=abc.ABCMeta): """Kind is interface that describes Kubernetes Resource defintion.""" @abc.abstractmethod def __init__( self, client: t.Callable[[], k8s.ApiClient], namespace: t.AnyStr ) -> None: pass @abc.abstractmethod def create(self, body: yaml.YAMLObject): pass @abc.abstractmethod def delete(self, name: t.AnyStr, body: k8s.V1DeleteOptions): pass PK!0VI~~tulips/kind/deployment.pyimport typing as t import yaml from kubernetes import client as k8s from . import Kind class Deployment(Kind): def __init__(self, client: k8s.ApiClient, namespace: str) -> None: self.client = client self.namespace: str = namespace def delete(self, name: t.AnyStr, body: k8s.V1DeleteOptions): return k8s.AppsV1Api(self.client).delete_namespaced_deployment( body=body, namespace=self.namespace, name=name ) def create(self, body: yaml.YAMLObject): return k8s.AppsV1Api(self.client).create_namespaced_deployment( body=body, namespace=self.namespace ) PK!9tulips/kind/ingress.pyimport typing as t import yaml from kubernetes import client as k8s from . import Kind class Ingress(Kind): def __init__(self, client: k8s.ApiClient, namespace: str) -> None: self.client = client self.namespace: str = namespace def delete(self, name: t.AnyStr, body: k8s.V1DeleteOptions): return k8s.ExtensionsV1beta1Api(self.client).delete_namespaced_ingress( body=body, namespace=self.namespace, name=name ) def create(self, body: yaml.YAMLObject): return k8s.ExtensionsV1beta1Api(self.client).create_namespaced_ingress( body=body, namespace=self.namespace ) PK!W tulips/kind/issuer.pyimport typing as t import yaml from kubernetes import client as k8s from . import Kind class Issuer(Kind): """A `cert-manager` Issuer resource.""" version = "v1alpha1" group = "certmanager.k8s.io" plural = "issuers" def __init__(self, client: k8s.ApiClient, namespace: str) -> None: self.client = client self.namespace: str = namespace def delete(self, name: t.AnyStr, body: k8s.V1DeleteOptions): return k8s.CustomObjectsApi( self.client ).delete_namespaced_custom_object( body=body, namespace=self.namespace, version=self.version, group=self.group, plural=self.plural, name=name, ) def create(self, body: yaml.YAMLObject): return k8s.CustomObjectsApi( self.client ).create_namespaced_custom_object( body=body, namespace=self.namespace, version=self.version, group=self.group, plural=self.plural, ) PK!- $tulips/kind/persistentvolumeclaim.pyimport typing as t import yaml from kubernetes import client as k8s from . import Kind class PersistentVolumeClaim(Kind): def __init__(self, client: k8s.ApiClient, namespace: str) -> None: self.client = client self.namespace: str = namespace def delete(self, name: t.AnyStr, body: k8s.V1DeleteOptions): return k8s.CoreV1Api( self.client ).delete_namespaced_persistent_volume_claim( body=body, namespace=self.namespace, name=name ) def create(self, body: yaml.YAMLObject): return k8s.CoreV1Api( self.client ).create_namespaced_persistent_volume_claim( body=body, namespace=self.namespace ) PK!g#rrtulips/kind/secret.pyimport typing as t import yaml from kubernetes import client as k8s from . import Kind class Secret(Kind): def __init__(self, client: k8s.ApiClient, namespace: str) -> None: self.client = client self.namespace: str = namespace def delete(self, name: t.AnyStr, body: k8s.V1DeleteOptions): return k8s.CoreV1Api(self.client).delete_namespaced_secret( body=body, namespace=self.namespace, name=name ) def create(self, body: yaml.YAMLObject): return k8s.CoreV1Api(self.client).create_namespaced_secret( body=body, namespace=self.namespace ) PK!3^uutulips/kind/service.pyimport typing as t import yaml from kubernetes import client as k8s from . import Kind class Service(Kind): def __init__(self, client: k8s.ApiClient, namespace: str) -> None: self.client = client self.namespace: str = namespace def delete(self, name: t.AnyStr, body: k8s.V1DeleteOptions): return k8s.CoreV1Api(self.client).delete_namespaced_service( body=body, namespace=self.namespace, name=name ) def create(self, body: yaml.YAMLObject): return k8s.CoreV1Api(self.client).create_namespaced_service( body=body, namespace=self.namespace ) PK!HƣxSTtulips-0.1.0.dist-info/WHEEL A н#J;/"d&F]xzw>@Zpy3F ]n2H%_60{8&baPa>PK!HUE-.tulips-0.1.0.dist-info/METADATASMS0W b'Z4CMZd`zmF_V @}H$+ Q9[A9ߥ (i2,GP̓12\=%*,Ƣ -ŁsV|q /\# T3nhkӅ'N|`\'TMT'KJ\⟤wpax>2FK!W@Uwm3󳔋Af.{|:|+<~sɣĉg6JZ6 / }'+-;ɰ &(OlYg- ֭;_C4RkX?+xas`ݩb mo5 K܁b 5F6uyQkt e pq)v ELHYmE!X=!jС6ﲨX>Y+υAB8t|M3O޻@r2Oqo.#.`^2p.yqki60Ҳ/BNْ!PK!H8*Htulips-0.1.0.dist-info/RECORDuɎP}] XZ0ZȆa:JuO.;e[qV a?k]hs~Fi&IOfkPfct/\):6CfЬ_ =F4 (QC/\w5\rRC .KUfM3V;7kZG9HLsA%  tulips/kind/__init__.pyPK!0VI~~\tulips/kind/deployment.pyPK!9tulips/kind/ingress.pyPK!W  tulips/kind/issuer.pyPK!- $"tulips/kind/persistentvolumeclaim.pyPK!g#rr3tulips/kind/secret.pyPK!3^uutulips/kind/service.pyPK!HƣxSTtulips-0.1.0.dist-info/WHEELPK!HUE-.tulips-0.1.0.dist-info/METADATAPK!H8*Hytulips-0.1.0.dist-info/RECORDPK