Skip to content

Commit a962ec5

Browse files
committed
feat(parameters): track parameterview submission results
1 parent ff5b534 commit a962ec5

File tree

7 files changed

+584
-15
lines changed

7 files changed

+584
-15
lines changed

apis/parameters/v1alpha1/parameterview_types.go

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,35 @@ type ParameterViewSubmission struct {
192192
//
193193
// +optional
194194
Parameters ParameterValueMap `json:"parameters,omitempty"`
195+
196+
// Result records the current observed outcome of this submission after it has
197+
// been handed off to the ComponentParameter controller.
198+
//
199+
// +optional
200+
Result ParameterViewSubmissionResult `json:"result,omitempty"`
201+
}
202+
203+
// ParameterViewSubmissionResult records the current observed outcome of a submission.
204+
type ParameterViewSubmissionResult struct {
205+
// Phase describes the current execution state of this submission.
206+
//
207+
// +optional
208+
Phase ParameterViewSubmissionPhase `json:"phase,omitempty"`
209+
210+
// Reason is a stable, machine-friendly summary for the current submission result.
211+
//
212+
// +optional
213+
Reason string `json:"reason,omitempty"`
214+
215+
// Message provides a human-readable summary for the current submission result.
216+
//
217+
// +optional
218+
Message string `json:"message,omitempty"`
219+
220+
// UpdatedAt records when the result was last refreshed by the controller.
221+
//
222+
// +optional
223+
UpdatedAt *metav1.Time `json:"updatedAt,omitempty"`
195224
}
196225

197226
// ParameterViewMode defines whether a ParameterView can be edited.
@@ -232,6 +261,26 @@ const (
232261
ParameterViewApplyingPhase ParameterViewPhase = "Applying"
233262
)
234263

264+
// ParameterViewSubmissionPhase defines the observed execution state of a submission.
265+
// +enum
266+
// +kubebuilder:validation:Enum={Processing,Failed,Succeeded}
267+
type ParameterViewSubmissionPhase string
268+
269+
const (
270+
// ParameterViewSubmissionProcessingPhase means the submission has already
271+
// been handed off to the ComponentParameter controller, and its final
272+
// execution outcome is not known yet.
273+
ParameterViewSubmissionProcessingPhase ParameterViewSubmissionPhase = "Processing"
274+
275+
// ParameterViewSubmissionFailedPhase means the submission has reached a final
276+
// failure outcome in the ComponentParameter processing chain.
277+
ParameterViewSubmissionFailedPhase ParameterViewSubmissionPhase = "Failed"
278+
279+
// ParameterViewSubmissionSucceededPhase means the submission has reached a
280+
// final successful outcome in the ComponentParameter processing chain.
281+
ParameterViewSubmissionSucceededPhase ParameterViewSubmissionPhase = "Succeeded"
282+
)
283+
235284
// ParameterViewContent describes the editable document shown to users.
236285
type ParameterViewContent struct {
237286
// Type declares how Text should be parsed and rendered.

apis/parameters/v1alpha1/zz_generated.deepcopy.go

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

config/crd/bases/parameters.kubeblocks.io_parameterviews.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,33 @@ spec:
309309
description: Parameters contains the desired parameter updates
310310
submitted from the view.
311311
type: object
312+
result:
313+
description: |-
314+
Result records the current observed outcome of this submission after it has
315+
been handed off to the ComponentParameter controller.
316+
properties:
317+
message:
318+
description: Message provides a human-readable summary for
319+
the current submission result.
320+
type: string
321+
phase:
322+
description: Phase describes the current execution state
323+
of this submission.
324+
enum:
325+
- Processing
326+
- Failed
327+
- Succeeded
328+
type: string
329+
reason:
330+
description: Reason is a stable, machine-friendly summary
331+
for the current submission result.
332+
type: string
333+
updatedAt:
334+
description: UpdatedAt records when the result was last
335+
refreshed by the controller.
336+
format: date-time
337+
type: string
338+
type: object
312339
revision:
313340
description: Revision records the effective content revision
314341
that the submission was based on.

0 commit comments

Comments
 (0)