Skip to content

Commit fe19a0f

Browse files
authored
Prepare for release v0.4.0 (#15)
ProductLine: Stash Release: v2022.07.09 Release-tracker: stashed/CHANGELOG#53 Signed-off-by: 1gtm <1gtm@appscode.com>
1 parent dbe1690 commit fe19a0f

12 files changed

+280
-38
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
kmodules.xyz/custom-resources v0.24.0
2222
kmodules.xyz/resource-metrics v0.10.1
2323
sigs.k8s.io/controller-runtime v0.12.1
24-
stash.appscode.dev/apimachinery v0.21.0
24+
stash.appscode.dev/apimachinery v0.22.0
2525
)
2626

2727
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,5 +1176,5 @@ sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZa
11761176
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
11771177
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
11781178
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
1179-
stash.appscode.dev/apimachinery v0.21.0 h1:uK4IAuT3+V7b2/sQAWslQ3iT8agN6qgy58gg9W51rhk=
1180-
stash.appscode.dev/apimachinery v0.21.0/go.mod h1:mtxrytXCX8271F5xVMKTwVPoERs6XbhLZlhRKJU08uI=
1179+
stash.appscode.dev/apimachinery v0.22.0 h1:h3Y9fGlD5oNzvPpX9VmvNjsy6u8jsNZjZ2HRgRlCWkE=
1180+
stash.appscode.dev/apimachinery v0.22.0/go.mod h1:uzKMOt8OxE5YpSjRPR6DCkUA+Wn8McXQNPSaVARB0GM=

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ sigs.k8s.io/structured-merge-diff/v4/value
13131313
# sigs.k8s.io/yaml v1.3.0
13141314
## explicit; go 1.12
13151315
sigs.k8s.io/yaml
1316-
# stash.appscode.dev/apimachinery v0.21.0
1316+
# stash.appscode.dev/apimachinery v0.22.0
13171317
## explicit; go 1.18
13181318
stash.appscode.dev/apimachinery/apis/stash
13191319
stash.appscode.dev/apimachinery/apis/stash/install

vendor/stash.appscode.dev/apimachinery/apis/stash/v1beta1/backup_configuration_types.go

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,30 @@ type BackupHooks struct {
114114
// +optional
115115
PreBackup *prober.Handler `json:"preBackup,omitempty"`
116116

117-
// PostBackup is called immediately after a backup session is complete.
117+
// PostBackup is called according to executionPolicy after a backup session is complete.
118118
// +optional
119-
PostBackup *prober.Handler `json:"postBackup,omitempty"`
119+
PostBackup PostBackupHook `json:"postBackup,omitempty"`
120120
}
121121

122+
type PostBackupHook struct {
123+
*prober.Handler `json:",inline"`
124+
// ExecutionPolicy specifies when to execute a hook.
125+
// Supported values are "Always", "OnFailure", "OnSuccess".
126+
// Default value: "Always".
127+
// +optional
128+
// +kubebuilder:default=Always
129+
// +kubebuilder:validation:Enum=Always;OnFailure;OnSuccess
130+
ExecutionPolicy HookExecutionPolicy `json:"executionPolicy,omitempty"`
131+
}
132+
133+
type HookExecutionPolicy string
134+
135+
const (
136+
ExecuteAlways HookExecutionPolicy = "Always"
137+
ExecuteOnFailure HookExecutionPolicy = "OnFailure"
138+
ExecuteOnSuccess HookExecutionPolicy = "OnSuccess"
139+
)
140+
122141
type EmptyDirSettings struct {
123142
Medium core.StorageMedium `json:"medium,omitempty"`
124143
SizeLimit *resource.Quantity `json:"sizeLimit,omitempty"`

vendor/stash.appscode.dev/apimachinery/apis/stash/v1beta1/openapi_generated.go

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

vendor/stash.appscode.dev/apimachinery/apis/stash/v1beta1/restore_session_types.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,20 @@ type RestoreHooks struct {
100100
// +optional
101101
PreRestore *prober.Handler `json:"preRestore,omitempty"`
102102

103-
// PostRestore is called immediately after a restore session is complete.
103+
// PostRestore is called according to executionPolicy after a restore session is complete.
104104
// +optional
105-
PostRestore *prober.Handler `json:"postRestore,omitempty"`
105+
PostRestore PostRestoreHook `json:"postRestore,omitempty"`
106+
}
107+
108+
type PostRestoreHook struct {
109+
*prober.Handler `json:",inline"`
110+
// ExecutionPolicy specifies when to execute a hook.
111+
// Supported values are "Always", "OnFailure", "OnSuccess".
112+
// Default value is "Always".
113+
// +optional
114+
// +kubebuilder:default=Always
115+
// +kubebuilder:validation:Enum=Always;OnFailure;OnSuccess
116+
ExecutionPolicy HookExecutionPolicy `json:"executionPolicy,omitempty"`
106117
}
107118

108119
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

vendor/stash.appscode.dev/apimachinery/apis/stash/v1beta1/zz_generated.deepcopy.go

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

vendor/stash.appscode.dev/apimachinery/crds/stash.appscode.com_backupbatches.yaml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ spec:
7676
sessions. Cannot be updated.
7777
properties:
7878
postBackup:
79-
description: PostBackup is called immediately after a backup session
80-
is complete.
79+
description: PostBackup is called according to executionPolicy
80+
after a backup session is complete.
8181
properties:
8282
containerName:
8383
description: ContainerName specifies the name of the container
@@ -101,6 +101,16 @@ spec:
101101
type: string
102102
type: array
103103
type: object
104+
executionPolicy:
105+
default: Always
106+
description: 'ExecutionPolicy specifies when to execute a
107+
hook. Supported values are "Always", "OnFailure", "OnSuccess".
108+
Default value: "Always".'
109+
enum:
110+
- Always
111+
- OnFailure
112+
- OnSuccess
113+
type: string
104114
httpGet:
105115
description: HTTPGet specifies the http Get request to perform.
106116
properties:
@@ -386,8 +396,8 @@ spec:
386396
sessions.
387397
properties:
388398
postBackup:
389-
description: PostBackup is called immediately after a backup
390-
session is complete.
399+
description: PostBackup is called according to executionPolicy
400+
after a backup session is complete.
391401
properties:
392402
containerName:
393403
description: ContainerName specifies the name of the
@@ -412,6 +422,16 @@ spec:
412422
type: string
413423
type: array
414424
type: object
425+
executionPolicy:
426+
default: Always
427+
description: 'ExecutionPolicy specifies when to execute
428+
a hook. Supported values are "Always", "OnFailure",
429+
"OnSuccess". Default value: "Always".'
430+
enum:
431+
- Always
432+
- OnFailure
433+
- OnSuccess
434+
type: string
415435
httpGet:
416436
description: HTTPGet specifies the http Get request
417437
to perform.

0 commit comments

Comments
 (0)