api: Make ExternalArtifact conform to runtime Getter/Setter interface

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan 2025-09-05 22:53:08 +03:00
parent 5f4f360a0d
commit 8d7ef1d5bf
No known key found for this signature in database
GPG Key ID: 3299AEB0E4085BAF
1 changed files with 14 additions and 4 deletions

View File

@ -46,10 +46,14 @@ type ExternalArtifactStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty"` Conditions []metav1.Condition `json:"conditions,omitempty"`
} }
// GetRequeueAfter returns the duration after which the ExternalArtifact // GetConditions returns the status conditions of the object.
// must be reconciled again. func (in *ExternalArtifact) GetConditions() []metav1.Condition {
func (in ExternalArtifact) GetRequeueAfter() time.Duration { return in.Status.Conditions
return time.Minute }
// SetConditions sets the status conditions on the object.
func (in *ExternalArtifact) SetConditions(conditions []metav1.Condition) {
in.Status.Conditions = conditions
} }
// GetArtifact returns the latest Artifact from the ExternalArtifact if // GetArtifact returns the latest Artifact from the ExternalArtifact if
@ -58,6 +62,12 @@ func (in *ExternalArtifact) GetArtifact() *meta.Artifact {
return in.Status.Artifact return in.Status.Artifact
} }
// GetRequeueAfter returns the duration after which the ExternalArtifact
// must be reconciled again.
func (in *ExternalArtifact) GetRequeueAfter() time.Duration {
return time.Minute
}
// +kubebuilder:object:root=true // +kubebuilder:object:root=true
// +kubebuilder:subresource:status // +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description=""