From ed4d7cd1ebac44e9919cbb2273bb7f8bbb655152 Mon Sep 17 00:00:00 2001 From: Fabio Bertinatto Date: Thu, 17 Oct 2024 14:57:29 -0300 Subject: [PATCH] Add note about validation of Generations.LastGeneration field --- operator/v1/types.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/operator/v1/types.go b/operator/v1/types.go index 8d6f4b7484f..f04b6846aee 100644 --- a/operator/v1/types.go +++ b/operator/v1/types.go @@ -147,17 +147,27 @@ type GenerationStatus struct { // group is the group of the thing you're tracking // +kubebuilder:validation:Required Group string `json:"group"` + // resource is the resource type of the thing you're tracking // +kubebuilder:validation:Required Resource string `json:"resource"` + // namespace is where the thing you're tracking is // +kubebuilder:validation:Required Namespace string `json:"namespace"` + // name is the name of the thing you're tracking // +kubebuilder:validation:Required Name string `json:"name"` + + // TODO: Add validation for lastGeneration. The value for this field should generally increase, except when the associated + // resource has been deleted and re-created. To accurately validate this field, we should introduce a new UID field and only + // enforce an increasing value in lastGeneration when the UID remains unchanged. A change in the UID indicates that the resource + // was re-created, allowing the lastGeneration value to reset or decrease. + // lastGeneration is the last generation of the workload controller involved LastGeneration int64 `json:"lastGeneration"` + // hash is an optional field set for resources without generation that are content sensitive like secrets and configmaps Hash string `json:"hash"` }