Skip to content

Commit

Permalink
Merge pull request #2068 from bertinatto/last-generation-only-increase
Browse files Browse the repository at this point in the history
Last generation only increase
  • Loading branch information
openshift-merge-bot[bot] authored Oct 18, 2024
2 parents 92a3906 + ed4d7cd commit 4f6053f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions operator/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down

0 comments on commit 4f6053f

Please sign in to comment.