Skip to content

Commit 0379778

Browse files
committed
changes for introduce a reclaim policy for ephemerally created Volume resources
1 parent 9c991b5 commit 0379778

File tree

16 files changed

+500
-28
lines changed

16 files changed

+500
-28
lines changed

api/storage/v1alpha1/volume_types.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,24 @@ type VolumeList struct {
123123
Items []Volume `json:"items"`
124124
}
125125

126+
// ReclaimPolicy for a Volume tells what to do with the volume after its managing resource has been deleted
127+
type ReclaimPolicy string
128+
129+
const (
130+
// The Volume resource is not deleted after the managing resource has been deleted
131+
Retain ReclaimPolicy = "Retain"
132+
// The Volume resource is garbage-collected when the managing resource has been deleted
133+
Delete ReclaimPolicy = "Delete"
134+
)
135+
136+
type EphemeralVolumeSpec struct {
137+
VolumeSpec `json:",inline"`
138+
// ReclaimPolicy defines the strategy for the corresponding volume resource after its managing resource has been deleted
139+
ReclaimPolicy ReclaimPolicy `json:"reclaimpolicy,omitempty"`
140+
}
141+
126142
// VolumeTemplateSpec is the specification of a Volume template.
127143
type VolumeTemplateSpec struct {
128144
metav1.ObjectMeta `json:"metadata,omitempty"`
129-
Spec VolumeSpec `json:"spec,omitempty"`
145+
Spec EphemeralVolumeSpec `json:"spec,omitempty"`
130146
}

api/storage/v1alpha1/zz_generated.deepcopy.go

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfigurations/internal/internal.go

Lines changed: 44 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfigurations/storage/v1alpha1/ephemeralvolumespec.go

Lines changed: 122 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfigurations/storage/v1alpha1/volumetemplatespec.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/applyconfigurations/utils.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/openapi/api_violations.report

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ API rule violation: names_match,github.com/ironcore-dev/ironcore/api/networking/
5454
API rule violation: names_match,github.com/ironcore-dev/ironcore/api/networking/v1alpha1,NetworkInterfaceSpec,IPs
5555
API rule violation: names_match,github.com/ironcore-dev/ironcore/api/networking/v1alpha1,NetworkInterfaceStatus,IPs
5656
API rule violation: names_match,github.com/ironcore-dev/ironcore/api/networking/v1alpha1,NetworkSpec,PeeringClaimRefs
57+
API rule violation: names_match,github.com/ironcore-dev/ironcore/api/storage/v1alpha1,EphemeralVolumeSpec,ReclaimPolicy
5758
API rule violation: names_match,k8s.io/api/core/v1,AzureDiskVolumeSource,DataDiskURI
5859
API rule violation: names_match,k8s.io/api/core/v1,ContainerStatus,LastTerminationState
5960
API rule violation: names_match,k8s.io/api/core/v1,DaemonEndpoint,Port

0 commit comments

Comments
 (0)