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.1.dist-info/WHEEL A н#J;/"d&F]xzw>@Zpy3F ]n2H%_60{8&baPa>PK!HtZ`-Jtulips-0.1.1.dist-info/METADATATkoG>Va1I(uq (QeYeNWaB~},`ؕO;;s{f(bi^}5 &%]w'GEϦIk|y@o` E RI21&ֈVSS102i^VGf՚ȒL`x&Nw{](< G7I\4eqH 8 p>ÉsRAȅKZK eb>W/_p{2|ڙhEô=f\eHMX= sqƽΰS .#k"Ϸ;۸{UeF˟.HRU0SjG=J|4".{4e="  f[߈CS>G>ֵ,k({DS^FC%z# QŞ X"5FXxqRJ0 ',0Q0\ԤϙT>K%&'^{ 667 {ir-ir\FO+Y4nxzB zr_A[{`_sz%Yq;T2`f!MBY-[-vdUiV^:{(ڥ5 ,@kچతa&#CswF1)la#<`ĞbpRBG;$ d|;ӭ߿m7WPK!HHtulips-0.1.1.dist-info/RECORDuK@}b\El*l"ES I':?y3 ȯ,C-[(r>qo–Ju;ӥCn'M 6{ym+]P[U@.cNH/8/vrjG_QGN@v9+` ϻ!?Խh7Ov?6*$QJzQ[ {?!3Q A.>4&d%N'J_!#0{8iDIz Lb) =pyHVE Ͽh "c 7愮Ox(mGo*7A(_lAVL) ى/mTk6)* %p?XC>i}VG|ݪ.ppnJL_*nhоh}\MĿb0>M+UsMlbO[`*He*-%"#Pt%Pđ/nYV.C$SzD X'3SPK!l rtulips/__init__.pyPK!>%  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.1.dist-info/WHEELPK!HtZ`-Jtulips-0.1.1.dist-info/METADATAPK!HHxtulips-0.1.1.dist-info/RECORDPK