From 675769a73a2c694ab033ff49cf7271e741926efe Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Wed, 9 Oct 2019 03:52:16 -0700 Subject: [PATCH] Add probe and BackupBatch api (#890) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add Prebackup & PostBackup hooks to BackupConfiguration … - Add BackupBatch type Signed-off-by: Tamal Saha --- Makefile | 1 + .../stash.appscode.com_backupbatches.yaml | 3791 +++++++++++++++++ .../stash.appscode.com_backupblueprints.yaml | 2 + ...ash.appscode.com_backupconfigurations.yaml | 172 + .../stash.appscode.com_backupsessions.yaml | 21 +- .../stash.appscode.com_restoresessions.yaml | 2 + api/openapi-spec/swagger.json | 973 ++++- apis/stash/v1beta1/backup_batch_helpers.go | 69 + apis/stash/v1beta1/backup_batch_types.go | 67 + apis/stash/v1beta1/backup_blueprint_types.go | 2 +- .../v1beta1/backup_configuration_types.go | 65 +- apis/stash/v1beta1/backup_session_types.go | 10 +- apis/stash/v1beta1/function_types.go | 4 +- apis/stash/v1beta1/openapi_generated.go | 372 +- apis/stash/v1beta1/register.go | 18 +- apis/stash/v1beta1/restore_session_types.go | 6 +- apis/stash/v1beta1/types.go | 13 +- apis/stash/v1beta1/zz_generated.deepcopy.go | 211 +- .../typed/stash/v1beta1/backupbatch.go | 174 + .../stash/v1beta1/fake/fake_backupbatch.go | 128 + .../stash/v1beta1/fake/fake_stash_client.go | 4 + .../stash/v1beta1/generated_expansion.go | 2 + .../typed/stash/v1beta1/stash_client.go | 5 + client/informers/externalversions/generic.go | 2 + .../stash/v1beta1/backupbatch.go | 89 + .../stash/v1beta1/interface.go | 7 + client/listers/stash/v1beta1/backupbatch.go | 94 + .../stash/v1beta1/expansion_generated.go | 8 + hack/gencrd/main.go | 2 + 29 files changed, 6205 insertions(+), 109 deletions(-) create mode 100644 api/crds/stash.appscode.com_backupbatches.yaml create mode 100644 apis/stash/v1beta1/backup_batch_helpers.go create mode 100644 apis/stash/v1beta1/backup_batch_types.go create mode 100644 client/clientset/versioned/typed/stash/v1beta1/backupbatch.go create mode 100644 client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupbatch.go create mode 100644 client/informers/externalversions/stash/v1beta1/backupbatch.go create mode 100644 client/listers/stash/v1beta1/backupbatch.go diff --git a/Makefile b/Makefile index f33db79d9..ca081ac49 100644 --- a/Makefile +++ b/Makefile @@ -221,6 +221,7 @@ gen-crds: $(CRD_OPTIONS) \ paths="./apis/..." \ output:crd:artifacts:config=api/crds + @rm -rf api/crds/stash.appscode.com_backupconfigurationtemplates.yaml .PHONY: label-crds label-crds: $(BUILD_DIRS) diff --git a/api/crds/stash.appscode.com_backupbatches.yaml b/api/crds/stash.appscode.com_backupbatches.yaml new file mode 100644 index 000000000..bead739f8 --- /dev/null +++ b/api/crds/stash.appscode.com_backupbatches.yaml @@ -0,0 +1,3791 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + app: stash + name: backupbatches.stash.appscode.com +spec: + additionalPrinterColumns: + - JSONPath: .spec.schedule + name: Schedule + type: string + - JSONPath: .spec.paused + name: Paused + type: boolean + - JSONPath: .metadata.creationTimestamp + name: Age + type: date + group: stash.appscode.com + names: + categories: + - stash + - appscode + - all + kind: BackupBatch + plural: backupbatches + singular: backupbatch + scope: Namespaced + subresources: {} + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + description: ObjectMeta is metadata that all persisted resources must have, + which includes all objects users must create. + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map stored with + a resource that may be set by external tools to store and retrieve + arbitrary metadata. They are not queryable and should be preserved + when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + clusterName: + description: The name of the cluster which the object belongs to. This + is used to distinguish resources with same name and namespace in different + clusters. This field is not set anywhere right now and apiserver is + going to ignore it if set in create or update request. + type: string + creationTimestamp: + description: "CreationTimestamp is a timestamp representing the server + time when this object was created. It is not guaranteed to be set + in happens-before order across separate operations. Clients may not + set this value. It is represented in RFC3339 form and is in UTC. \n + Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object to gracefully + terminate before it will be removed from the system. Only set when + deletionTimestamp is also set. May only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and time at which this + resource will be deleted. This field is set by the server when a graceful + deletion is requested by the user, and is not directly settable by + a client. The resource is expected to be deleted (no longer visible + from resource lists, and not reachable by name) after the time in + this field, once the finalizers list is empty. As long as the finalizers + list contains items, deletion is blocked. Once the deletionTimestamp + is set, this value may not be unset or be set further into the future, + although it may be shortened or the resource may be deleted prior + to this time. For example, a user may request that a pod is deleted + in 30 seconds. The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, the Kubelet + will send a hard termination signal (SIGKILL) to the container and + after cleanup, remove the pod from the API. In the presence of network + partitions, this object may still exist after this timestamp, until + an administrator or automated process can determine the resource is + fully terminated. If not set, graceful deletion of the object has + not been requested. \n Populated by the system when a graceful deletion + is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + finalizers: + description: Must be empty before the object is deleted from the registry. + Each entry is an identifier for the responsible component that will + remove the entry from the list. If the deletionTimestamp of the object + is non-nil, entries in this list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, used by the server, + to generate a unique name ONLY IF the Name field has not been provided. + If this field is used, the name returned to the client will be different + than the name passed. This value will also be combined with a unique + suffix. The provided value has the same validation rules as the Name + field, and may be truncated by the length of the suffix required to + make the value unique on the server. \n If this field is specified + and the generated name exists, the server will NOT return a 409 - + instead, it will either return 201 Created or 500 with Reason ServerTimeout + indicating a unique name could not be found in the time allotted, + and the client should retry (optionally after the time indicated in + the Retry-After header). \n Applied only if Name is not specified. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + generation: + description: A sequence number representing a specific generation of + the desired state. Populated by the system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which enforces some system + invariant at object creation time. This field is a list of initializers + that have not yet acted on this object. If nil or empty, this object + has been completely initialized. Otherwise, the object is considered + uninitialized and is hidden (in list/watch and get calls) from clients + that haven't explicitly asked to observe uninitialized objects. \n + When an object is created, the system will populate this list with + the current set of initializers. Only privileged users may set or + modify this list. Once it is empty, it may not be modified further + by any user. \n DEPRECATED - initializers are an alpha field and will + be removed in v1.15." + properties: + pending: + description: Pending is a list of initializers that must execute + in order before this object is visible. When the last pending + initializer is removed, and no failing result is set, the initializers + struct will be set to nil and the object is considered as initialized + and visible to all clients. + items: + description: Initializer is information about an initializer that + has not yet completed. + properties: + name: + description: name of the process that is responsible for initializing + this object. + type: string + required: + - name + type: object + type: array + result: + description: If result is set with the Failure field, the object + will be persisted to storage and then deleted, ensuring that other + clients can observe the deletion. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this + representation of an object. Servers should convert recognized + schemas to the latest internal value, and may reject unrecognized + values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + code: + description: Suggested HTTP return code for this status, 0 if + not set. + format: int32 + type: integer + details: + description: Extended data associated with the reason. Each + reason may define its own extended details. This field is + optional and the data returned is not guaranteed to conform + to any schema except that defined by the reason type. + properties: + causes: + description: The Causes array includes more details associated + with the StatusReason failure. Not all StatusReasons may + provide detailed causes. + items: + description: StatusCause provides more information about + an api.Status failure, including cases when multiple + errors are encountered. + properties: + field: + description: "The field of the resource that has caused + this error, as named by its JSON serialization. + May include dot and postfix notation for nested + attributes. Arrays are zero-indexed. Fields may + appear more than once in an array of causes due + to fields having multiple errors. Optional. \n Examples: + \ \"name\" - the field \"name\" on the current + resource \"items[0].name\" - the field \"name\" + on the first array entry in \"items\"" + type: string + message: + description: A human-readable description of the cause + of the error. This field may be presented as-is + to a reader. + type: string + reason: + description: A machine-readable description of the + cause of the error. If this value is empty there + is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the resource associated + with the status StatusReason. + type: string + kind: + description: 'The kind attribute of the resource associated + with the status StatusReason. On some operations may differ + from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: The name attribute of the resource associated + with the status StatusReason (when there is a single name + which can be described). + type: string + retryAfterSeconds: + description: If specified, the time in seconds before the + operation should be retried. Some errors may indicate + the client must take an alternate action - for those errors + this field may indicate how long to wait before taking + the alternate action. + format: int32 + type: integer + uid: + description: 'UID of the resource. (when there is a single + resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + type: object + kind: + description: 'Kind is a string value representing the REST resource + this object represents. Servers may infer this from the endpoint + the client submits requests to. Cannot be updated. In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description of the status of this + operation. + type: string + metadata: + description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the user set a limit + on the number of items returned, and indicates that the + server has more data available. The value is opaque and + may be used to issue another request to the endpoint that + served this list to retrieve the next set of available + objects. Continuing a consistent list may not be possible + if the server configuration has changed or more than a + few minutes have passed. The resourceVersion field returned + when using this continue value will be identical to the + value in the first response, unless you have received + this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the server''s internal + version of this object that can be used by clients to + determine when objects have changed. Value must be treated + as opaque by clients and passed unmodified back to the + server. Populated by the system. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing this object. + Populated by the system. Read-only. + type: string + type: object + reason: + description: A machine-readable description of why this operation + is in the "Failure" status. If this value is empty there is + no information available. A Reason clarifies an HTTP status + code but does not override it. + type: string + status: + description: 'Status of the operation. One of: "Success" or + "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: string + type: object + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used to organize + and categorize (scope and select) objects. May match selectors of + replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + managedFields: + description: "ManagedFields maps workflow-id and version to the set + of fields that are managed by that workflow. This is mostly for internal + housekeeping, and users typically shouldn't need to set or understand + this field. A workflow can be the user's name, a controller's name, + or the name of a specific apply path like \"ci-cd\". The set of fields + is always in the version that the workflow used when modifying the + object. \n This field is alpha and can be changed or removed without + notice." + items: + description: ManagedFieldsEntry is a workflow-id, a FieldSet and the + group version of the resource that the fieldset applies to. + properties: + apiVersion: + description: APIVersion defines the version of this resource that + this field set applies to. The format is "group/version" just + like the top-level APIVersion field. It is necessary to track + the version of a field set because it cannot be automatically + converted. + type: string + fields: + additionalProperties: true + description: Fields identifies a set of fields. + type: object + manager: + description: Manager is an identifier of the workflow managing + these fields. + type: string + operation: + description: Operation is the type of operation which lead to + this ManagedFieldsEntry being created. The only valid values + for this field are 'Apply' and 'Update'. + type: string + time: + description: Time is timestamp of when these fields were set. + It should always be empty if Operation is 'Apply' + format: date-time + type: string + type: object + type: array + name: + description: 'Name must be unique within a namespace. Is required when + creating resources, although some resources may allow a client to + request the generation of an appropriate name automatically. Name + is primarily intended for creation idempotence and configuration definition. + Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name must be unique. + An empty namespace is equivalent to the \"default\" namespace, but + \"default\" is the canonical representation. Not all objects are required + to be scoped to a namespace - the value of this field for those objects + will be empty. \n Must be a DNS_LABEL. Cannot be updated. More info: + http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL objects + in the list have been deleted, this object will be garbage collected. + If this object is managed by a controller, then an entry in this list + will point to this controller, with the controller field set to true. + There cannot be more than one managing controller. + items: + description: OwnerReference contains enough information to let you + identify an owning object. An owning object must be in the same + namespace as the dependent, or be cluster-scoped, so there is no + namespace field. + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the key-value + store until this reference is removed. Defaults to false. To + set this field, a user needs "delete" permission of the owner, + otherwise 422 (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + type: array + resourceVersion: + description: "An opaque value that represents the internal version of + this object that can be used by clients to determine when objects + have changed. May be used for optimistic concurrency, change detection, + and the watch operation on a resource or set of resources. Clients + must treat these values as opaque and passed unmodified back to the + server. They may only be valid for a particular resource or set of + resources. \n Populated by the system. Read-only. Value must be treated + as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: SelfLink is a URL representing this object. Populated by + the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space value for this object. + It is typically generated by the server on successful creation of + a resource and is not allowed to change on PUT operations. \n Populated + by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids" + type: string + type: object + spec: + properties: + backupConfigurationTemplates: + description: backupConfigurationTemplates is a list of backup configurations + that are part of this batch + items: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this + representation of an object. Servers should convert recognized + schemas to the latest internal value, and may reject unrecognized + values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource + this object represents. Servers may infer this from the endpoint + the client submits requests to. Cannot be updated. In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + description: ObjectMeta is metadata that all persisted resources + must have, which includes all objects users must create. + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map + stored with a resource that may be set by external tools + to store and retrieve arbitrary metadata. They are not queryable + and should be preserved when modifying objects. More info: + http://kubernetes.io/docs/user-guide/annotations' + type: object + clusterName: + description: The name of the cluster which the object belongs + to. This is used to distinguish resources with same name + and namespace in different clusters. This field is not set + anywhere right now and apiserver is going to ignore it if + set in create or update request. + type: string + creationTimestamp: + description: "CreationTimestamp is a timestamp representing + the server time when this object was created. It is not + guaranteed to be set in happens-before order across separate + operations. Clients may not set this value. It is represented + in RFC3339 form and is in UTC. \n Populated by the system. + Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object to + gracefully terminate before it will be removed from the + system. Only set when deletionTimestamp is also set. May + only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and time + at which this resource will be deleted. This field is set + by the server when a graceful deletion is requested by the + user, and is not directly settable by a client. The resource + is expected to be deleted (no longer visible from resource + lists, and not reachable by name) after the time in this + field, once the finalizers list is empty. As long as the + finalizers list contains items, deletion is blocked. Once + the deletionTimestamp is set, this value may not be unset + or be set further into the future, although it may be shortened + or the resource may be deleted prior to this time. For example, + a user may request that a pod is deleted in 30 seconds. + The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that 30 seconds, + the Kubelet will send a hard termination signal (SIGKILL) + to the container and after cleanup, remove the pod from + the API. In the presence of network partitions, this object + may still exist after this timestamp, until an administrator + or automated process can determine the resource is fully + terminated. If not set, graceful deletion of the object + has not been requested. \n Populated by the system when + a graceful deletion is requested. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + finalizers: + description: Must be empty before the object is deleted from + the registry. Each entry is an identifier for the responsible + component that will remove the entry from the list. If the + deletionTimestamp of the object is non-nil, entries in this + list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, used by + the server, to generate a unique name ONLY IF the Name field + has not been provided. If this field is used, the name returned + to the client will be different than the name passed. This + value will also be combined with a unique suffix. The provided + value has the same validation rules as the Name field, and + may be truncated by the length of the suffix required to + make the value unique on the server. \n If this field is + specified and the generated name exists, the server will + NOT return a 409 - instead, it will either return 201 Created + or 500 with Reason ServerTimeout indicating a unique name + could not be found in the time allotted, and the client + should retry (optionally after the time indicated in the + Retry-After header). \n Applied only if Name is not specified. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + generation: + description: A sequence number representing a specific generation + of the desired state. Populated by the system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which enforces + some system invariant at object creation time. This field + is a list of initializers that have not yet acted on this + object. If nil or empty, this object has been completely + initialized. Otherwise, the object is considered uninitialized + and is hidden (in list/watch and get calls) from clients + that haven't explicitly asked to observe uninitialized objects. + \n When an object is created, the system will populate this + list with the current set of initializers. Only privileged + users may set or modify this list. Once it is empty, it + may not be modified further by any user. \n DEPRECATED - + initializers are an alpha field and will be removed in v1.15." + properties: + pending: + description: Pending is a list of initializers that must + execute in order before this object is visible. When + the last pending initializer is removed, and no failing + result is set, the initializers struct will be set to + nil and the object is considered as initialized and + visible to all clients. + items: + description: Initializer is information about an initializer + that has not yet completed. + properties: + name: + description: name of the process that is responsible + for initializing this object. + type: string + required: + - name + type: object + type: array + result: + description: If result is set with the Failure field, + the object will be persisted to storage and then deleted, + ensuring that other clients can observe the deletion. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema + of this representation of an object. Servers should + convert recognized schemas to the latest internal + value, and may reject unrecognized values. More + info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + code: + description: Suggested HTTP return code for this status, + 0 if not set. + format: int32 + type: integer + details: + description: Extended data associated with the reason. Each + reason may define its own extended details. This + field is optional and the data returned is not guaranteed + to conform to any schema except that defined by + the reason type. + properties: + causes: + description: The Causes array includes more details + associated with the StatusReason failure. Not + all StatusReasons may provide detailed causes. + items: + description: StatusCause provides more information + about an api.Status failure, including cases + when multiple errors are encountered. + properties: + field: + description: "The field of the resource + that has caused this error, as named by + its JSON serialization. May include dot + and postfix notation for nested attributes. + Arrays are zero-indexed. Fields may appear + more than once in an array of causes due + to fields having multiple errors. Optional. + \n Examples: \"name\" - the field \"name\" + on the current resource \"items[0].name\" + - the field \"name\" on the first array + entry in \"items\"" + type: string + message: + description: A human-readable description + of the cause of the error. This field + may be presented as-is to a reader. + type: string + reason: + description: A machine-readable description + of the cause of the error. If this value + is empty there is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the resource + associated with the status StatusReason. + type: string + kind: + description: 'The kind attribute of the resource + associated with the status StatusReason. On + some operations may differ from the requested + resource Kind. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: The name attribute of the resource + associated with the status StatusReason (when + there is a single name which can be described). + type: string + retryAfterSeconds: + description: If specified, the time in seconds + before the operation should be retried. Some + errors may indicate the client must take an + alternate action - for those errors this field + may indicate how long to wait before taking + the alternate action. + format: int32 + type: integer + uid: + description: 'UID of the resource. (when there + is a single resource which can be described). + More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + type: object + kind: + description: 'Kind is a string value representing + the REST resource this object represents. Servers + may infer this from the endpoint the client submits + requests to. Cannot be updated. In CamelCase. More + info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description of the status + of this operation. + type: string + metadata: + description: 'Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the user set + a limit on the number of items returned, and + indicates that the server has more data available. + The value is opaque and may be used to issue + another request to the endpoint that served + this list to retrieve the next set of available + objects. Continuing a consistent list may not + be possible if the server configuration has + changed or more than a few minutes have passed. + The resourceVersion field returned when using + this continue value will be identical to the + value in the first response, unless you have + received this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the server''s + internal version of this object that can be + used by clients to determine when objects have + changed. Value must be treated as opaque by + clients and passed unmodified back to the server. + Populated by the system. Read-only. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing this + object. Populated by the system. Read-only. + type: string + type: object + reason: + description: A machine-readable description of why + this operation is in the "Failure" status. If this + value is empty there is no information available. + A Reason clarifies an HTTP status code but does + not override it. + type: string + status: + description: 'Status of the operation. One of: "Success" + or "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: string + type: object + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used + to organize and categorize (scope and select) objects. May + match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + managedFields: + description: "ManagedFields maps workflow-id and version to + the set of fields that are managed by that workflow. This + is mostly for internal housekeeping, and users typically + shouldn't need to set or understand this field. A workflow + can be the user's name, a controller's name, or the name + of a specific apply path like \"ci-cd\". The set of fields + is always in the version that the workflow used when modifying + the object. \n This field is alpha and can be changed or + removed without notice." + items: + description: ManagedFieldsEntry is a workflow-id, a FieldSet + and the group version of the resource that the fieldset + applies to. + properties: + apiVersion: + description: APIVersion defines the version of this + resource that this field set applies to. The format + is "group/version" just like the top-level APIVersion + field. It is necessary to track the version of a field + set because it cannot be automatically converted. + type: string + fields: + additionalProperties: true + description: Fields identifies a set of fields. + type: object + manager: + description: Manager is an identifier of the workflow + managing these fields. + type: string + operation: + description: Operation is the type of operation which + lead to this ManagedFieldsEntry being created. The + only valid values for this field are 'Apply' and 'Update'. + type: string + time: + description: Time is timestamp of when these fields + were set. It should always be empty if Operation is + 'Apply' + format: date-time + type: string + type: object + type: array + name: + description: 'Name must be unique within a namespace. Is required + when creating resources, although some resources may allow + a client to request the generation of an appropriate name + automatically. Name is primarily intended for creation idempotence + and configuration definition. Cannot be updated. More info: + http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each name + must be unique. An empty namespace is equivalent to the + \"default\" namespace, but \"default\" is the canonical + representation. Not all objects are required to be scoped + to a namespace - the value of this field for those objects + will be empty. \n Must be a DNS_LABEL. Cannot be updated. + More info: http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. If ALL + objects in the list have been deleted, this object will + be garbage collected. If this object is managed by a controller, + then an entry in this list will point to this controller, + with the controller field set to true. There cannot be more + than one managing controller. + items: + description: OwnerReference contains enough information + to let you identify an owning object. An owning object + must be in the same namespace as the dependent, or be + cluster-scoped, so there is no namespace field. + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the "foregroundDeletion" + finalizer, then the owner cannot be deleted from the + key-value store until this reference is removed. Defaults + to false. To set this field, a user needs "delete" + permission of the owner, otherwise 422 (Unprocessable + Entity) will be returned. + type: boolean + controller: + description: If true, this reference points to the managing + controller. + type: boolean + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + type: array + resourceVersion: + description: "An opaque value that represents the internal + version of this object that can be used by clients to determine + when objects have changed. May be used for optimistic concurrency, + change detection, and the watch operation on a resource + or set of resources. Clients must treat these values as + opaque and passed unmodified back to the server. They may + only be valid for a particular resource or set of resources. + \n Populated by the system. Read-only. Value must be treated + as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: SelfLink is a URL representing this object. Populated + by the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space value for + this object. It is typically generated by the server on + successful creation of a resource and is not allowed to + change on PUT operations. \n Populated by the system. Read-only. + More info: http://kubernetes.io/docs/user-guide/identifiers#uids" + type: string + type: object + spec: + properties: + hooks: + description: Actions that Stash should take in response to + backup sessions. Cannot be updated. + properties: + postBackup: + description: PostBackup is called immediately after a + backup session is complete. + properties: + exec: + description: One and only one of the following should + be specified. Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute + inside the container, the working directory + for the command is root ('/') in the container's + filesystem. The command is simply exec'd, it + is not run inside a shell, so traditional shell + instructions ('|', etc) won't work. To use a + shell, you need to explicitly call out to that + shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http request to + perform. + properties: + host: + description: Host name to connect to, defaults + to the pod IP. You probably want to set "Host" + in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: string + - type: integer + description: Name or number of the port to access + on the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + scheme: + description: Scheme to use for connecting to the + host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: implement + a realistic TCP lifecycle hook' + properties: + host: + description: 'Optional: Host name to connect to, + defaults to the pod IP.' + type: string + port: + anyOf: + - type: string + - type: integer + description: Number or name of the port to access + on the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + required: + - port + type: object + type: object + preBackup: + description: PreBackup is called immediately before a + backup session is initiated. + properties: + exec: + description: One and only one of the following should + be specified. Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute + inside the container, the working directory + for the command is root ('/') in the container's + filesystem. The command is simply exec'd, it + is not run inside a shell, so traditional shell + instructions ('|', etc) won't work. To use a + shell, you need to explicitly call out to that + shell. Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http request to + perform. + properties: + host: + description: Host name to connect to, defaults + to the pod IP. You probably want to set "Host" + in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. + HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom header + to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: string + - type: integer + description: Name or number of the port to access + on the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + scheme: + description: Scheme to use for connecting to the + host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: implement + a realistic TCP lifecycle hook' + properties: + host: + description: 'Optional: Host name to connect to, + defaults to the pod IP.' + type: string + port: + anyOf: + - type: string + - type: integer + description: Number or name of the port to access + on the container. Number must be in the range + 1 to 65535. Name must be an IANA_SVC_NAME. + required: + - port + type: object + type: object + type: object + interimVolumeTemplate: + description: InterimVolumeTemplate specifies a template for + a volume to hold targeted data temporarily before uploading + to backend or inserting into target. It is only usable for + job model. Don't specify it in sidecar model. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema + of this representation of an object. Servers should + convert recognized schemas to the latest internal value, + and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the + REST resource this object represents. Servers may infer + this from the endpoint the client submits requests to. + Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + description: 'Standard object''s metadata. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata' + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value + map stored with a resource that may be set by external + tools to store and retrieve arbitrary metadata. + They are not queryable and should be preserved when + modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + clusterName: + description: The name of the cluster which the object + belongs to. This is used to distinguish resources + with same name and namespace in different clusters. + This field is not set anywhere right now and apiserver + is going to ignore it if set in create or update + request. + type: string + creationTimestamp: + description: "CreationTimestamp is a timestamp representing + the server time when this object was created. It + is not guaranteed to be set in happens-before order + across separate operations. Clients may not set + this value. It is represented in RFC3339 form and + is in UTC. \n Populated by the system. Read-only. + Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + deletionGracePeriodSeconds: + description: Number of seconds allowed for this object + to gracefully terminate before it will be removed + from the system. Only set when deletionTimestamp + is also set. May only be shortened. Read-only. + format: int64 + type: integer + deletionTimestamp: + description: "DeletionTimestamp is RFC 3339 date and + time at which this resource will be deleted. This + field is set by the server when a graceful deletion + is requested by the user, and is not directly settable + by a client. The resource is expected to be deleted + (no longer visible from resource lists, and not + reachable by name) after the time in this field, + once the finalizers list is empty. As long as the + finalizers list contains items, deletion is blocked. + Once the deletionTimestamp is set, this value may + not be unset or be set further into the future, + although it may be shortened or the resource may + be deleted prior to this time. For example, a user + may request that a pod is deleted in 30 seconds. + The Kubelet will react by sending a graceful termination + signal to the containers in the pod. After that + 30 seconds, the Kubelet will send a hard termination + signal (SIGKILL) to the container and after cleanup, + remove the pod from the API. In the presence of + network partitions, this object may still exist + after this timestamp, until an administrator or + automated process can determine the resource is + fully terminated. If not set, graceful deletion + of the object has not been requested. \n Populated + by the system when a graceful deletion is requested. + Read-only. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" + format: date-time + type: string + finalizers: + description: Must be empty before the object is deleted + from the registry. Each entry is an identifier for + the responsible component that will remove the entry + from the list. If the deletionTimestamp of the object + is non-nil, entries in this list can only be removed. + items: + type: string + type: array + generateName: + description: "GenerateName is an optional prefix, + used by the server, to generate a unique name ONLY + IF the Name field has not been provided. If this + field is used, the name returned to the client will + be different than the name passed. This value will + also be combined with a unique suffix. The provided + value has the same validation rules as the Name + field, and may be truncated by the length of the + suffix required to make the value unique on the + server. \n If this field is specified and the generated + name exists, the server will NOT return a 409 - + instead, it will either return 201 Created or 500 + with Reason ServerTimeout indicating a unique name + could not be found in the time allotted, and the + client should retry (optionally after the time indicated + in the Retry-After header). \n Applied only if Name + is not specified. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency" + type: string + generation: + description: A sequence number representing a specific + generation of the desired state. Populated by the + system. Read-only. + format: int64 + type: integer + initializers: + description: "An initializer is a controller which + enforces some system invariant at object creation + time. This field is a list of initializers that + have not yet acted on this object. If nil or empty, + this object has been completely initialized. Otherwise, + the object is considered uninitialized and is hidden + (in list/watch and get calls) from clients that + haven't explicitly asked to observe uninitialized + objects. \n When an object is created, the system + will populate this list with the current set of + initializers. Only privileged users may set or modify + this list. Once it is empty, it may not be modified + further by any user. \n DEPRECATED - initializers + are an alpha field and will be removed in v1.15." + properties: + pending: + description: Pending is a list of initializers + that must execute in order before this object + is visible. When the last pending initializer + is removed, and no failing result is set, the + initializers struct will be set to nil and the + object is considered as initialized and visible + to all clients. + items: + description: Initializer is information about + an initializer that has not yet completed. + properties: + name: + description: name of the process that is + responsible for initializing this object. + type: string + required: + - name + type: object + type: array + result: + description: If result is set with the Failure + field, the object will be persisted to storage + and then deleted, ensuring that other clients + can observe the deletion. + properties: + apiVersion: + description: 'APIVersion defines the versioned + schema of this representation of an object. + Servers should convert recognized schemas + to the latest internal value, and may reject + unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + code: + description: Suggested HTTP return code for + this status, 0 if not set. + format: int32 + type: integer + details: + description: Extended data associated with + the reason. Each reason may define its + own extended details. This field is optional + and the data returned is not guaranteed + to conform to any schema except that defined + by the reason type. + properties: + causes: + description: The Causes array includes + more details associated with the StatusReason + failure. Not all StatusReasons may provide + detailed causes. + items: + description: StatusCause provides more + information about an api.Status failure, + including cases when multiple errors + are encountered. + properties: + field: + description: "The field of the resource + that has caused this error, as + named by its JSON serialization. + May include dot and postfix notation + for nested attributes. Arrays + are zero-indexed. Fields may + appear more than once in an array + of causes due to fields having + multiple errors. Optional. \n + Examples: \"name\" - the field + \"name\" on the current resource + \ \"items[0].name\" - the field + \"name\" on the first array entry + in \"items\"" + type: string + message: + description: A human-readable description + of the cause of the error. This + field may be presented as-is to + a reader. + type: string + reason: + description: A machine-readable + description of the cause of the + error. If this value is empty + there is no information available. + type: string + type: object + type: array + group: + description: The group attribute of the + resource associated with the status + StatusReason. + type: string + kind: + description: 'The kind attribute of the + resource associated with the status + StatusReason. On some operations may + differ from the requested resource Kind. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: The name attribute of the + resource associated with the status + StatusReason (when there is a single + name which can be described). + type: string + retryAfterSeconds: + description: If specified, the time in + seconds before the operation should + be retried. Some errors may indicate + the client must take an alternate action + - for those errors this field may indicate + how long to wait before taking the alternate + action. + format: int32 + type: integer + uid: + description: 'UID of the resource. (when + there is a single resource which can + be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + type: object + kind: + description: 'Kind is a string value representing + the REST resource this object represents. + Servers may infer this from the endpoint + the client submits requests to. Cannot be + updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + message: + description: A human-readable description + of the status of this operation. + type: string + metadata: + description: 'Standard list metadata. More + info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + properties: + continue: + description: continue may be set if the + user set a limit on the number of items + returned, and indicates that the server + has more data available. The value is + opaque and may be used to issue another + request to the endpoint that served + this list to retrieve the next set of + available objects. Continuing a consistent + list may not be possible if the server + configuration has changed or more than + a few minutes have passed. The resourceVersion + field returned when using this continue + value will be identical to the value + in the first response, unless you have + received this token from an error message. + type: string + resourceVersion: + description: 'String that identifies the + server''s internal version of this object + that can be used by clients to determine + when objects have changed. Value must + be treated as opaque by clients and + passed unmodified back to the server. + Populated by the system. Read-only. + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency' + type: string + selfLink: + description: selfLink is a URL representing + this object. Populated by the system. + Read-only. + type: string + type: object + reason: + description: A machine-readable description + of why this operation is in the "Failure" + status. If this value is empty there is + no information available. A Reason clarifies + an HTTP status code but does not override + it. + type: string + status: + description: 'Status of the operation. One + of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status' + type: string + type: object + required: + - pending + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can + be used to organize and categorize (scope and select) + objects. May match selectors of replication controllers + and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + managedFields: + description: "ManagedFields maps workflow-id and version + to the set of fields that are managed by that workflow. + This is mostly for internal housekeeping, and users + typically shouldn't need to set or understand this + field. A workflow can be the user's name, a controller's + name, or the name of a specific apply path like + \"ci-cd\". The set of fields is always in the version + that the workflow used when modifying the object. + \n This field is alpha and can be changed or removed + without notice." + items: + description: ManagedFieldsEntry is a workflow-id, + a FieldSet and the group version of the resource + that the fieldset applies to. + properties: + apiVersion: + description: APIVersion defines the version + of this resource that this field set applies + to. The format is "group/version" just like + the top-level APIVersion field. It is necessary + to track the version of a field set because + it cannot be automatically converted. + type: string + fields: + additionalProperties: true + description: Fields identifies a set of fields. + type: object + manager: + description: Manager is an identifier of the + workflow managing these fields. + type: string + operation: + description: Operation is the type of operation + which lead to this ManagedFieldsEntry being + created. The only valid values for this field + are 'Apply' and 'Update'. + type: string + time: + description: Time is timestamp of when these + fields were set. It should always be empty + if Operation is 'Apply' + format: date-time + type: string + type: object + type: array + name: + description: 'Name must be unique within a namespace. + Is required when creating resources, although some + resources may allow a client to request the generation + of an appropriate name automatically. Name is primarily + intended for creation idempotence and configuration + definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + namespace: + description: "Namespace defines the space within each + name must be unique. An empty namespace is equivalent + to the \"default\" namespace, but \"default\" is + the canonical representation. Not all objects are + required to be scoped to a namespace - the value + of this field for those objects will be empty. \n + Must be a DNS_LABEL. Cannot be updated. More info: + http://kubernetes.io/docs/user-guide/namespaces" + type: string + ownerReferences: + description: List of objects depended by this object. + If ALL objects in the list have been deleted, this + object will be garbage collected. If this object + is managed by a controller, then an entry in this + list will point to this controller, with the controller + field set to true. There cannot be more than one + managing controller. + items: + description: OwnerReference contains enough information + to let you identify an owning object. An owning + object must be in the same namespace as the dependent, + or be cluster-scoped, so there is no namespace + field. + properties: + apiVersion: + description: API version of the referent. + type: string + blockOwnerDeletion: + description: If true, AND if the owner has the + "foregroundDeletion" finalizer, then the owner + cannot be deleted from the key-value store + until this reference is removed. Defaults + to false. To set this field, a user needs + "delete" permission of the owner, otherwise + 422 (Unprocessable Entity) will be returned. + type: boolean + controller: + description: If true, this reference points + to the managing controller. + type: boolean + kind: + description: 'Kind of the referent. More info: + https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: + http://kubernetes.io/docs/user-guide/identifiers#names' + type: string + uid: + description: 'UID of the referent. More info: + http://kubernetes.io/docs/user-guide/identifiers#uids' + type: string + required: + - apiVersion + - kind + - name + - uid + type: object + type: array + resourceVersion: + description: "An opaque value that represents the + internal version of this object that can be used + by clients to determine when objects have changed. + May be used for optimistic concurrency, change detection, + and the watch operation on a resource or set of + resources. Clients must treat these values as opaque + and passed unmodified back to the server. They may + only be valid for a particular resource or set of + resources. \n Populated by the system. Read-only. + Value must be treated as opaque by clients and . + More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: SelfLink is a URL representing this object. + Populated by the system. Read-only. + type: string + uid: + description: "UID is the unique in time and space + value for this object. It is typically generated + by the server on successful creation of a resource + and is not allowed to change on PUT operations. + \n Populated by the system. Read-only. More info: + http://kubernetes.io/docs/user-guide/identifiers#uids" + type: string + type: object + spec: + description: 'Spec defines the desired characteristics + of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + properties: + accessModes: + description: 'AccessModes contains the desired access + modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + items: + type: string + type: array + dataSource: + description: This field requires the VolumeSnapshotDataSource + alpha feature gate to be enabled and currently VolumeSnapshot + is the only supported data source. If the provisioner + can support VolumeSnapshot data source, it will + create a new volume and data will be restored to + the volume at the same time. If the provisioner + does not support VolumeSnapshot data source, volume + will not be created and the failure will be reported + as an event. In the future, we plan to support more + data source types and the behavior of the provisioner + may change. + properties: + apiGroup: + description: APIGroup is the group for the resource + being referenced. If APIGroup is not specified, + the specified Kind must be in the core API group. + For any other third-party types, APIGroup is + required. + type: string + kind: + description: Kind is the type of resource being + referenced + type: string + name: + description: Name is the name of resource being + referenced + type: string + required: + - kind + - name + type: object + resources: + description: 'Resources represents the minimum resources + the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + properties: + limits: + additionalProperties: + type: string + description: 'Limits describes the maximum amount + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + type: string + description: 'Requests describes the minimum amount + of compute resources required. If Requests is + omitted for a container, it defaults to Limits + if that is explicitly specified, otherwise to + an implementation-defined value. More info: + https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + selector: + description: A label query over volumes to consider + for binding. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement is + a selector that contains values, a key, and + an operator that relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If + the operator is Exists or DoesNotExist, + the values array must be empty. This array + is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". + The requirements are ANDed. + type: object + type: object + storageClassName: + description: 'Name of the StorageClass required by + the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + type: string + volumeMode: + description: volumeMode defines what type of volume + is required by the claim. Value of Filesystem is + implied when not included in claim spec. This is + a beta feature. + type: string + volumeName: + description: VolumeName is the binding reference to + the PersistentVolume backing this claim. + type: string + type: object + status: + description: 'Status represents the current information/status + of a persistent volume claim. Read-only. More info: + https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + properties: + accessModes: + description: 'AccessModes contains the actual access + modes the volume backing the PVC has. More info: + https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + items: + type: string + type: array + capacity: + additionalProperties: + type: string + description: Represents the actual resources of the + underlying volume. + type: object + conditions: + description: Current Condition of persistent volume + claim. If underlying persistent volume is being + resized then the Condition will be set to 'ResizeStarted'. + items: + description: PersistentVolumeClaimCondition contails + details about state of pvc + properties: + lastProbeTime: + description: Last time we probed the condition. + format: date-time + type: string + lastTransitionTime: + description: Last time the condition transitioned + from one status to another. + format: date-time + type: string + message: + description: Human-readable message indicating + details about last transition. + type: string + reason: + description: Unique, this should be a short, + machine understandable string that gives the + reason for condition's last transition. If + it reports "ResizeStarted" that means the + underlying persistent volume is being resized. + type: string + status: + type: string + type: + description: PersistentVolumeClaimConditionType + is a valid value of PersistentVolumeClaimCondition.Type + type: string + required: + - status + - type + type: object + type: array + phase: + description: Phase represents the current phase of + PersistentVolumeClaim. + type: string + type: object + type: object + runtimeSettings: + description: RuntimeSettings allow to specify Resources, NodeSelector, + Affinity, Toleration, ReadinessProbe etc. + properties: + container: + properties: + env: + description: List of environment variables to set + in the container. Cannot be updated. + items: + description: EnvVar represents an environment variable + present in a Container. + properties: + name: + description: Name of the environment variable. + Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) + are expanded using the previous defined environment + variables in the container and any service + environment variables. If a variable cannot + be resolved, the reference in the input string + will be unchanged. The $(VAR_NAME) syntax + can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, + regardless of whether the variable exists + or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or it's key must be defined + type: boolean + required: + - key + type: object + fieldRef: + description: 'Selects a field of the pod: + supports metadata.name, metadata.namespace, + metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, + status.hostIP, status.podIP.' + properties: + apiVersion: + description: Version of the schema the + FieldPath is written in terms of, + defaults to "v1". + type: string + fieldPath: + description: Path of the field to select + in the specified API version. + type: string + required: + - fieldPath + type: object + resourceFieldRef: + description: 'Selects a resource of the + container: only resources limits and requests + (limits.cpu, limits.memory, limits.ephemeral-storage, + requests.cpu, requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required + for volumes, optional for env vars' + type: string + divisor: + description: Specifies the output format + of the exposed resources, defaults + to "1" + type: string + resource: + description: 'Required: resource to + select' + type: string + required: + - resource + type: object + secretKeyRef: + description: Selects a key of a secret in + the pod's namespace + properties: + key: + description: The key of the secret to + select from. Must be a valid secret + key. + type: string + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or it's key must be defined + type: boolean + required: + - key + type: object + type: object + required: + - name + type: object + type: array + envFrom: + description: List of sources to populate environment + variables in the container. The keys defined within + a source must be a C_IDENTIFIER. All invalid keys + will be reported as an event when the container + is starting. When a key exists in multiple sources, + the value associated with the last source will take + precedence. Values defined by an Env with a duplicate + key will take precedence. Cannot be updated. + items: + description: EnvFromSource represents the source + of a set of ConfigMaps + properties: + configMapRef: + description: The ConfigMap to select from + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + must be defined + type: boolean + type: object + prefix: + description: An optional identifier to prepend + to each key in the ConfigMap. Must be a C_IDENTIFIER. + type: string + secretRef: + description: The Secret to select from + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + must be defined + type: boolean + type: object + type: object + type: array + ionice: + description: 'Settings to configure `ionice` to throttle + the load on disk. More info: http://kennystechtalk.blogspot.com/2015/04/throttling-cpu-usage-with-linux-cgroups.html + More info: https://oakbytes.wordpress.com/2012/06/06/linux-scheduler-cfs-and-nice/' + properties: + class: + format: int32 + type: integer + classData: + format: int32 + type: integer + type: object + lifecycle: + description: Actions that the management system should + take in response to container lifecycle events. + Cannot be updated. + properties: + postStart: + description: 'PostStart is called immediately + after a container is created. If the handler + fails, the container is terminated and restarted + according to its restart policy. Other management + of the container blocks until the hook completes. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the + action to take. + properties: + command: + description: Command is the command line + to execute inside the container, the + working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it is + not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to explicitly + call out to that shell. Exit status + of 0 is treated as live/healthy and + non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http request + to perform. + properties: + host: + description: Host name to connect to, + defaults to the pod IP. You probably + want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in + the request. HTTP allows repeated headers. + items: + description: HTTPHeader describes a + custom header to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: string + - type: integer + description: Name or number of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet + supported TODO: implement a realistic TCP + lifecycle hook' + properties: + host: + description: 'Optional: Host name to connect + to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: string + - type: integer + description: Number or name of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + required: + - port + type: object + type: object + preStop: + description: 'PreStop is called immediately before + a container is terminated due to an API request + or management event such as liveness probe failure, + preemption, resource contention, etc. The handler + is not called if the container crashes or exits. + The reason for termination is passed to the + handler. The Pod''s termination grace period + countdown begins before the PreStop hooked is + executed. Regardless of the outcome of the handler, + the container will eventually terminate within + the Pod''s termination grace period. Other management + of the container blocks until the hook completes + or until the termination grace period is reached. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the + action to take. + properties: + command: + description: Command is the command line + to execute inside the container, the + working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it is + not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to explicitly + call out to that shell. Exit status + of 0 is treated as live/healthy and + non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http request + to perform. + properties: + host: + description: Host name to connect to, + defaults to the pod IP. You probably + want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in + the request. HTTP allows repeated headers. + items: + description: HTTPHeader describes a + custom header to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: string + - type: integer + description: Name or number of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet + supported TODO: implement a realistic TCP + lifecycle hook' + properties: + host: + description: 'Optional: Host name to connect + to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: string + - type: integer + description: Number or name of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + required: + - port + type: object + type: object + type: object + livenessProbe: + description: 'Periodic probe of container liveness. + Container will be restarted if the probe fails. + Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the action + to take. + properties: + command: + description: Command is the command line to + execute inside the container, the working + directory for the command is root ('/') + in the container's filesystem. The command + is simply exec'd, it is not run inside a + shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for + the probe to be considered failed after having + succeeded. Defaults to 3. Minimum value is 1. + format: int32 + type: integer + httpGet: + description: HTTPGet specifies the http request + to perform. + properties: + host: + description: Host name to connect to, defaults + to the pod IP. You probably want to set + "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the + request. HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom + header to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: string + - type: integer + description: Name or number of the port to + access on the container. Number must be + in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container + has started before liveness probes are initiated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform + the probe. Default to 10 seconds. Minimum value + is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for + the probe to be considered successful after + having failed. Defaults to 1. Must be 1 for + liveness. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' + properties: + host: + description: 'Optional: Host name to connect + to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: string + - type: integer + description: Number or name of the port to + access on the container. Number must be + in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + required: + - port + type: object + timeoutSeconds: + description: 'Number of seconds after which the + probe times out. Defaults to 1 second. Minimum + value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + nice: + description: 'Settings to configure `nice` to throttle + the load on cpu. More info: http://kennystechtalk.blogspot.com/2015/04/throttling-cpu-usage-with-linux-cgroups.html + More info: https://oakbytes.wordpress.com/2012/06/06/linux-scheduler-cfs-and-nice/' + properties: + adjustment: + format: int32 + type: integer + type: object + readinessProbe: + description: 'Periodic probe of container service + readiness. Container will be removed from service + endpoints if the probe fails. Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the action + to take. + properties: + command: + description: Command is the command line to + execute inside the container, the working + directory for the command is root ('/') + in the container's filesystem. The command + is simply exec'd, it is not run inside a + shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, you + need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for + the probe to be considered failed after having + succeeded. Defaults to 3. Minimum value is 1. + format: int32 + type: integer + httpGet: + description: HTTPGet specifies the http request + to perform. + properties: + host: + description: Host name to connect to, defaults + to the pod IP. You probably want to set + "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the + request. HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom + header to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: string + - type: integer + description: Name or number of the port to + access on the container. Number must be + in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container + has started before liveness probes are initiated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform + the probe. Default to 10 seconds. Minimum value + is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for + the probe to be considered successful after + having failed. Defaults to 1. Must be 1 for + liveness. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: 'TCPSocket specifies an action involving + a TCP port. TCP hooks not yet supported TODO: + implement a realistic TCP lifecycle hook' + properties: + host: + description: 'Optional: Host name to connect + to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: string + - type: integer + description: Number or name of the port to + access on the container. Number must be + in the range 1 to 65535. Name must be an + IANA_SVC_NAME. + required: + - port + type: object + timeoutSeconds: + description: 'Number of seconds after which the + probe times out. Defaults to 1 second. Minimum + value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + resources: + description: 'Compute Resources required by container. + Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + properties: + limits: + additionalProperties: + type: string + description: 'Limits describes the maximum amount + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + type: string + description: 'Requests describes the minimum amount + of compute resources required. If Requests is + omitted for a container, it defaults to Limits + if that is explicitly specified, otherwise to + an implementation-defined value. More info: + https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + securityContext: + description: 'Security options the pod should run + with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + properties: + allowPrivilegeEscalation: + description: 'AllowPrivilegeEscalation controls + whether a process can gain more privileges than + its parent process. This bool directly controls + if the no_new_privs flag will be set on the + container process. AllowPrivilegeEscalation + is true always when the container is: 1) run + as Privileged 2) has CAP_SYS_ADMIN' + type: boolean + capabilities: + description: The capabilities to add/drop when + running containers. Defaults to the default + set of capabilities granted by the container + runtime. + properties: + add: + description: Added capabilities + items: + description: Capability represent POSIX + capabilities type + type: string + type: array + drop: + description: Removed capabilities + items: + description: Capability represent POSIX + capabilities type + type: string + type: array + type: object + privileged: + description: Run container in privileged mode. + Processes in privileged containers are essentially + equivalent to root on the host. Defaults to + false. + type: boolean + procMount: + description: procMount denotes the type of proc + mount to use for the containers. The default + is DefaultProcMount which uses the container + runtime defaults for readonly paths and masked + paths. This requires the ProcMountType feature + flag to be enabled. + type: string + readOnlyRootFilesystem: + description: Whether this container has a read-only + root filesystem. Default is false. + type: boolean + runAsGroup: + description: The GID to run the entrypoint of + the container process. Uses runtime default + if unset. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + format: int64 + type: integer + runAsNonRoot: + description: Indicates that the container must + run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure + that it does not run as UID 0 (root) and fail + to start the container if it does. If unset + or false, no such validation will be performed. + May also be set in PodSecurityContext. If set + in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of + the container process. Defaults to user specified + in image metadata if unspecified. May also be + set in PodSecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified + in SecurityContext takes precedence. + format: int64 + type: integer + seLinuxOptions: + description: The SELinux context to be applied + to the container. If unspecified, the container + runtime will allocate a random SELinux context + for each container. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + properties: + level: + description: Level is SELinux level label + that applies to the container. + type: string + role: + description: Role is a SELinux role label + that applies to the container. + type: string + type: + description: Type is a SELinux type label + that applies to the container. + type: string + user: + description: User is a SELinux user label + that applies to the container. + type: string + type: object + type: object + type: object + pod: + properties: + affinity: + description: If specified, the pod's scheduling constraints + properties: + nodeAffinity: + description: Describes node affinity scheduling + rules for the pod. + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to + schedule pods to nodes that satisfy the + affinity expressions specified by this field, + but it may choose a node that violates one + or more of the expressions. The node that + is most preferred is the one with the greatest + sum of weights, i.e. for each node that + meets all of the scheduling requirements + (resource request, requiredDuringScheduling + affinity expressions, etc.), compute a sum + by iterating through the elements of this + field and adding "weight" to the sum if + the node matches the corresponding matchExpressions; + the node(s) with the highest sum are the + most preferred. + items: + description: An empty preferred scheduling + term matches all objects with implicit + weight 0 (i.e. it's a no-op). A null preferred + scheduling term matches no objects (i.e. + is also a no-op). + properties: + preference: + description: A node selector term, associated + with the corresponding weight. + properties: + matchExpressions: + description: A list of node selector + requirements by node's labels. + items: + description: A node selector requirement + is a selector that contains + values, a key, and an operator + that relates the key and values. + properties: + key: + description: The label key + that the selector applies + to. + type: string + operator: + description: Represents a + key's relationship to a + set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: An array of string + values. If the operator + is In or NotIn, the values + array must be non-empty. + If the operator is Exists + or DoesNotExist, the values + array must be empty. If + the operator is Gt or Lt, + the values array must have + a single element, which + will be interpreted as an + integer. This array is replaced + during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector + requirements by node's fields. + items: + description: A node selector requirement + is a selector that contains + values, a key, and an operator + that relates the key and values. + properties: + key: + description: The label key + that the selector applies + to. + type: string + operator: + description: Represents a + key's relationship to a + set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: An array of string + values. If the operator + is In or NotIn, the values + array must be non-empty. + If the operator is Exists + or DoesNotExist, the values + array must be empty. If + the operator is Gt or Lt, + the values array must have + a single element, which + will be interpreted as an + integer. This array is replaced + during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + weight: + description: Weight associated with + matching the corresponding nodeSelectorTerm, + in the range 1-100. + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements + specified by this field are not met at scheduling + time, the pod will not be scheduled onto + the node. If the affinity requirements specified + by this field cease to be met at some point + during pod execution (e.g. due to an update), + the system may or may not try to eventually + evict the pod from its node. + properties: + nodeSelectorTerms: + description: Required. A list of node + selector terms. The terms are ORed. + items: + description: A null or empty node selector + term matches no objects. The requirements + of them are ANDed. The TopologySelectorTerm + type implements a subset of the NodeSelectorTerm. + properties: + matchExpressions: + description: A list of node selector + requirements by node's labels. + items: + description: A node selector requirement + is a selector that contains + values, a key, and an operator + that relates the key and values. + properties: + key: + description: The label key + that the selector applies + to. + type: string + operator: + description: Represents a + key's relationship to a + set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: An array of string + values. If the operator + is In or NotIn, the values + array must be non-empty. + If the operator is Exists + or DoesNotExist, the values + array must be empty. If + the operator is Gt or Lt, + the values array must have + a single element, which + will be interpreted as an + integer. This array is replaced + during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector + requirements by node's fields. + items: + description: A node selector requirement + is a selector that contains + values, a key, and an operator + that relates the key and values. + properties: + key: + description: The label key + that the selector applies + to. + type: string + operator: + description: Represents a + key's relationship to a + set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. + type: string + values: + description: An array of string + values. If the operator + is In or NotIn, the values + array must be non-empty. + If the operator is Exists + or DoesNotExist, the values + array must be empty. If + the operator is Gt or Lt, + the values array must have + a single element, which + will be interpreted as an + integer. This array is replaced + during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + type: array + required: + - nodeSelectorTerms + type: object + type: object + podAffinity: + description: Describes pod affinity scheduling + rules (e.g. co-locate this pod in the same node, + zone, etc. as some other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to + schedule pods to nodes that satisfy the + affinity expressions specified by this field, + but it may choose a node that violates one + or more of the expressions. The node that + is most preferred is the one with the greatest + sum of weights, i.e. for each node that + meets all of the scheduling requirements + (resource request, requiredDuringScheduling + affinity expressions, etc.), compute a sum + by iterating through the elements of this + field and adding "weight" to the sum if + the node has pods which matches the corresponding + podAffinityTerm; the node(s) with the highest + sum are the most preferred. + items: + description: The weights of all of the matched + WeightedPodAffinityTerm fields are added + per-node to find the most preferred node(s) + properties: + podAffinityTerm: + description: Required. A pod affinity + term, associated with the corresponding + weight. + properties: + labelSelector: + description: A label query over + a set of resources, in this case + pods. + properties: + matchExpressions: + description: matchExpressions + is a list of label selector + requirements. The requirements + are ANDed. + items: + description: A label selector + requirement is a selector + that contains values, a + key, and an operator that + relates the key and values. + properties: + key: + description: key is the + label key that the selector + applies to. + type: string + operator: + description: operator + represents a key's relationship + to a set of values. + Valid operators are + In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is + an array of string values. + If the operator is In + or NotIn, the values + array must be non-empty. + If the operator is Exists + or DoesNotExist, the + values array must be + empty. This array is + replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is + a map of {key,value} pairs. + A single {key,value} in the + matchLabels map is equivalent + to an element of matchExpressions, + whose key field is "key", + the operator is "In", and + the values array contains + only "value". The requirements + are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies + which namespaces the labelSelector + applies to (matches against); + null or empty list means "this + pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be + co-located (affinity) or not co-located + (anti-affinity) with the pods + matching the labelSelector in + the specified namespaces, where + co-located is defined as running + on a node whose value of the label + with key topologyKey matches that + of any node on which any of the + selected pods is running. Empty + topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + weight: + description: weight associated with + matching the corresponding podAffinityTerm, + in the range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements + specified by this field are not met at scheduling + time, the pod will not be scheduled onto + the node. If the affinity requirements specified + by this field cease to be met at some point + during pod execution (e.g. due to a pod + label update), the system may or may not + try to eventually evict the pod from its + node. When there are multiple elements, + the lists of nodes corresponding to each + podAffinityTerm are intersected, i.e. all + terms must be satisfied. + items: + description: Defines a set of pods (namely + those matching the labelSelector relative + to the given namespace(s)) that this pod + should be co-located (affinity) or not + co-located (anti-affinity) with, where + co-located is defined as running on a + node whose value of the label with key + matches that of any node + on which a pod of the set of pods is running + properties: + labelSelector: + description: A label query over a set + of resources, in this case pods. + properties: + matchExpressions: + description: matchExpressions is + a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector + requirement is a selector that + contains values, a key, and + an operator that relates the + key and values. + properties: + key: + description: key is the label + key that the selector applies + to. + type: string + operator: + description: operator represents + a key's relationship to + a set of values. Valid operators + are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an + array of string values. + If the operator is In or + NotIn, the values array + must be non-empty. If the + operator is Exists or DoesNotExist, + the values array must be + empty. This array is replaced + during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map + of {key,value} pairs. A single + {key,value} in the matchLabels + map is equivalent to an element + of matchExpressions, whose key + field is "key", the operator is + "In", and the values array contains + only "value". The requirements + are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies which + namespaces the labelSelector applies + to (matches against); null or empty + list means "this pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located + (affinity) or not co-located (anti-affinity) + with the pods matching the labelSelector + in the specified namespaces, where + co-located is defined as running on + a node whose value of the label with + key topologyKey matches that of any + node on which any of the selected + pods is running. Empty topologyKey + is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + podAntiAffinity: + description: Describes pod anti-affinity scheduling + rules (e.g. avoid putting this pod in the same + node, zone, etc. as some other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to + schedule pods to nodes that satisfy the + anti-affinity expressions specified by this + field, but it may choose a node that violates + one or more of the expressions. The node + that is most preferred is the one with the + greatest sum of weights, i.e. for each node + that meets all of the scheduling requirements + (resource request, requiredDuringScheduling + anti-affinity expressions, etc.), compute + a sum by iterating through the elements + of this field and adding "weight" to the + sum if the node has pods which matches the + corresponding podAffinityTerm; the node(s) + with the highest sum are the most preferred. + items: + description: The weights of all of the matched + WeightedPodAffinityTerm fields are added + per-node to find the most preferred node(s) + properties: + podAffinityTerm: + description: Required. A pod affinity + term, associated with the corresponding + weight. + properties: + labelSelector: + description: A label query over + a set of resources, in this case + pods. + properties: + matchExpressions: + description: matchExpressions + is a list of label selector + requirements. The requirements + are ANDed. + items: + description: A label selector + requirement is a selector + that contains values, a + key, and an operator that + relates the key and values. + properties: + key: + description: key is the + label key that the selector + applies to. + type: string + operator: + description: operator + represents a key's relationship + to a set of values. + Valid operators are + In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is + an array of string values. + If the operator is In + or NotIn, the values + array must be non-empty. + If the operator is Exists + or DoesNotExist, the + values array must be + empty. This array is + replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is + a map of {key,value} pairs. + A single {key,value} in the + matchLabels map is equivalent + to an element of matchExpressions, + whose key field is "key", + the operator is "In", and + the values array contains + only "value". The requirements + are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies + which namespaces the labelSelector + applies to (matches against); + null or empty list means "this + pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be + co-located (affinity) or not co-located + (anti-affinity) with the pods + matching the labelSelector in + the specified namespaces, where + co-located is defined as running + on a node whose value of the label + with key topologyKey matches that + of any node on which any of the + selected pods is running. Empty + topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + weight: + description: weight associated with + matching the corresponding podAffinityTerm, + in the range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the anti-affinity requirements + specified by this field are not met at scheduling + time, the pod will not be scheduled onto + the node. If the anti-affinity requirements + specified by this field cease to be met + at some point during pod execution (e.g. + due to a pod label update), the system may + or may not try to eventually evict the pod + from its node. When there are multiple elements, + the lists of nodes corresponding to each + podAffinityTerm are intersected, i.e. all + terms must be satisfied. + items: + description: Defines a set of pods (namely + those matching the labelSelector relative + to the given namespace(s)) that this pod + should be co-located (affinity) or not + co-located (anti-affinity) with, where + co-located is defined as running on a + node whose value of the label with key + matches that of any node + on which a pod of the set of pods is running + properties: + labelSelector: + description: A label query over a set + of resources, in this case pods. + properties: + matchExpressions: + description: matchExpressions is + a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector + requirement is a selector that + contains values, a key, and + an operator that relates the + key and values. + properties: + key: + description: key is the label + key that the selector applies + to. + type: string + operator: + description: operator represents + a key's relationship to + a set of values. Valid operators + are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an + array of string values. + If the operator is In or + NotIn, the values array + must be non-empty. If the + operator is Exists or DoesNotExist, + the values array must be + empty. This array is replaced + during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map + of {key,value} pairs. A single + {key,value} in the matchLabels + map is equivalent to an element + of matchExpressions, whose key + field is "key", the operator is + "In", and the values array contains + only "value". The requirements + are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies which + namespaces the labelSelector applies + to (matches against); null or empty + list means "this pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located + (affinity) or not co-located (anti-affinity) + with the pods matching the labelSelector + in the specified namespaces, where + co-located is defined as running on + a node whose value of the label with + key topologyKey matches that of any + node on which any of the selected + pods is running. Empty topologyKey + is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + type: object + automountServiceAccountToken: + description: AutomountServiceAccountToken indicates + whether a service account token should be automatically + mounted. + type: boolean + enableServiceLinks: + description: 'EnableServiceLinks indicates whether + information about services should be injected into + pod''s environment variables, matching the syntax + of Docker links. Optional: Defaults to true.' + type: boolean + imagePullSecrets: + description: 'ImagePullSecrets is an optional list + of references to secrets in the same namespace to + use for pulling any of the images used by this PodRuntimeSettings. + If specified, these secrets will be passed to individual + puller implementations for them to use. For example, + in the case of docker, only DockerConfig type secrets + are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' + items: + description: LocalObjectReference contains enough + information to let you locate the referenced object + inside the same namespace. + properties: + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + type: array + nodeName: + description: NodeName is a request to schedule this + pod onto a specific node. If it is non-empty, the + scheduler simply schedules this pod onto that node, + assuming that it fits resource requirements. + type: string + nodeSelector: + additionalProperties: + type: string + description: 'NodeSelector is a selector which must + be true for the pod to fit on a node. Selector which + must match a node''s labels for the pod to be scheduled + on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' + type: object + priority: + description: The priority value. Various system components + use this field to find the priority of the pod. + When Priority Admission Controller is enabled, it + prevents users from setting this field. The admission + controller populates this field from PriorityClassName. + The higher the value, the higher the priority. + format: int32 + type: integer + priorityClassName: + description: If specified, indicates the pod's priority. + "system-node-critical" and "system-cluster-critical" + are two special keywords which indicate the highest + priorities with the former being the highest priority. + Any other name must be defined by creating a PriorityClass + object with that name. If not specified, the pod + priority will be default or zero if there is no + default. + type: string + readinessGates: + description: 'If specified, all readiness gates will + be evaluated for pod readiness. A pod is ready when + all its containers are ready AND all conditions + specified in the readiness gates have status equal + to "True" More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md' + items: + description: PodReadinessGate contains the reference + to a pod condition + properties: + conditionType: + description: ConditionType refers to a condition + in the pod's condition list with matching + type. + type: string + required: + - conditionType + type: object + type: array + runtimeClassName: + description: 'RuntimeClassName refers to a RuntimeClass + object in the node.k8s.io group, which should be + used to run this pod. If no RuntimeClass resource + matches the named class, the pod will not be run. + If unset or empty, the "legacy" RuntimeClass will + be used, which is an implicit class with an empty + definition that uses the default runtime handler. + More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md + This is an alpha feature and may change in the future.' + type: string + schedulerName: + description: If specified, the pod will be dispatched + by specified scheduler. If not specified, the pod + will be dispatched by default scheduler. + type: string + securityContext: + description: 'Security options the pod should run + with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + properties: + fsGroup: + description: "A special supplemental group that + applies to all containers in a pod. Some volume + types allow the Kubelet to change the ownership + of that volume to be owned by the pod: \n 1. + The owning GID will be the FSGroup 2. The setgid + bit is set (new files created in the volume + will be owned by FSGroup) 3. The permission + bits are OR'd with rw-rw---- \n If unset, the + Kubelet will not modify the ownership and permissions + of any volume." + format: int64 + type: integer + runAsGroup: + description: The GID to run the entrypoint of + the container process. Uses runtime default + if unset. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence for that container. + format: int64 + type: integer + runAsNonRoot: + description: Indicates that the container must + run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure + that it does not run as UID 0 (root) and fail + to start the container if it does. If unset + or false, no such validation will be performed. + May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of + the container process. Defaults to user specified + in image metadata if unspecified. May also be + set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified + in SecurityContext takes precedence for that + container. + format: int64 + type: integer + seLinuxOptions: + description: The SELinux context to be applied + to all containers. If unspecified, the container + runtime will allocate a random SELinux context + for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence for that container. + properties: + level: + description: Level is SELinux level label + that applies to the container. + type: string + role: + description: Role is a SELinux role label + that applies to the container. + type: string + type: + description: Type is a SELinux type label + that applies to the container. + type: string + user: + description: User is a SELinux user label + that applies to the container. + type: string + type: object + supplementalGroups: + description: A list of groups applied to the first + process run in each container, in addition to + the container's primary GID. If unspecified, + no groups will be added to any container. + items: + format: int64 + type: integer + type: array + sysctls: + description: Sysctls hold a list of namespaced + sysctls used for the pod. Pods with unsupported + sysctls (by the container runtime) might fail + to launch. + items: + description: Sysctl defines a kernel parameter + to be set + properties: + name: + description: Name of a property to set + type: string + value: + description: Value of a property to set + type: string + required: + - name + - value + type: object + type: array + type: object + serviceAccountName: + description: 'ServiceAccountName is the name of the + ServiceAccount to use to run this pod. More info: + https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/' + type: string + tolerations: + description: If specified, the pod's tolerations. + items: + description: The pod this Toleration is attached + to tolerates any taint that matches the triple + using the matching operator + . + properties: + effect: + description: Effect indicates the taint effect + to match. Empty means match all taint effects. + When specified, allowed values are NoSchedule, + PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration + applies to. Empty means match all taint keys. + If the key is empty, operator must be Exists; + this combination means to match all values + and all keys. + type: string + operator: + description: Operator represents a key's relationship + to the value. Valid operators are Exists and + Equal. Defaults to Equal. Exists is equivalent + to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the + period of time the toleration (which must + be of effect NoExecute, otherwise this field + is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint + forever (do not evict). Zero and negative + values will be treated as 0 (evict immediately) + by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration + matches to. If the operator is Exists, the + value should be empty, otherwise just a regular + string. + type: string + type: object + type: array + type: object + type: object + target: + description: Target specify the backup target + properties: + paths: + description: Paths specify the file paths to backup + items: + type: string + type: array + ref: + description: Ref refers to the backup target + properties: + apiVersion: + type: string + kind: + type: string + name: + type: string + type: object + replicas: + description: replicas are the desired number of replicas + whose data should be backed up. If unspecified, defaults + to 1. + format: int32 + type: integer + snapshotClassName: + description: Name of the VolumeSnapshotClass used by the + VolumeSnapshot. If not specified, a default snapshot + class will be used if it is available. Use this field + only if the "driver" field is set to "volumeSnapshotter". + type: string + volumeMounts: + description: VolumeMounts specifies the volumes to mount + inside stash sidecar/init container Specify the volumes + that contains the target directories + items: + description: VolumeMount describes a mounting of a Volume + within a container. + properties: + mountPath: + description: Path within the container at which + the volume should be mounted. Must not contain + ':'. + type: string + mountPropagation: + description: mountPropagation determines how mounts + are propagated from the host to container and + the other way around. When not set, MountPropagationNone + is used. This field is beta in 1.10. + type: string + name: + description: This must match the Name of a Volume. + type: string + readOnly: + description: Mounted read-only if true, read-write + otherwise (false or unspecified). Defaults to + false. + type: boolean + subPath: + description: Path within the volume from which the + container's volume should be mounted. Defaults + to "" (volume's root). + type: string + subPathExpr: + description: Expanded path within the volume from + which the container's volume should be mounted. + Behaves similarly to SubPath but environment variable + references $(VAR_NAME) are expanded using the + container's environment. Defaults to "" (volume's + root). SubPathExpr and SubPath are mutually exclusive. + This field is alpha in 1.14. + type: string + required: + - mountPath + - name + type: object + type: array + type: object + task: + description: Task specify the Task crd that specifies the + steps to take backup + properties: + name: + type: string + params: + items: + description: Param declares a value to use for the Param + called Name. + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + required: + - name + type: object + tempDir: + description: Temp directory configuration for functions/sidecar + An `EmptyDir` will always be mounted at /tmp with this settings + properties: + disableCaching: + description: 'More info: https://github.com/restic/restic/blob/master/doc/manual_rest.rst#caching' + type: boolean + medium: + description: StorageMedium defines ways that storage can + be allocated to a volume. + type: string + sizeLimit: + type: string + type: object + type: object + type: object + type: array + backupHistoryLimit: + description: 'BackupHistoryLimit specifies the number of BackupSession + and it''s associate resources to keep. This is helpful for debugging + purpose. Default: 1' + format: int32 + type: integer + driver: + description: Driver indicates the name of the agent to use to backup + the target. Supported values are "Restic", "VolumeSnapshotter". Default + value is "Restic". + type: string + hooks: + description: Actions that Stash should take in response to backup sessions. + Cannot be updated. + properties: + postBackup: + description: PostBackup is called immediately after a backup session + is complete. + properties: + exec: + description: One and only one of the following should be specified. + Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: HTTPHeader describes a custom header to be + used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: string + - type: integer + description: Name or number of the port to access on the + container. Number must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + scheme: + description: Scheme to use for connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: 'TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported TODO: implement a realistic + TCP lifecycle hook' + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: string + - type: integer + description: Number or name of the port to access on the + container. Number must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + required: + - port + type: object + type: object + preBackup: + description: PreBackup is called immediately before a backup session + is initiated. + properties: + exec: + description: One and only one of the following should be specified. + Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: HTTPHeader describes a custom header to be + used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: string + - type: integer + description: Name or number of the port to access on the + container. Number must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + scheme: + description: Scheme to use for connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: 'TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported TODO: implement a realistic + TCP lifecycle hook' + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: string + - type: integer + description: Number or name of the port to access on the + container. Number must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + required: + - port + type: object + type: object + type: object + paused: + description: Indicates that the BackupConfiguration is paused from taking + backup. Default value is 'false' + type: boolean + repository: + description: Repository refer to the Repository crd that holds backend + information + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + type: object + retentionPolicy: + description: RetentionPolicy indicates the policy to follow to clean + old backup snapshots + properties: + dryRun: + type: boolean + keepDaily: + type: integer + keepHourly: + type: integer + keepLast: + type: integer + keepMonthly: + type: integer + keepTags: + items: + type: string + type: array + keepWeekly: + type: integer + keepYearly: + type: integer + name: + type: string + prune: + type: boolean + required: + - name + - prune + type: object + schedule: + description: Schedule specifies the schedule for invoking backup sessions + type: string + required: + - retentionPolicy + type: object + type: object + versions: + - name: v1beta1 + served: true + storage: true diff --git a/api/crds/stash.appscode.com_backupblueprints.yaml b/api/crds/stash.appscode.com_backupblueprints.yaml index 9b480b621..8ade31e43 100644 --- a/api/crds/stash.appscode.com_backupblueprints.yaml +++ b/api/crds/stash.appscode.com_backupblueprints.yaml @@ -3883,6 +3883,8 @@ spec: - value type: object type: array + required: + - name type: object tempDir: description: Temp directory configuration for functions/sidecar An `EmptyDir` diff --git a/api/crds/stash.appscode.com_backupconfigurations.yaml b/api/crds/stash.appscode.com_backupconfigurations.yaml index 428539975..d348e1a5f 100644 --- a/api/crds/stash.appscode.com_backupconfigurations.yaml +++ b/api/crds/stash.appscode.com_backupconfigurations.yaml @@ -429,6 +429,175 @@ spec: the target. Supported values are "Restic", "VolumeSnapshotter". Default value is "Restic". type: string + hooks: + description: Actions that Stash should take in response to backup sessions. + Cannot be updated. + properties: + postBackup: + description: PostBackup is called immediately after a backup session + is complete. + properties: + exec: + description: One and only one of the following should be specified. + Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: HTTPHeader describes a custom header to be + used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: string + - type: integer + description: Name or number of the port to access on the + container. Number must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + scheme: + description: Scheme to use for connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: 'TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported TODO: implement a realistic + TCP lifecycle hook' + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: string + - type: integer + description: Number or name of the port to access on the + container. Number must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + required: + - port + type: object + type: object + preBackup: + description: PreBackup is called immediately before a backup session + is initiated. + properties: + exec: + description: One and only one of the following should be specified. + Exec specifies the action to take. + properties: + command: + description: Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit status + of 0 is treated as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: Host name to connect to, defaults to the pod + IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: HTTPHeader describes a custom header to be + used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: string + - type: integer + description: Name or number of the port to access on the + container. Number must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + scheme: + description: Scheme to use for connecting to the host. Defaults + to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: 'TCPSocket specifies an action involving a TCP + port. TCP hooks not yet supported TODO: implement a realistic + TCP lifecycle hook' + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: string + - type: integer + description: Number or name of the port to access on the + container. Number must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + required: + - port + type: object + type: object + type: object interimVolumeTemplate: description: InterimVolumeTemplate specifies a template for a volume to hold targeted data temporarily before uploading to backend or inserting @@ -2640,6 +2809,7 @@ spec: type: object type: object schedule: + description: Schedule specifies the schedule for invoking backup sessions type: string target: description: Target specify the backup target @@ -2733,6 +2903,8 @@ spec: - value type: object type: array + required: + - name type: object tempDir: description: Temp directory configuration for functions/sidecar An `EmptyDir` diff --git a/api/crds/stash.appscode.com_backupsessions.yaml b/api/crds/stash.appscode.com_backupsessions.yaml index 22ad11498..621656529 100644 --- a/api/crds/stash.appscode.com_backupsessions.yaml +++ b/api/crds/stash.appscode.com_backupsessions.yaml @@ -415,14 +415,31 @@ spec: spec: properties: backupConfiguration: - description: BackupConfiguration indicates the target BackupConfiguration - crd + description: 'BackupConfiguration indicates the target BackupConfiguration + crd Deprecated: Use Invoker' properties: name: description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' type: string type: object + invoker: + description: Invoker refers to the BackupConfiguration or BackupBatch + being used to invoke this backup session + properties: + apiGroup: + description: APIGroup is the group for the resource being referenced + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + required: + - kind + - name + type: object type: object status: properties: diff --git a/api/crds/stash.appscode.com_restoresessions.yaml b/api/crds/stash.appscode.com_restoresessions.yaml index 28946ad90..f903429be 100644 --- a/api/crds/stash.appscode.com_restoresessions.yaml +++ b/api/crds/stash.appscode.com_restoresessions.yaml @@ -3332,6 +3332,8 @@ spec: - value type: object type: array + required: + - name type: object tempDir: description: Temp directory configuration for functions/sidecar An `EmptyDir` diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index c905ec370..e2e7aad2c 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -3272,6 +3272,506 @@ } } }, + "/apis/stash.appscode.com/v1beta1/backupbatch": { + "get": { + "description": "list or watch objects of kind BackupBatch", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf", + "application/json;stream=watch", + "application/vnd.kubernetes.protobuf;stream=watch" + ], + "schemes": [ + "https" + ], + "tags": [ + "stashAppscodeCom_v1beta1" + ], + "operationId": "listStashAppscodeComV1beta1BackupBatch", + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", + "name": "continue", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "name": "fieldSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "name": "labelSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", + "name": "limit", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", + "name": "resourceVersion", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", + "name": "timeoutSeconds", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "name": "watch", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatchList" + } + } + }, + "x-kubernetes-action": "list", + "x-kubernetes-group-version-kind": { + "group": "stash.appscode.com", + "version": "v1beta1", + "kind": "BackupBatch" + } + }, + "post": { + "description": "create a BackupBatch", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "stashAppscodeCom_v1beta1" + ], + "operationId": "createStashAppscodeComV1beta1BackupBatch", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatch" + } + }, + { + "uniqueItems": true, + "type": "string", + "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + "name": "dryRun", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", + "name": "fieldManager", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatch" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatch" + } + }, + "202": { + "description": "Accepted", + "schema": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatch" + } + } + }, + "x-kubernetes-action": "post", + "x-kubernetes-group-version-kind": { + "group": "stash.appscode.com", + "version": "v1beta1", + "kind": "BackupBatch" + } + }, + "delete": { + "description": "delete collection of BackupBatch", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "stashAppscodeCom_v1beta1" + ], + "operationId": "deleteStashAppscodeComV1beta1CollectionBackupBatch", + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", + "name": "continue", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "name": "fieldSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "name": "labelSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", + "name": "limit", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", + "name": "resourceVersion", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", + "name": "timeoutSeconds", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "name": "watch", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" + } + } + }, + "x-kubernetes-action": "deletecollection", + "x-kubernetes-group-version-kind": { + "group": "stash.appscode.com", + "version": "v1beta1", + "kind": "BackupBatch" + } + }, + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "If 'true', then the output is pretty printed.", + "name": "pretty", + "in": "query" + } + ] + }, + "/apis/stash.appscode.com/v1beta1/backupbatch/{name}": { + "get": { + "description": "read the specified BackupBatch", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "stashAppscodeCom_v1beta1" + ], + "operationId": "readStashAppscodeComV1beta1BackupBatch", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatch" + } + } + }, + "x-kubernetes-action": "get", + "x-kubernetes-group-version-kind": { + "group": "stash.appscode.com", + "version": "v1beta1", + "kind": "BackupBatch" + } + }, + "put": { + "description": "replace the specified BackupBatch", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "stashAppscodeCom_v1beta1" + ], + "operationId": "replaceStashAppscodeComV1beta1BackupBatch", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatch" + } + }, + { + "uniqueItems": true, + "type": "string", + "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + "name": "dryRun", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", + "name": "fieldManager", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatch" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatch" + } + } + }, + "x-kubernetes-action": "put", + "x-kubernetes-group-version-kind": { + "group": "stash.appscode.com", + "version": "v1beta1", + "kind": "BackupBatch" + } + }, + "delete": { + "description": "delete a BackupBatch", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "stashAppscodeCom_v1beta1" + ], + "operationId": "deleteStashAppscodeComV1beta1BackupBatch", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions" + } + }, + { + "uniqueItems": true, + "type": "string", + "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + "name": "dryRun", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", + "name": "gracePeriodSeconds", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", + "name": "orphanDependents", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", + "name": "propagationPolicy", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" + } + }, + "202": { + "description": "Accepted", + "schema": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Status" + } + } + }, + "x-kubernetes-action": "delete", + "x-kubernetes-group-version-kind": { + "group": "stash.appscode.com", + "version": "v1beta1", + "kind": "BackupBatch" + } + }, + "patch": { + "description": "partially update the specified BackupBatch", + "consumes": [ + "application/json-patch+json", + "application/merge-patch+json", + "application/strategic-merge-patch+json" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "stashAppscodeCom_v1beta1" + ], + "operationId": "patchStashAppscodeComV1beta1BackupBatch", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" + } + }, + { + "uniqueItems": true, + "type": "string", + "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + "name": "dryRun", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", + "name": "fieldManager", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", + "name": "force", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatch" + } + } + }, + "x-kubernetes-action": "patch", + "x-kubernetes-group-version-kind": { + "group": "stash.appscode.com", + "version": "v1beta1", + "kind": "BackupBatch" + } + }, + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "name of the BackupBatch", + "name": "name", + "in": "path", + "required": true + }, + { + "uniqueItems": true, + "type": "string", + "description": "If 'true', then the output is pretty printed.", + "name": "pretty", + "in": "query" + } + ] + }, "/apis/stash.appscode.com/v1beta1/backupblueprint": { "get": { "description": "list or watch objects of kind BackupBlueprint", @@ -6522,14 +7022,192 @@ "patch": { "description": "partially update the specified Task", "consumes": [ - "application/json-patch+json", - "application/merge-patch+json", - "application/strategic-merge-patch+json" + "application/json-patch+json", + "application/merge-patch+json", + "application/strategic-merge-patch+json" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "stashAppscodeCom_v1beta1" + ], + "operationId": "patchStashAppscodeComV1beta1Task", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" + } + }, + { + "uniqueItems": true, + "type": "string", + "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + "name": "dryRun", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", + "name": "fieldManager", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", + "name": "force", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.Task" + } + } + }, + "x-kubernetes-action": "patch", + "x-kubernetes-group-version-kind": { + "group": "stash.appscode.com", + "version": "v1beta1", + "kind": "Task" + } + }, + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "name of the Task", + "name": "name", + "in": "path", + "required": true + }, + { + "uniqueItems": true, + "type": "string", + "description": "If 'true', then the output is pretty printed.", + "name": "pretty", + "in": "query" + } + ] + }, + "/apis/stash.appscode.com/v1beta1/watch/backupbatch": { + "get": { + "description": "watch individual changes to a list of BackupBatch. deprecated: use the 'watch' parameter with a list operation instead.", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf", + "application/json;stream=watch", + "application/vnd.kubernetes.protobuf;stream=watch" + ], + "schemes": [ + "https" + ], + "tags": [ + "stashAppscodeCom_v1beta1" + ], + "operationId": "watchStashAppscodeComV1beta1BackupBatchList", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" + } + } + }, + "x-kubernetes-action": "watchlist", + "x-kubernetes-group-version-kind": { + "group": "stash.appscode.com", + "version": "v1beta1", + "kind": "BackupBatch" + } + }, + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", + "name": "continue", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "name": "fieldSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "name": "labelSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", + "name": "limit", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "If 'true', then the output is pretty printed.", + "name": "pretty", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", + "name": "resourceVersion", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", + "name": "timeoutSeconds", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "name": "watch", + "in": "query" + } + ] + }, + "/apis/stash.appscode.com/v1beta1/watch/backupbatch/{name}": { + "get": { + "description": "watch changes to an object of kind BackupBatch. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.", + "consumes": [ + "*/*" ], "produces": [ "application/json", "application/yaml", - "application/vnd.kubernetes.protobuf" + "application/vnd.kubernetes.protobuf", + "application/json;stream=watch", + "application/vnd.kubernetes.protobuf;stream=watch" ], "schemes": [ "https" @@ -6537,58 +7215,55 @@ "tags": [ "stashAppscodeCom_v1beta1" ], - "operationId": "patchStashAppscodeComV1beta1Task", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Patch" - } - }, - { - "uniqueItems": true, - "type": "string", - "description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - "name": "dryRun", - "in": "query" - }, - { - "uniqueItems": true, - "type": "string", - "description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", - "name": "fieldManager", - "in": "query" - }, - { - "uniqueItems": true, - "type": "boolean", - "description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", - "name": "force", - "in": "query" - } - ], + "operationId": "watchStashAppscodeComV1beta1BackupBatch", "responses": { "200": { "description": "OK", "schema": { - "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.Task" + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" } } }, - "x-kubernetes-action": "patch", + "x-kubernetes-action": "watch", "x-kubernetes-group-version-kind": { "group": "stash.appscode.com", "version": "v1beta1", - "kind": "Task" + "kind": "BackupBatch" } }, "parameters": [ { "uniqueItems": true, "type": "string", - "description": "name of the Task", + "description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", + "name": "continue", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "name": "fieldSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "name": "labelSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", + "name": "limit", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "name of the BackupBatch", "name": "name", "in": "path", "required": true @@ -6599,6 +7274,27 @@ "description": "If 'true', then the output is pretty printed.", "name": "pretty", "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", + "name": "resourceVersion", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", + "name": "timeoutSeconds", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "name": "watch", + "in": "query" } ] }, @@ -8632,6 +9328,105 @@ } } }, + "dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatch": { + "type": "object", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + "type": "string" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" + }, + "spec": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatchSpec" + } + }, + "x-kubernetes-group-version-kind": [ + { + "group": "stash.appscode.com", + "kind": "BackupBatch", + "version": "v1beta1" + } + ] + }, + "dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatchList": { + "type": "object", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + "type": "string" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatch" + } + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" + } + }, + "x-kubernetes-group-version-kind": [ + { + "group": "stash.appscode.com", + "kind": "BackupBatchList", + "version": "v1beta1" + } + ] + }, + "dev.appscode.stash.stash.apis.stash.v1beta1.BackupBatchSpec": { + "type": "object", + "required": [ + "retentionPolicy" + ], + "properties": { + "backupConfigurationTemplates": { + "description": "backupConfigurationTemplates is a list of backup configurations that are part of this batch", + "type": "array", + "items": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupConfigurationTemplate" + } + }, + "backupHistoryLimit": { + "description": "BackupHistoryLimit specifies the number of BackupSession and it's associate resources to keep. This is helpful for debugging purpose. Default: 1", + "type": "integer", + "format": "int32" + }, + "driver": { + "description": "Driver indicates the name of the agent to use to backup the target. Supported values are \"Restic\", \"VolumeSnapshotter\". Default value is \"Restic\".", + "type": "string" + }, + "hooks": { + "description": "Actions that Stash should take in response to backup sessions. Cannot be updated.", + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.Hooks" + }, + "paused": { + "description": "Indicates that the BackupConfiguration is paused from taking backup. Default value is 'false'", + "type": "boolean" + }, + "repository": { + "description": "Repository refer to the Repository crd that holds backend information", + "$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference" + }, + "retentionPolicy": { + "description": "RetentionPolicy indicates the policy to follow to clean old backup snapshots", + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1alpha1.RetentionPolicy" + }, + "schedule": { + "description": "Schedule specifies the schedule for invoking backup sessions", + "type": "string" + } + } + }, "dev.appscode.stash.stash.apis.stash.v1beta1.BackupBlueprint": { "type": "object", "properties": { @@ -8801,6 +9596,10 @@ "description": "Driver indicates the name of the agent to use to backup the target. Supported values are \"Restic\", \"VolumeSnapshotter\". Default value is \"Restic\".", "type": "string" }, + "hooks": { + "description": "Actions that Stash should take in response to backup sessions. Cannot be updated.", + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.Hooks" + }, "interimVolumeTemplate": { "description": "InterimVolumeTemplate specifies a template for a volume to hold targeted data temporarily before uploading to backend or inserting into target. It is only usable for job model. Don't specify it in sidecar model.", "$ref": "#/definitions/io.k8s.api.core.v1.PersistentVolumeClaim" @@ -8822,8 +9621,57 @@ "$ref": "#/definitions/xyz.kmodules.offshoot-api.api.v1.RuntimeSettings" }, "schedule": { + "description": "Schedule specifies the schedule for invoking backup sessions", + "type": "string" + }, + "target": { + "description": "Target specify the backup target", + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupTarget" + }, + "task": { + "description": "Task specify the Task crd that specifies the steps to take backup", + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.TaskRef" + }, + "tempDir": { + "description": "Temp directory configuration for functions/sidecar An `EmptyDir` will always be mounted at /tmp with this settings", + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.EmptyDirSettings" + } + } + }, + "dev.appscode.stash.stash.apis.stash.v1beta1.BackupConfigurationTemplate": { + "type": "object", + "properties": { + "apiVersion": { + "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + "type": "string" + }, + "kind": { + "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", "type": "string" }, + "metadata": { + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" + }, + "spec": { + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupConfigurationTemplateSpec" + } + } + }, + "dev.appscode.stash.stash.apis.stash.v1beta1.BackupConfigurationTemplateSpec": { + "type": "object", + "properties": { + "hooks": { + "description": "Actions that Stash should take in response to backup sessions. Cannot be updated.", + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.Hooks" + }, + "interimVolumeTemplate": { + "description": "InterimVolumeTemplate specifies a template for a volume to hold targeted data temporarily before uploading to backend or inserting into target. It is only usable for job model. Don't specify it in sidecar model.", + "$ref": "#/definitions/io.k8s.api.core.v1.PersistentVolumeClaim" + }, + "runtimeSettings": { + "description": "RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc.", + "$ref": "#/definitions/xyz.kmodules.offshoot-api.api.v1.RuntimeSettings" + }, "target": { "description": "Target specify the backup target", "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupTarget" @@ -8838,6 +9686,28 @@ } } }, + "dev.appscode.stash.stash.apis.stash.v1beta1.BackupInvokerRef": { + "description": "BackupInvokerRef contains information that points to the backup configuration or batch being used", + "type": "object", + "required": [ + "kind", + "name" + ], + "properties": { + "apiGroup": { + "description": "APIGroup is the group for the resource being referenced", + "type": "string" + }, + "kind": { + "description": "Kind is the type of resource being referenced", + "type": "string" + }, + "name": { + "description": "Name is the name of resource being referenced", + "type": "string" + } + } + }, "dev.appscode.stash.stash.apis.stash.v1beta1.BackupSession": { "type": "object", "properties": { @@ -8900,8 +9770,12 @@ "type": "object", "properties": { "backupConfiguration": { - "description": "BackupConfiguration indicates the target BackupConfiguration crd", + "description": "BackupConfiguration indicates the target BackupConfiguration crd Deprecated: Use Invoker", "$ref": "#/definitions/io.k8s.api.core.v1.LocalObjectReference" + }, + "invoker": { + "description": "Invoker refers to the BackupConfiguration or BackupBatch being used to invoke this backup session", + "$ref": "#/definitions/dev.appscode.stash.stash.apis.stash.v1beta1.BackupInvokerRef" } } }, @@ -9139,6 +10013,20 @@ } } }, + "dev.appscode.stash.stash.apis.stash.v1beta1.Hooks": { + "description": "Hooks describes actions that Stash should take in response to backup sessions. For the PostBackup and PreBackup handlers, backup process blocks until the action is complete, unless the container process fails, in which case the handler is aborted.", + "type": "object", + "properties": { + "postBackup": { + "description": "PostBackup is called immediately after a backup session is complete.", + "$ref": "#/definitions/io.k8s.api.core.v1.Handler" + }, + "preBackup": { + "description": "PreBackup is called immediately before a backup session is initiated.", + "$ref": "#/definitions/io.k8s.api.core.v1.Handler" + } + } + }, "dev.appscode.stash.stash.apis.stash.v1beta1.HostBackupStats": { "type": "object", "properties": { @@ -9489,6 +10377,9 @@ }, "dev.appscode.stash.stash.apis.stash.v1beta1.TaskRef": { "type": "object", + "required": [ + "name" + ], "properties": { "name": { "type": "string" diff --git a/apis/stash/v1beta1/backup_batch_helpers.go b/apis/stash/v1beta1/backup_batch_helpers.go new file mode 100644 index 000000000..0bc2d817a --- /dev/null +++ b/apis/stash/v1beta1/backup_batch_helpers.go @@ -0,0 +1,69 @@ +package v1beta1 + +import ( + "hash/fnv" + "strconv" + + apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + hashutil "k8s.io/kubernetes/pkg/util/hash" + crdutils "kmodules.xyz/client-go/apiextensions/v1beta1" + meta_util "kmodules.xyz/client-go/meta" +) + +func (b BackupBatch) GetSpecHash() string { + hash := fnv.New64a() + hashutil.DeepHashObject(hash, b.Spec) + return strconv.FormatUint(hash.Sum64(), 10) +} + +func (b BackupBatch) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { + return crdutils.NewCustomResourceDefinition(crdutils.Config{ + Group: SchemeGroupVersion.Group, + Plural: ResourcePluralBackupBatch, + Singular: ResourceSingularBackupBatch, + Kind: ResourceKindBackupBatch, + ShortNames: []string{}, + Categories: []string{"stash", "appscode", "all"}, + ResourceScope: string(apiextensions.NamespaceScoped), + Versions: []apiextensions.CustomResourceDefinitionVersion{ + { + Name: SchemeGroupVersion.Version, + Served: true, + Storage: true, + }, + }, + Labels: crdutils.Labels{ + LabelsMap: map[string]string{"app": "stash"}, + }, + SpecDefinitionName: "stash.appscode.dev/stash/apis/stash/v1beta1.BackupBatch", + EnableValidation: true, + GetOpenAPIDefinitions: GetOpenAPIDefinitions, + AdditionalPrinterColumns: []apiextensions.CustomResourceColumnDefinition{ + { + Name: "Schedule", + Type: "string", + JSONPath: ".spec.schedule", + }, + { + Name: "Paused", + Type: "boolean", + JSONPath: ".spec.paused", + }, + { + Name: "Age", + Type: "date", + JSONPath: ".metadata.creationTimestamp", + }, + }, + }) +} + +// OffshootLabels return labels consist of the labels provided by user to BackupBatch crd and +// stash specific generic labels. It overwrites the the user provided labels if it matched with stash specific generic labels. +func (b BackupBatch) OffshootLabels() map[string]string { + overrides := make(map[string]string) + overrides[meta_util.ComponentLabelKey] = StashBackupComponent + overrides[meta_util.ManagedByLabelKey] = StashKey + + return upsertLabels(b.Labels, overrides) +} diff --git a/apis/stash/v1beta1/backup_batch_types.go b/apis/stash/v1beta1/backup_batch_types.go new file mode 100644 index 000000000..3fac5498b --- /dev/null +++ b/apis/stash/v1beta1/backup_batch_types.go @@ -0,0 +1,67 @@ +package v1beta1 + +import ( + core "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "stash.appscode.dev/stash/apis/stash/v1alpha1" +) + +const ( + ResourceKindBackupBatch = "BackupBatch" + ResourceSingularBackupBatch = "backupbatch" + ResourcePluralBackupBatch = "backupbatches" +) + +// +genclient +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=backupbatches,singular=backupbatch,categories={stash,appscode,all} +// +kubebuilder:printcolumn:name="Schedule",type="string",JSONPath=".spec.schedule" +// +kubebuilder:printcolumn:name="Paused",type="boolean",JSONPath=".spec.paused" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +type BackupBatch struct { + metav1.TypeMeta `json:",inline,omitempty"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec BackupBatchSpec `json:"spec,omitempty"` +} + +type BackupBatchSpec struct { + // backupConfigurationTemplates is a list of backup configurations that are part of this batch + // +optional + BackupConfigurationTemplates []BackupConfigurationTemplate `json:"backupConfigurationTemplates,omitempty"` + // Schedule specifies the schedule for invoking backup sessions + // +optional + Schedule string `json:"schedule,omitempty"` + // Driver indicates the name of the agent to use to backup the target. + // Supported values are "Restic", "VolumeSnapshotter". + // Default value is "Restic". + // +optional + Driver Snapshotter `json:"driver,omitempty"` + // Repository refer to the Repository crd that holds backend information + // +optional + Repository core.LocalObjectReference `json:"repository,omitempty"` + // RetentionPolicy indicates the policy to follow to clean old backup snapshots + RetentionPolicy v1alpha1.RetentionPolicy `json:"retentionPolicy"` + // Indicates that the BackupConfiguration is paused from taking backup. Default value is 'false' + // +optional + Paused bool `json:"paused,omitempty"` + // BackupHistoryLimit specifies the number of BackupSession and it's associate resources to keep. + // This is helpful for debugging purpose. + // Default: 1 + // +optional + BackupHistoryLimit *int32 `json:"backupHistoryLimit,omitempty"` + // Actions that Stash should take in response to backup sessions. + // Cannot be updated. + // +optional + Hooks *Hooks `json:"hooks,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type BackupBatchList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []BackupBatch `json:"items,omitempty"` +} diff --git a/apis/stash/v1beta1/backup_blueprint_types.go b/apis/stash/v1beta1/backup_blueprint_types.go index 02a7cd118..74559d644 100644 --- a/apis/stash/v1beta1/backup_blueprint_types.go +++ b/apis/stash/v1beta1/backup_blueprint_types.go @@ -39,7 +39,7 @@ type BackupBlueprintSpec struct { // RetentionPolicy indicates the policy to follow to clean old backup snapshots RetentionPolicy v1alpha1.RetentionPolicy `json:"retentionPolicy"` // RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc. - //+optional + // +optional RuntimeSettings ofst.RuntimeSettings `json:"runtimeSettings,omitempty"` // Temp directory configuration for functions/sidecar // An `EmptyDir` will always be mounted at /tmp with this settings diff --git a/apis/stash/v1beta1/backup_configuration_types.go b/apis/stash/v1beta1/backup_configuration_types.go index 737ffc84d..71b299c7e 100644 --- a/apis/stash/v1beta1/backup_configuration_types.go +++ b/apis/stash/v1beta1/backup_configuration_types.go @@ -2,7 +2,7 @@ package v1beta1 import ( core "k8s.io/api/core/v1" - resource "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ofst "kmodules.xyz/offshoot-api/api/v1" "stash.appscode.dev/stash/apis/stash/v1alpha1" @@ -30,29 +30,23 @@ type BackupConfiguration struct { Spec BackupConfigurationSpec `json:"spec,omitempty"` } -type BackupConfigurationSpec struct { - Schedule string `json:"schedule,omitempty"` - // Driver indicates the name of the agent to use to backup the target. - // Supported values are "Restic", "VolumeSnapshotter". - // Default value is "Restic". - // +optional - Driver Snapshotter `json:"driver,omitempty"` - // Repository refer to the Repository crd that holds backend information - // +optional - Repository core.LocalObjectReference `json:"repository,omitempty"` +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type BackupConfigurationTemplate struct { + metav1.TypeMeta `json:",inline,omitempty"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec BackupConfigurationTemplateSpec `json:"spec,omitempty"` +} + +type BackupConfigurationTemplateSpec struct { // Task specify the Task crd that specifies the steps to take backup // +optional Task TaskRef `json:"task,omitempty"` // Target specify the backup target // +optional Target *BackupTarget `json:"target,omitempty"` - // RetentionPolicy indicates the policy to follow to clean old backup snapshots - RetentionPolicy v1alpha1.RetentionPolicy `json:"retentionPolicy"` - // Indicates that the BackupConfiguration is paused from taking backup. Default value is 'false' - // +optional - Paused bool `json:"paused,omitempty"` // RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc. - //+optional + // +optional RuntimeSettings ofst.RuntimeSettings `json:"runtimeSettings,omitempty"` // Temp directory configuration for functions/sidecar // An `EmptyDir` will always be mounted at /tmp with this settings @@ -63,6 +57,30 @@ type BackupConfigurationSpec struct { // Don't specify it in sidecar model. // +optional InterimVolumeTemplate *core.PersistentVolumeClaim `json:"interimVolumeTemplate,omitempty"` + // Actions that Stash should take in response to backup sessions. + // Cannot be updated. + // +optional + Hooks *Hooks `json:"hooks,omitempty"` +} + +type BackupConfigurationSpec struct { + BackupConfigurationTemplateSpec `json:",inline,omitempty"` + // Schedule specifies the schedule for invoking backup sessions + // +optional + Schedule string `json:"schedule,omitempty"` + // Driver indicates the name of the agent to use to backup the target. + // Supported values are "Restic", "VolumeSnapshotter". + // Default value is "Restic". + // +optional + Driver Snapshotter `json:"driver,omitempty"` + // Repository refer to the Repository crd that holds backend information + // +optional + Repository core.LocalObjectReference `json:"repository,omitempty"` + // RetentionPolicy indicates the policy to follow to clean old backup snapshots + RetentionPolicy v1alpha1.RetentionPolicy `json:"retentionPolicy"` + // Indicates that the BackupConfiguration is paused from taking backup. Default value is 'false' + // +optional + Paused bool `json:"paused,omitempty"` // BackupHistoryLimit specifies the number of BackupSession and it's associate resources to keep. // This is helpful for debugging purpose. // Default: 1 @@ -70,6 +88,19 @@ type BackupConfigurationSpec struct { BackupHistoryLimit *int32 `json:"backupHistoryLimit,omitempty"` } +// Hooks describes actions that Stash should take in response to backup sessions. For the PostBackup +// and PreBackup handlers, backup process blocks until the action is complete, +// unless the container process fails, in which case the handler is aborted. +type Hooks struct { + // PreBackup is called immediately before a backup session is initiated. + // +optional + PreBackup *core.Handler `json:"preBackup,omitempty"` + + // PostBackup is called immediately after a backup session is complete. + // +optional + PostBackup *core.Handler `json:"postBackup,omitempty"` +} + type EmptyDirSettings struct { Medium core.StorageMedium `json:"medium,omitempty"` SizeLimit *resource.Quantity `json:"sizeLimit,omitempty"` diff --git a/apis/stash/v1beta1/backup_session_types.go b/apis/stash/v1beta1/backup_session_types.go index a1ec1fe10..55de529e6 100644 --- a/apis/stash/v1beta1/backup_session_types.go +++ b/apis/stash/v1beta1/backup_session_types.go @@ -30,8 +30,14 @@ type BackupSession struct { } type BackupSessionSpec struct { + // Invoker refers to the BackupConfiguration or BackupBatch being used to invoke this backup session + // +optional + Invoker BackupInvokerRef `json:"invoker,omitempty"` + // BackupConfiguration indicates the target BackupConfiguration crd - BackupConfiguration core.LocalObjectReference `json:"backupConfiguration,omitempty"` + // Deprecated: Use Invoker + // +optional + BackupConfiguration *core.LocalObjectReference `json:"backupConfiguration,omitempty"` } type BackupSessionPhase string @@ -62,7 +68,7 @@ type BackupSessionStatus struct { // +optional Phase BackupSessionPhase `json:"phase,omitempty"` // TotalHosts specifies total number of hosts that will be backed up for this BackupSession - // +Optional + // +optional TotalHosts *int32 `json:"totalHosts,omitempty"` // SessionDuration specify total time taken to complete current backup session (sum of backup duration of all hosts) // +optional diff --git a/apis/stash/v1beta1/function_types.go b/apis/stash/v1beta1/function_types.go index f48f6354a..55cf43570 100644 --- a/apis/stash/v1beta1/function_types.go +++ b/apis/stash/v1beta1/function_types.go @@ -83,10 +83,10 @@ type FunctionSpec struct { // +optional VolumeDevices []core.VolumeDevice `json:"volumeDevices,omitempty" patchStrategy:"merge" patchMergeKey:"devicePath"` // RuntimeSettings allow to specify Resources, LivenessProbe, ReadinessProbe, Lifecycle, SecurityContext etc. - //+optional + // +optional RuntimeSettings *ofst.ContainerRuntimeSettings `json:"runtimeSettings,omitempty"` // Name of PodSecurityPolicy(PSP) required by this function - //+optional + // +optional PodSecurityPolicyName string `json:"podSecurityPolicyName,omitempty"` } diff --git a/apis/stash/v1beta1/openapi_generated.go b/apis/stash/v1beta1/openapi_generated.go index a5b809b44..83ff0fd5e 100644 --- a/apis/stash/v1beta1/openapi_generated.go +++ b/apis/stash/v1beta1/openapi_generated.go @@ -351,12 +351,18 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/offshoot-api/api/v1.ServicePort": schema_kmodulesxyz_offshoot_api_api_v1_ServicePort(ref), "kmodules.xyz/offshoot-api/api/v1.ServiceSpec": schema_kmodulesxyz_offshoot_api_api_v1_ServiceSpec(ref), "kmodules.xyz/offshoot-api/api/v1.ServiceTemplateSpec": schema_kmodulesxyz_offshoot_api_api_v1_ServiceTemplateSpec(ref), + "stash.appscode.dev/stash/apis/stash/v1beta1.BackupBatch": schema_stash_apis_stash_v1beta1_BackupBatch(ref), + "stash.appscode.dev/stash/apis/stash/v1beta1.BackupBatchList": schema_stash_apis_stash_v1beta1_BackupBatchList(ref), + "stash.appscode.dev/stash/apis/stash/v1beta1.BackupBatchSpec": schema_stash_apis_stash_v1beta1_BackupBatchSpec(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.BackupBlueprint": schema_stash_apis_stash_v1beta1_BackupBlueprint(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.BackupBlueprintList": schema_stash_apis_stash_v1beta1_BackupBlueprintList(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.BackupBlueprintSpec": schema_stash_apis_stash_v1beta1_BackupBlueprintSpec(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.BackupConfiguration": schema_stash_apis_stash_v1beta1_BackupConfiguration(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.BackupConfigurationList": schema_stash_apis_stash_v1beta1_BackupConfigurationList(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.BackupConfigurationSpec": schema_stash_apis_stash_v1beta1_BackupConfigurationSpec(ref), + "stash.appscode.dev/stash/apis/stash/v1beta1.BackupConfigurationTemplate": schema_stash_apis_stash_v1beta1_BackupConfigurationTemplate(ref), + "stash.appscode.dev/stash/apis/stash/v1beta1.BackupConfigurationTemplateSpec": schema_stash_apis_stash_v1beta1_BackupConfigurationTemplateSpec(ref), + "stash.appscode.dev/stash/apis/stash/v1beta1.BackupInvokerRef": schema_stash_apis_stash_v1beta1_BackupInvokerRef(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.BackupSession": schema_stash_apis_stash_v1beta1_BackupSession(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.BackupSessionList": schema_stash_apis_stash_v1beta1_BackupSessionList(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.BackupSessionSpec": schema_stash_apis_stash_v1beta1_BackupSessionSpec(ref), @@ -368,6 +374,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "stash.appscode.dev/stash/apis/stash/v1beta1.FunctionList": schema_stash_apis_stash_v1beta1_FunctionList(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.FunctionRef": schema_stash_apis_stash_v1beta1_FunctionRef(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.FunctionSpec": schema_stash_apis_stash_v1beta1_FunctionSpec(ref), + "stash.appscode.dev/stash/apis/stash/v1beta1.Hooks": schema_stash_apis_stash_v1beta1_Hooks(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.HostBackupStats": schema_stash_apis_stash_v1beta1_HostBackupStats(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.HostRestoreStats": schema_stash_apis_stash_v1beta1_HostRestoreStats(ref), "stash.appscode.dev/stash/apis/stash/v1beta1.Param": schema_stash_apis_stash_v1beta1_Param(ref), @@ -15966,6 +15973,163 @@ func schema_kmodulesxyz_offshoot_api_api_v1_ServiceTemplateSpec(ref common.Refer } } +func schema_stash_apis_stash_v1beta1_BackupBatch(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.BackupBatchSpec"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "stash.appscode.dev/stash/apis/stash/v1beta1.BackupBatchSpec"}, + } +} + +func schema_stash_apis_stash_v1beta1_BackupBatchList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.BackupBatch"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "stash.appscode.dev/stash/apis/stash/v1beta1.BackupBatch"}, + } +} + +func schema_stash_apis_stash_v1beta1_BackupBatchSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "backupConfigurationTemplates": { + SchemaProps: spec.SchemaProps{ + Description: "backupConfigurationTemplates is a list of backup configurations that are part of this batch", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.BackupConfigurationTemplate"), + }, + }, + }, + }, + }, + "schedule": { + SchemaProps: spec.SchemaProps{ + Description: "Schedule specifies the schedule for invoking backup sessions", + Type: []string{"string"}, + Format: "", + }, + }, + "driver": { + SchemaProps: spec.SchemaProps{ + Description: "Driver indicates the name of the agent to use to backup the target. Supported values are \"Restic\", \"VolumeSnapshotter\". Default value is \"Restic\".", + Type: []string{"string"}, + Format: "", + }, + }, + "repository": { + SchemaProps: spec.SchemaProps{ + Description: "Repository refer to the Repository crd that holds backend information", + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + "retentionPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "RetentionPolicy indicates the policy to follow to clean old backup snapshots", + Ref: ref("stash.appscode.dev/stash/apis/stash/v1alpha1.RetentionPolicy"), + }, + }, + "paused": { + SchemaProps: spec.SchemaProps{ + Description: "Indicates that the BackupConfiguration is paused from taking backup. Default value is 'false'", + Type: []string{"boolean"}, + Format: "", + }, + }, + "backupHistoryLimit": { + SchemaProps: spec.SchemaProps{ + Description: "BackupHistoryLimit specifies the number of BackupSession and it's associate resources to keep. This is helpful for debugging purpose. Default: 1", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "hooks": { + SchemaProps: spec.SchemaProps{ + Description: "Actions that Stash should take in response to backup sessions. Cannot be updated.", + Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.Hooks"), + }, + }, + }, + Required: []string{"retentionPolicy"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.LocalObjectReference", "stash.appscode.dev/stash/apis/stash/v1alpha1.RetentionPolicy", "stash.appscode.dev/stash/apis/stash/v1beta1.BackupConfigurationTemplate", "stash.appscode.dev/stash/apis/stash/v1beta1.Hooks"}, + } +} + func schema_stash_apis_stash_v1beta1_BackupBlueprint(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -16209,10 +16373,47 @@ func schema_stash_apis_stash_v1beta1_BackupConfigurationSpec(ref common.Referenc SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ + "task": { + SchemaProps: spec.SchemaProps{ + Description: "Task specify the Task crd that specifies the steps to take backup", + Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.TaskRef"), + }, + }, + "target": { + SchemaProps: spec.SchemaProps{ + Description: "Target specify the backup target", + Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.BackupTarget"), + }, + }, + "runtimeSettings": { + SchemaProps: spec.SchemaProps{ + Description: "RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc.", + Ref: ref("kmodules.xyz/offshoot-api/api/v1.RuntimeSettings"), + }, + }, + "tempDir": { + SchemaProps: spec.SchemaProps{ + Description: "Temp directory configuration for functions/sidecar An `EmptyDir` will always be mounted at /tmp with this settings", + Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.EmptyDirSettings"), + }, + }, + "interimVolumeTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "InterimVolumeTemplate specifies a template for a volume to hold targeted data temporarily before uploading to backend or inserting into target. It is only usable for job model. Don't specify it in sidecar model.", + Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaim"), + }, + }, + "hooks": { + SchemaProps: spec.SchemaProps{ + Description: "Actions that Stash should take in response to backup sessions. Cannot be updated.", + Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.Hooks"), + }, + }, "schedule": { SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", + Description: "Schedule specifies the schedule for invoking backup sessions", + Type: []string{"string"}, + Format: "", }, }, "driver": { @@ -16228,18 +16429,6 @@ func schema_stash_apis_stash_v1beta1_BackupConfigurationSpec(ref common.Referenc Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, - "task": { - SchemaProps: spec.SchemaProps{ - Description: "Task specify the Task crd that specifies the steps to take backup", - Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.TaskRef"), - }, - }, - "target": { - SchemaProps: spec.SchemaProps{ - Description: "Target specify the backup target", - Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.BackupTarget"), - }, - }, "retentionPolicy": { SchemaProps: spec.SchemaProps{ Description: "RetentionPolicy indicates the policy to follow to clean old backup snapshots", @@ -16253,6 +16442,78 @@ func schema_stash_apis_stash_v1beta1_BackupConfigurationSpec(ref common.Referenc Format: "", }, }, + "backupHistoryLimit": { + SchemaProps: spec.SchemaProps{ + Description: "BackupHistoryLimit specifies the number of BackupSession and it's associate resources to keep. This is helpful for debugging purpose. Default: 1", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"retentionPolicy"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaim", "kmodules.xyz/offshoot-api/api/v1.RuntimeSettings", "stash.appscode.dev/stash/apis/stash/v1alpha1.RetentionPolicy", "stash.appscode.dev/stash/apis/stash/v1beta1.BackupTarget", "stash.appscode.dev/stash/apis/stash/v1beta1.EmptyDirSettings", "stash.appscode.dev/stash/apis/stash/v1beta1.Hooks", "stash.appscode.dev/stash/apis/stash/v1beta1.TaskRef"}, + } +} + +func schema_stash_apis_stash_v1beta1_BackupConfigurationTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.BackupConfigurationTemplateSpec"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "stash.appscode.dev/stash/apis/stash/v1beta1.BackupConfigurationTemplateSpec"}, + } +} + +func schema_stash_apis_stash_v1beta1_BackupConfigurationTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "task": { + SchemaProps: spec.SchemaProps{ + Description: "Task specify the Task crd that specifies the steps to take backup", + Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.TaskRef"), + }, + }, + "target": { + SchemaProps: spec.SchemaProps{ + Description: "Target specify the backup target", + Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.BackupTarget"), + }, + }, "runtimeSettings": { SchemaProps: spec.SchemaProps{ Description: "RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc.", @@ -16271,19 +16532,52 @@ func schema_stash_apis_stash_v1beta1_BackupConfigurationSpec(ref common.Referenc Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaim"), }, }, - "backupHistoryLimit": { + "hooks": { SchemaProps: spec.SchemaProps{ - Description: "BackupHistoryLimit specifies the number of BackupSession and it's associate resources to keep. This is helpful for debugging purpose. Default: 1", - Type: []string{"integer"}, - Format: "int32", + Description: "Actions that Stash should take in response to backup sessions. Cannot be updated.", + Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.Hooks"), }, }, }, - Required: []string{"retentionPolicy"}, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaim", "kmodules.xyz/offshoot-api/api/v1.RuntimeSettings", "stash.appscode.dev/stash/apis/stash/v1alpha1.RetentionPolicy", "stash.appscode.dev/stash/apis/stash/v1beta1.BackupTarget", "stash.appscode.dev/stash/apis/stash/v1beta1.EmptyDirSettings", "stash.appscode.dev/stash/apis/stash/v1beta1.TaskRef"}, + "k8s.io/api/core/v1.PersistentVolumeClaim", "kmodules.xyz/offshoot-api/api/v1.RuntimeSettings", "stash.appscode.dev/stash/apis/stash/v1beta1.BackupTarget", "stash.appscode.dev/stash/apis/stash/v1beta1.EmptyDirSettings", "stash.appscode.dev/stash/apis/stash/v1beta1.Hooks", "stash.appscode.dev/stash/apis/stash/v1beta1.TaskRef"}, + } +} + +func schema_stash_apis_stash_v1beta1_BackupInvokerRef(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BackupInvokerRef contains information that points to the backup configuration or batch being used", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "apiGroup": { + SchemaProps: spec.SchemaProps{ + Description: "APIGroup is the group for the resource being referenced", + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is the type of resource being referenced", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is the name of resource being referenced", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"kind", "name"}, + }, + }, } } @@ -16381,9 +16675,15 @@ func schema_stash_apis_stash_v1beta1_BackupSessionSpec(ref common.ReferenceCallb SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ + "invoker": { + SchemaProps: spec.SchemaProps{ + Description: "Invoker refers to the BackupConfiguration or BackupBatch being used to invoke this backup session", + Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.BackupInvokerRef"), + }, + }, "backupConfiguration": { SchemaProps: spec.SchemaProps{ - Description: "BackupConfiguration indicates the target BackupConfiguration crd", + Description: "BackupConfiguration indicates the target BackupConfiguration crd Deprecated: Use Invoker", Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, @@ -16391,7 +16691,7 @@ func schema_stash_apis_stash_v1beta1_BackupSessionSpec(ref common.ReferenceCallb }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "stash.appscode.dev/stash/apis/stash/v1beta1.BackupInvokerRef"}, } } @@ -16825,6 +17125,33 @@ func schema_stash_apis_stash_v1beta1_FunctionSpec(ref common.ReferenceCallback) } } +func schema_stash_apis_stash_v1beta1_Hooks(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Hooks describes actions that Stash should take in response to backup sessions. For the PostBackup and PreBackup handlers, backup process blocks until the action is complete, unless the container process fails, in which case the handler is aborted.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "preBackup": { + SchemaProps: spec.SchemaProps{ + Description: "PreBackup is called immediately before a backup session is initiated.", + Ref: ref("k8s.io/api/core/v1.Handler"), + }, + }, + "postBackup": { + SchemaProps: spec.SchemaProps{ + Description: "PostBackup is called immediately after a backup session is complete.", + Ref: ref("k8s.io/api/core/v1.Handler"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.Handler"}, + } +} + func schema_stash_apis_stash_v1beta1_HostBackupStats(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -17465,6 +17792,7 @@ func schema_stash_apis_stash_v1beta1_TaskRef(ref common.ReferenceCallback) commo }, }, }, + Required: []string{"name"}, }, }, Dependencies: []string{ diff --git a/apis/stash/v1beta1/register.go b/apis/stash/v1beta1/register.go index 82789cd65..ce19aa2b1 100644 --- a/apis/stash/v1beta1/register.go +++ b/apis/stash/v1beta1/register.go @@ -32,18 +32,20 @@ func Resource(resource string) schema.GroupResource { // Adds the list of known types to api.Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, - &Function{}, - &FunctionList{}, - &BackupConfiguration{}, + &BackupBatchList{}, + &BackupBatch{}, + &BackupBlueprintList{}, + &BackupBlueprint{}, &BackupConfigurationList{}, - &BackupSession{}, + &BackupConfiguration{}, &BackupSessionList{}, - &BackupBlueprint{}, - &BackupBlueprintList{}, - &RestoreSession{}, + &BackupSession{}, + &FunctionList{}, + &Function{}, &RestoreSessionList{}, - &Task{}, + &RestoreSession{}, &TaskList{}, + &Task{}, ) scheme.AddKnownTypes(SchemeGroupVersion, diff --git a/apis/stash/v1beta1/restore_session_types.go b/apis/stash/v1beta1/restore_session_types.go index 26232e8b8..2f7f8addb 100644 --- a/apis/stash/v1beta1/restore_session_types.go +++ b/apis/stash/v1beta1/restore_session_types.go @@ -49,11 +49,11 @@ type RestoreSessionSpec struct { // +optional Rules []Rule `json:"rules,omitempty"` // RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc. - //+optional + // +optional RuntimeSettings ofst.RuntimeSettings `json:"runtimeSettings,omitempty"` // Temp directory configuration for functions/sidecar // An `EmptyDir` will always be mounted at /tmp with this settings - //+optional + // +optional TempDir EmptyDirSettings `json:"tempDir,omitempty"` // InterimVolumeTemplate specifies a template for a volume to hold targeted data temporarily // before uploading to backend or inserting into target. It is only usable for job model. @@ -116,7 +116,7 @@ type RestoreSessionStatus struct { // +optional Phase RestoreSessionPhase `json:"phase,omitempty"` // TotalHosts specifies total number of hosts that will be restored for this RestoreSession - // +Optional + // +optional TotalHosts *int32 `json:"totalHosts,omitempty"` // SessionDuration specify total time taken to complete current restore session (sum of restore duration of all hosts) // +optional diff --git a/apis/stash/v1beta1/types.go b/apis/stash/v1beta1/types.go index 2ab04cdd1..3dad77c6c 100644 --- a/apis/stash/v1beta1/types.go +++ b/apis/stash/v1beta1/types.go @@ -4,6 +4,17 @@ import ( core "k8s.io/api/core/v1" ) +// BackupInvokerRef contains information that points to the backup configuration or batch being used +type BackupInvokerRef struct { + // APIGroup is the group for the resource being referenced + // +optional + APIGroup string `json:"apiGroup,omitempty"` + // Kind is the type of resource being referenced + Kind string `json:"kind"` + // Name is the name of resource being referenced + Name string `json:"name"` +} + // Param declares a value to use for the Param called Name. type Param struct { Name string `json:"name"` @@ -11,7 +22,7 @@ type Param struct { } type TaskRef struct { - Name string `json:"name,omitempty"` + Name string `json:"name"` // +optional Params []Param `json:"params,omitempty"` } diff --git a/apis/stash/v1beta1/zz_generated.deepcopy.go b/apis/stash/v1beta1/zz_generated.deepcopy.go index f2e3e99e8..3501aad4f 100644 --- a/apis/stash/v1beta1/zz_generated.deepcopy.go +++ b/apis/stash/v1beta1/zz_generated.deepcopy.go @@ -26,6 +26,101 @@ import ( apiv1 "kmodules.xyz/offshoot-api/api/v1" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupBatch) DeepCopyInto(out *BackupBatch) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupBatch. +func (in *BackupBatch) DeepCopy() *BackupBatch { + if in == nil { + return nil + } + out := new(BackupBatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BackupBatch) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupBatchList) DeepCopyInto(out *BackupBatchList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]BackupBatch, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupBatchList. +func (in *BackupBatchList) DeepCopy() *BackupBatchList { + if in == nil { + return nil + } + out := new(BackupBatchList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BackupBatchList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupBatchSpec) DeepCopyInto(out *BackupBatchSpec) { + *out = *in + if in.BackupConfigurationTemplates != nil { + in, out := &in.BackupConfigurationTemplates, &out.BackupConfigurationTemplates + *out = make([]BackupConfigurationTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + out.Repository = in.Repository + in.RetentionPolicy.DeepCopyInto(&out.RetentionPolicy) + if in.BackupHistoryLimit != nil { + in, out := &in.BackupHistoryLimit, &out.BackupHistoryLimit + *out = new(int32) + **out = **in + } + if in.Hooks != nil { + in, out := &in.Hooks, &out.Hooks + *out = new(Hooks) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupBatchSpec. +func (in *BackupBatchSpec) DeepCopy() *BackupBatchSpec { + if in == nil { + return nil + } + out := new(BackupBatchSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BackupBlueprint) DeepCopyInto(out *BackupBlueprint) { *out = *in @@ -180,14 +275,63 @@ func (in *BackupConfigurationList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BackupConfigurationSpec) DeepCopyInto(out *BackupConfigurationSpec) { *out = *in + in.BackupConfigurationTemplateSpec.DeepCopyInto(&out.BackupConfigurationTemplateSpec) out.Repository = in.Repository + in.RetentionPolicy.DeepCopyInto(&out.RetentionPolicy) + if in.BackupHistoryLimit != nil { + in, out := &in.BackupHistoryLimit, &out.BackupHistoryLimit + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfigurationSpec. +func (in *BackupConfigurationSpec) DeepCopy() *BackupConfigurationSpec { + if in == nil { + return nil + } + out := new(BackupConfigurationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupConfigurationTemplate) DeepCopyInto(out *BackupConfigurationTemplate) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfigurationTemplate. +func (in *BackupConfigurationTemplate) DeepCopy() *BackupConfigurationTemplate { + if in == nil { + return nil + } + out := new(BackupConfigurationTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BackupConfigurationTemplate) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupConfigurationTemplateSpec) DeepCopyInto(out *BackupConfigurationTemplateSpec) { + *out = *in in.Task.DeepCopyInto(&out.Task) if in.Target != nil { in, out := &in.Target, &out.Target *out = new(BackupTarget) (*in).DeepCopyInto(*out) } - in.RetentionPolicy.DeepCopyInto(&out.RetentionPolicy) in.RuntimeSettings.DeepCopyInto(&out.RuntimeSettings) in.TempDir.DeepCopyInto(&out.TempDir) if in.InterimVolumeTemplate != nil { @@ -195,20 +339,36 @@ func (in *BackupConfigurationSpec) DeepCopyInto(out *BackupConfigurationSpec) { *out = new(v1.PersistentVolumeClaim) (*in).DeepCopyInto(*out) } - if in.BackupHistoryLimit != nil { - in, out := &in.BackupHistoryLimit, &out.BackupHistoryLimit - *out = new(int32) - **out = **in + if in.Hooks != nil { + in, out := &in.Hooks, &out.Hooks + *out = new(Hooks) + (*in).DeepCopyInto(*out) } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfigurationSpec. -func (in *BackupConfigurationSpec) DeepCopy() *BackupConfigurationSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupConfigurationTemplateSpec. +func (in *BackupConfigurationTemplateSpec) DeepCopy() *BackupConfigurationTemplateSpec { if in == nil { return nil } - out := new(BackupConfigurationSpec) + out := new(BackupConfigurationTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupInvokerRef) DeepCopyInto(out *BackupInvokerRef) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupInvokerRef. +func (in *BackupInvokerRef) DeepCopy() *BackupInvokerRef { + if in == nil { + return nil + } + out := new(BackupInvokerRef) in.DeepCopyInto(out) return out } @@ -218,7 +378,7 @@ func (in *BackupSession) DeepCopyInto(out *BackupSession) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) return } @@ -277,7 +437,12 @@ func (in *BackupSessionList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BackupSessionSpec) DeepCopyInto(out *BackupSessionSpec) { *out = *in - out.BackupConfiguration = in.BackupConfiguration + out.Invoker = in.Invoker + if in.BackupConfiguration != nil { + in, out := &in.BackupConfiguration, &out.BackupConfiguration + *out = new(v1.LocalObjectReference) + **out = **in + } return } @@ -543,6 +708,32 @@ func (in *FunctionSpec) DeepCopy() *FunctionSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Hooks) DeepCopyInto(out *Hooks) { + *out = *in + if in.PreBackup != nil { + in, out := &in.PreBackup, &out.PreBackup + *out = new(v1.Handler) + (*in).DeepCopyInto(*out) + } + if in.PostBackup != nil { + in, out := &in.PostBackup, &out.PostBackup + *out = new(v1.Handler) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Hooks. +func (in *Hooks) DeepCopy() *Hooks { + if in == nil { + return nil + } + out := new(Hooks) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HostBackupStats) DeepCopyInto(out *HostBackupStats) { *out = *in diff --git a/client/clientset/versioned/typed/stash/v1beta1/backupbatch.go b/client/clientset/versioned/typed/stash/v1beta1/backupbatch.go new file mode 100644 index 000000000..bf9018bfd --- /dev/null +++ b/client/clientset/versioned/typed/stash/v1beta1/backupbatch.go @@ -0,0 +1,174 @@ +/* +Copyright 2019 The Stash Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" +) + +// BackupBatchesGetter has a method to return a BackupBatchInterface. +// A group's client should implement this interface. +type BackupBatchesGetter interface { + BackupBatches(namespace string) BackupBatchInterface +} + +// BackupBatchInterface has methods to work with BackupBatch resources. +type BackupBatchInterface interface { + Create(*v1beta1.BackupBatch) (*v1beta1.BackupBatch, error) + Update(*v1beta1.BackupBatch) (*v1beta1.BackupBatch, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1beta1.BackupBatch, error) + List(opts v1.ListOptions) (*v1beta1.BackupBatchList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.BackupBatch, err error) + BackupBatchExpansion +} + +// backupBatches implements BackupBatchInterface +type backupBatches struct { + client rest.Interface + ns string +} + +// newBackupBatches returns a BackupBatches +func newBackupBatches(c *StashV1beta1Client, namespace string) *backupBatches { + return &backupBatches{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the backupBatch, and returns the corresponding backupBatch object, and an error if there is any. +func (c *backupBatches) Get(name string, options v1.GetOptions) (result *v1beta1.BackupBatch, err error) { + result = &v1beta1.BackupBatch{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backupbatches"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of BackupBatches that match those selectors. +func (c *backupBatches) List(opts v1.ListOptions) (result *v1beta1.BackupBatchList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.BackupBatchList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backupbatches"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested backupBatches. +func (c *backupBatches) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("backupbatches"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a backupBatch and creates it. Returns the server's representation of the backupBatch, and an error, if there is any. +func (c *backupBatches) Create(backupBatch *v1beta1.BackupBatch) (result *v1beta1.BackupBatch, err error) { + result = &v1beta1.BackupBatch{} + err = c.client.Post(). + Namespace(c.ns). + Resource("backupbatches"). + Body(backupBatch). + Do(). + Into(result) + return +} + +// Update takes the representation of a backupBatch and updates it. Returns the server's representation of the backupBatch, and an error, if there is any. +func (c *backupBatches) Update(backupBatch *v1beta1.BackupBatch) (result *v1beta1.BackupBatch, err error) { + result = &v1beta1.BackupBatch{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backupbatches"). + Name(backupBatch.Name). + Body(backupBatch). + Do(). + Into(result) + return +} + +// Delete takes name of the backupBatch and deletes it. Returns an error if one occurs. +func (c *backupBatches) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("backupbatches"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *backupBatches) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("backupbatches"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched backupBatch. +func (c *backupBatches) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.BackupBatch, err error) { + result = &v1beta1.BackupBatch{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("backupbatches"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupbatch.go b/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupbatch.go new file mode 100644 index 000000000..6e38746bc --- /dev/null +++ b/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupbatch.go @@ -0,0 +1,128 @@ +/* +Copyright 2019 The Stash Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" +) + +// FakeBackupBatches implements BackupBatchInterface +type FakeBackupBatches struct { + Fake *FakeStashV1beta1 + ns string +} + +var backupbatchesResource = schema.GroupVersionResource{Group: "stash.appscode.com", Version: "v1beta1", Resource: "backupbatches"} + +var backupbatchesKind = schema.GroupVersionKind{Group: "stash.appscode.com", Version: "v1beta1", Kind: "BackupBatch"} + +// Get takes name of the backupBatch, and returns the corresponding backupBatch object, and an error if there is any. +func (c *FakeBackupBatches) Get(name string, options v1.GetOptions) (result *v1beta1.BackupBatch, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(backupbatchesResource, c.ns, name), &v1beta1.BackupBatch{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupBatch), err +} + +// List takes label and field selectors, and returns the list of BackupBatches that match those selectors. +func (c *FakeBackupBatches) List(opts v1.ListOptions) (result *v1beta1.BackupBatchList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(backupbatchesResource, backupbatchesKind, c.ns, opts), &v1beta1.BackupBatchList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.BackupBatchList{ListMeta: obj.(*v1beta1.BackupBatchList).ListMeta} + for _, item := range obj.(*v1beta1.BackupBatchList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested backupBatches. +func (c *FakeBackupBatches) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(backupbatchesResource, c.ns, opts)) + +} + +// Create takes the representation of a backupBatch and creates it. Returns the server's representation of the backupBatch, and an error, if there is any. +func (c *FakeBackupBatches) Create(backupBatch *v1beta1.BackupBatch) (result *v1beta1.BackupBatch, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(backupbatchesResource, c.ns, backupBatch), &v1beta1.BackupBatch{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupBatch), err +} + +// Update takes the representation of a backupBatch and updates it. Returns the server's representation of the backupBatch, and an error, if there is any. +func (c *FakeBackupBatches) Update(backupBatch *v1beta1.BackupBatch) (result *v1beta1.BackupBatch, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(backupbatchesResource, c.ns, backupBatch), &v1beta1.BackupBatch{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupBatch), err +} + +// Delete takes name of the backupBatch and deletes it. Returns an error if one occurs. +func (c *FakeBackupBatches) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(backupbatchesResource, c.ns, name), &v1beta1.BackupBatch{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackupBatches) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(backupbatchesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1beta1.BackupBatchList{}) + return err +} + +// Patch applies the patch and returns the patched backupBatch. +func (c *FakeBackupBatches) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.BackupBatch, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backupbatchesResource, c.ns, name, pt, data, subresources...), &v1beta1.BackupBatch{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupBatch), err +} diff --git a/client/clientset/versioned/typed/stash/v1beta1/fake/fake_stash_client.go b/client/clientset/versioned/typed/stash/v1beta1/fake/fake_stash_client.go index 0cee57223..fccf8d042 100644 --- a/client/clientset/versioned/typed/stash/v1beta1/fake/fake_stash_client.go +++ b/client/clientset/versioned/typed/stash/v1beta1/fake/fake_stash_client.go @@ -28,6 +28,10 @@ type FakeStashV1beta1 struct { *testing.Fake } +func (c *FakeStashV1beta1) BackupBatches(namespace string) v1beta1.BackupBatchInterface { + return &FakeBackupBatches{c, namespace} +} + func (c *FakeStashV1beta1) BackupBlueprints() v1beta1.BackupBlueprintInterface { return &FakeBackupBlueprints{c} } diff --git a/client/clientset/versioned/typed/stash/v1beta1/generated_expansion.go b/client/clientset/versioned/typed/stash/v1beta1/generated_expansion.go index 94562cf47..4d1900dab 100644 --- a/client/clientset/versioned/typed/stash/v1beta1/generated_expansion.go +++ b/client/clientset/versioned/typed/stash/v1beta1/generated_expansion.go @@ -18,6 +18,8 @@ limitations under the License. package v1beta1 +type BackupBatchExpansion interface{} + type BackupBlueprintExpansion interface{} type BackupConfigurationExpansion interface{} diff --git a/client/clientset/versioned/typed/stash/v1beta1/stash_client.go b/client/clientset/versioned/typed/stash/v1beta1/stash_client.go index fb2fb1dcd..8979c58cd 100644 --- a/client/clientset/versioned/typed/stash/v1beta1/stash_client.go +++ b/client/clientset/versioned/typed/stash/v1beta1/stash_client.go @@ -27,6 +27,7 @@ import ( type StashV1beta1Interface interface { RESTClient() rest.Interface + BackupBatchesGetter BackupBlueprintsGetter BackupConfigurationsGetter BackupSessionsGetter @@ -40,6 +41,10 @@ type StashV1beta1Client struct { restClient rest.Interface } +func (c *StashV1beta1Client) BackupBatches(namespace string) BackupBatchInterface { + return newBackupBatches(c, namespace) +} + func (c *StashV1beta1Client) BackupBlueprints() BackupBlueprintInterface { return newBackupBlueprints(c) } diff --git a/client/informers/externalversions/generic.go b/client/informers/externalversions/generic.go index 443be9e7f..f61c01708 100644 --- a/client/informers/externalversions/generic.go +++ b/client/informers/externalversions/generic.go @@ -62,6 +62,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Stash().V1alpha1().Restics().Informer()}, nil // Group=stash.appscode.com, Version=v1beta1 + case v1beta1.SchemeGroupVersion.WithResource("backupbatches"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Stash().V1beta1().BackupBatches().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("backupblueprints"): return &genericInformer{resource: resource.GroupResource(), informer: f.Stash().V1beta1().BackupBlueprints().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("backupconfigurations"): diff --git a/client/informers/externalversions/stash/v1beta1/backupbatch.go b/client/informers/externalversions/stash/v1beta1/backupbatch.go new file mode 100644 index 000000000..ab9d531dc --- /dev/null +++ b/client/informers/externalversions/stash/v1beta1/backupbatch.go @@ -0,0 +1,89 @@ +/* +Copyright 2019 The Stash Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + stashv1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + versioned "stash.appscode.dev/stash/client/clientset/versioned" + internalinterfaces "stash.appscode.dev/stash/client/informers/externalversions/internalinterfaces" + v1beta1 "stash.appscode.dev/stash/client/listers/stash/v1beta1" +) + +// BackupBatchInformer provides access to a shared informer and lister for +// BackupBatches. +type BackupBatchInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.BackupBatchLister +} + +type backupBatchInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewBackupBatchInformer constructs a new informer for BackupBatch type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewBackupBatchInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBackupBatchInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredBackupBatchInformer constructs a new informer for BackupBatch type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredBackupBatchInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StashV1beta1().BackupBatches(namespace).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StashV1beta1().BackupBatches(namespace).Watch(options) + }, + }, + &stashv1beta1.BackupBatch{}, + resyncPeriod, + indexers, + ) +} + +func (f *backupBatchInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBackupBatchInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *backupBatchInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&stashv1beta1.BackupBatch{}, f.defaultInformer) +} + +func (f *backupBatchInformer) Lister() v1beta1.BackupBatchLister { + return v1beta1.NewBackupBatchLister(f.Informer().GetIndexer()) +} diff --git a/client/informers/externalversions/stash/v1beta1/interface.go b/client/informers/externalversions/stash/v1beta1/interface.go index a97514759..3b0ce51a3 100644 --- a/client/informers/externalversions/stash/v1beta1/interface.go +++ b/client/informers/externalversions/stash/v1beta1/interface.go @@ -24,6 +24,8 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // BackupBatches returns a BackupBatchInformer. + BackupBatches() BackupBatchInformer // BackupBlueprints returns a BackupBlueprintInformer. BackupBlueprints() BackupBlueprintInformer // BackupConfigurations returns a BackupConfigurationInformer. @@ -49,6 +51,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// BackupBatches returns a BackupBatchInformer. +func (v *version) BackupBatches() BackupBatchInformer { + return &backupBatchInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + // BackupBlueprints returns a BackupBlueprintInformer. func (v *version) BackupBlueprints() BackupBlueprintInformer { return &backupBlueprintInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/client/listers/stash/v1beta1/backupbatch.go b/client/listers/stash/v1beta1/backupbatch.go new file mode 100644 index 000000000..78df177b2 --- /dev/null +++ b/client/listers/stash/v1beta1/backupbatch.go @@ -0,0 +1,94 @@ +/* +Copyright 2019 The Stash Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" +) + +// BackupBatchLister helps list BackupBatches. +type BackupBatchLister interface { + // List lists all BackupBatches in the indexer. + List(selector labels.Selector) (ret []*v1beta1.BackupBatch, err error) + // BackupBatches returns an object that can list and get BackupBatches. + BackupBatches(namespace string) BackupBatchNamespaceLister + BackupBatchListerExpansion +} + +// backupBatchLister implements the BackupBatchLister interface. +type backupBatchLister struct { + indexer cache.Indexer +} + +// NewBackupBatchLister returns a new BackupBatchLister. +func NewBackupBatchLister(indexer cache.Indexer) BackupBatchLister { + return &backupBatchLister{indexer: indexer} +} + +// List lists all BackupBatches in the indexer. +func (s *backupBatchLister) List(selector labels.Selector) (ret []*v1beta1.BackupBatch, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.BackupBatch)) + }) + return ret, err +} + +// BackupBatches returns an object that can list and get BackupBatches. +func (s *backupBatchLister) BackupBatches(namespace string) BackupBatchNamespaceLister { + return backupBatchNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// BackupBatchNamespaceLister helps list and get BackupBatches. +type BackupBatchNamespaceLister interface { + // List lists all BackupBatches in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1beta1.BackupBatch, err error) + // Get retrieves the BackupBatch from the indexer for a given namespace and name. + Get(name string) (*v1beta1.BackupBatch, error) + BackupBatchNamespaceListerExpansion +} + +// backupBatchNamespaceLister implements the BackupBatchNamespaceLister +// interface. +type backupBatchNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all BackupBatches in the indexer for a given namespace. +func (s backupBatchNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.BackupBatch, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.BackupBatch)) + }) + return ret, err +} + +// Get retrieves the BackupBatch from the indexer for a given namespace and name. +func (s backupBatchNamespaceLister) Get(name string) (*v1beta1.BackupBatch, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("backupbatch"), name) + } + return obj.(*v1beta1.BackupBatch), nil +} diff --git a/client/listers/stash/v1beta1/expansion_generated.go b/client/listers/stash/v1beta1/expansion_generated.go index 76ca17af6..3a438c5d4 100644 --- a/client/listers/stash/v1beta1/expansion_generated.go +++ b/client/listers/stash/v1beta1/expansion_generated.go @@ -18,6 +18,14 @@ limitations under the License. package v1beta1 +// BackupBatchListerExpansion allows custom methods to be added to +// BackupBatchLister. +type BackupBatchListerExpansion interface{} + +// BackupBatchNamespaceListerExpansion allows custom methods to be added to +// BackupBatchNamespaceLister. +type BackupBatchNamespaceListerExpansion interface{} + // BackupBlueprintListerExpansion allows custom methods to be added to // BackupBlueprintLister. type BackupBlueprintListerExpansion interface{} diff --git a/hack/gencrd/main.go b/hack/gencrd/main.go index 3c266402a..c9bf528fc 100755 --- a/hack/gencrd/main.go +++ b/hack/gencrd/main.go @@ -48,6 +48,7 @@ func generateCRDDefinitions() { stashv1beta1.Function{}.CustomResourceDefinition(), stashv1beta1.BackupConfiguration{}.CustomResourceDefinition(), stashv1beta1.BackupSession{}.CustomResourceDefinition(), + stashv1beta1.BackupBatch{}.CustomResourceDefinition(), stashv1beta1.BackupBlueprint{}.CustomResourceDefinition(), stashv1beta1.RestoreSession{}.CustomResourceDefinition(), stashv1beta1.Task{}.CustomResourceDefinition(), @@ -113,6 +114,7 @@ func generateSwaggerJson() { // v1beta1 resources {stashv1beta1.SchemeGroupVersion, stashv1beta1.ResourcePluralBackupConfiguration, stashv1beta1.ResourceKindBackupConfiguration, true}, {stashv1beta1.SchemeGroupVersion, stashv1beta1.ResourceKindBackupSession, stashv1beta1.ResourceKindBackupSession, true}, + {stashv1beta1.SchemeGroupVersion, stashv1beta1.ResourceKindBackupBatch, stashv1beta1.ResourceKindBackupBatch, false}, {stashv1beta1.SchemeGroupVersion, stashv1beta1.ResourceKindBackupBlueprint, stashv1beta1.ResourceKindBackupBlueprint, false}, {stashv1beta1.SchemeGroupVersion, stashv1beta1.ResourcePluralRestoreSession, stashv1beta1.ResourceKindRestoreSession, true}, {stashv1beta1.SchemeGroupVersion, stashv1beta1.ResourceKindFunction, stashv1beta1.ResourceKindFunction, false},