diff --git a/k8s/base.py b/k8s/base.py index ffe9bdd..a7a557a 100644 --- a/k8s/base.py +++ b/k8s/base.py @@ -193,6 +193,12 @@ def save(self): resp = self._client.put(url, self.as_dict()) self.update_from_dict(resp.json()) + def save_status(self): + """Save status to API server, always updating""" + url = self._build_url(name=self.metadata.name, namespace=self.metadata.namespace) + "/status" + resp = self._client.put(url, self.as_dict()) + self.update_from_dict(resp.json()) + @staticmethod def _label_selector(labels): """ Build a labelSelector string from a collection of key/values. The parameter can be either diff --git a/k8s/models/apiextensions_v1_custom_resource_definition.py b/k8s/models/apiextensions_v1_custom_resource_definition.py index 968999b..f1cf1da 100644 --- a/k8s/models/apiextensions_v1_custom_resource_definition.py +++ b/k8s/models/apiextensions_v1_custom_resource_definition.py @@ -77,6 +77,31 @@ class JSONSchemaProps(Model): x_kubernetes_preserve_unknown_fields = Field(bool, name="x-kubernetes-preserve-unknown-fields") +class JSONSchemaPropsStatusEnabled(Model): + ref = Field(six.text_type, name='$ref') + schema = Field(six.text_type, name='$schema') + + description = Field(six.text_type) + example = JSONField() + exclusiveMaximum = Field(bool) + exclusiveMinimum = Field(bool) + externalDocs = Field(ExternalDocumentation) + format = Field(six.text_type) + items = Field(SelfModel, alt_type=list) + maxItems = Field(int) + maxLength = Field(int) + maximum = Field(int, alt_type=float) + minItems = Field(int) + minLength = Field(int) + minimum = Field(int, alt_type=float) + multipleOf = Field(int, alt_type=float) + pattern = Field(six.text_type) + properties = Field(dict) + required = ListField(six.text_type) + title = Field(six.text_type) + type = Field(six.text_type) + + class ServiceReference(Model): name = Field(six.text_type) namespace = Field(six.text_type) @@ -122,6 +147,10 @@ class CustomResourceValidation(Model): openAPIV3Schema = Field(JSONSchemaProps) +class CustomResourceValidationStatusEnabled(Model): + openAPIV3Schema = Field(JSONSchemaPropsStatusEnabled) + + class CustomResourceSubresourceScale(Model): labelSelectorPath = Field(six.text_type) specReplicasPath = Field(six.text_type)