Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To add reconciliation time stamps #572

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cyclops-ctrl/api/v1alpha1/module_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ type ReconciliationStatus struct {
// +kubebuilder:validation:Optional
Reason string `json:"reason,omitempty"`
// +kubebuilder:validation:Optional
Errors []string `json:"errors"`
Errors []string `json:"errors"`
FinishedAt string `json:"finishedAt,omitempty"`
Abiji-2020 marked this conversation as resolved.
Show resolved Hide resolved
}

type GroupVersionResource struct {
Expand Down Expand Up @@ -94,6 +95,7 @@ type HistoryEntry struct {
Generation int64 `json:"generation"`
TemplateRef HistoryTemplateRef `json:"template"`
Values apiextensionsv1.JSON `json:"values"`
FinishedAt string `json:"finishedAt,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
6 changes: 5 additions & 1 deletion cyclops-ctrl/config/crd/bases/cyclops-ui.com_modules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ spec:
history:
items:
properties:
finishedAt:
type: string
generation:
format: int64
type: integer
Expand Down Expand Up @@ -113,6 +115,8 @@ spec:
items:
type: string
type: array
finishedAt:
type: string
reason:
type: string
status:
Expand All @@ -122,7 +126,7 @@ spec:
- succeeded
- failed
type: string
type: object
required:
templateResolvedVersion:
type: string
required:
Expand Down
7 changes: 4 additions & 3 deletions cyclops-ctrl/internal/modulecontroller/module_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,10 @@ func (r *ModuleReconciler) setStatus(

module.Status = cyclopsv1alpha1.ModuleStatus{
ReconciliationStatus: cyclopsv1alpha1.ReconciliationStatus{
Status: status,
Reason: reason,
Errors: installErrors,
Status: status,
Reason: reason,
Errors: installErrors,
FinishedAt: time.Now().Format(time.RFC3339), // Convert time to string format
},
ManagedGVRs: r.mergeChildrenGVRs(module.Status.ManagedGVRs, childrenResources),
TemplateResolvedVersion: templateResolvedVersion,
Expand Down