Skip to content

Commit

Permalink
generate manifests and CRD definition
Browse files Browse the repository at this point in the history
  • Loading branch information
600lyy authored and maqiuyujoyce committed Jun 20, 2024
1 parent 721fd7c commit 15f6ca1
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,23 @@ spec:
required:
- retentionPeriod
type: object
softDeletePolicy:
description: The bucket's soft delete policy, which defines the period
of time that soft-deleted objects will be retained, and cannot be
permanently deleted. If it is not provided, by default Google Cloud
Storage sets this to default soft delete policy.
properties:
effectiveTime:
description: Server-determined value that indicates the time from
which the policy, or one with a greater retention, was effective.
This value is in RFC 3339 format.
type: string
retentionDurationSeconds:
description: The duration in seconds that soft-deleted objects
in the bucket will be retained and cannot be permanently deleted.
Default value is 604800.
type: integer
type: object
storageClass:
description: 'The Storage Class of the new bucket. Supported values
include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE,
Expand Down Expand Up @@ -353,6 +370,27 @@ spec:
current reported status reflects the most recent desired state of
the resource.
type: integer
observedState:
description: The observed state of the underlying GCP resource.
properties:
softDeletePolicy:
description: The bucket's soft delete policy, which defines the
period of time that soft-deleted objects will be retained, and
cannot be permanently deleted. If it is not provided, by default
Google Cloud Storage sets this to default soft delete policy.
properties:
effectiveTime:
description: Server-determined value that indicates the time
from which the policy, or one with a greater retention,
was effective. This value is in RFC 3339 format.
type: string
retentionDurationSeconds:
description: The duration in seconds that soft-deleted objects
in the bucket will be retained and cannot be permanently
deleted. Default value is 604800.
type: integer
type: object
type: object
selfLink:
description: The URI of the created resource.
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ spec:
method: ["GET", "HEAD", "DELETE"]
maxAgeSeconds: 3600
uniformBucketLevelAccess: true
softDeletePolicy:
retentionDurationSeconds: 604800
3 changes: 3 additions & 0 deletions config/servicemappings/storage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ spec:
labels: labels
resourceID:
targetField: name
observedFields:
- soft_delete_policy.effective_time
- soft_delete_policy.retention_duration_seconds
idTemplate: "{{name}}"
# odd resource where the project is 'optional', needs more thought -- also not supported by gcloud (yet), problem applies to all Storage resources
idTemplateCanBeUsedToMatchResourceName: false
Expand Down
14 changes: 14 additions & 0 deletions pkg/clients/generated/apis/storage/v1beta1/storagebucket_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ spec:
type: Delete
condition:
age: 7
softDeletePolicy:
retentionDurationSeconds: 604800
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ spec:
versioning:
enabled: true
lifecycleRule: []
softDeletePolicy:
retentionDurationSeconds: 0
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ resourceID: string
retentionPolicy:
isLocked: boolean
retentionPeriod: integer
softDeletePolicy:
effectiveTime: string
retentionDurationSeconds: integer
storageClass: string
uniformBucketLevelAccess: boolean
versioning:
Expand Down Expand Up @@ -684,6 +687,36 @@ Enables Bucket PolicyOnly access to a bucket.{% endverbatim %}</p>
<p>{% verbatim %}The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 3,155,760,000 seconds.{% endverbatim %}</p>
</td>
</tr>
<tr>
<td>
<p><code>softDeletePolicy</code></p>
<p><i>Optional</i></p>
</td>
<td>
<p><code class="apitype">object</code></p>
<p>{% verbatim %}The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. If it is not provided, by default Google Cloud Storage sets this to default soft delete policy.{% endverbatim %}</p>
</td>
</tr>
<tr>
<td>
<p><code>softDeletePolicy.effectiveTime</code></p>
<p><i>Optional</i></p>
</td>
<td>
<p><code class="apitype">string</code></p>
<p>{% verbatim %}Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.{% endverbatim %}</p>
</td>
</tr>
<tr>
<td>
<p><code>softDeletePolicy.retentionDurationSeconds</code></p>
<p><i>Optional</i></p>
</td>
<td>
<p><code class="apitype">integer</code></p>
<p>{% verbatim %}The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Default value is 604800.{% endverbatim %}</p>
</td>
</tr>
<tr>
<td>
<p><code>storageClass</code></p>
Expand Down

0 comments on commit 15f6ca1

Please sign in to comment.