api: Make ExternalArtifact conform to the Source interface
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
cf7222108c
commit
48806528b7
|
@ -17,11 +17,16 @@ limitations under the License.
|
|||
package v1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/fluxcd/pkg/apis/meta"
|
||||
)
|
||||
|
||||
// ExternalArtifactKind is the string representation of the ExternalArtifact.
|
||||
const ExternalArtifactKind = "ExternalArtifact"
|
||||
|
||||
// ExternalArtifactSpec defines the desired state of ExternalArtifact
|
||||
type ExternalArtifactSpec struct {
|
||||
// SourceRef points to the Kubernetes custom resource for
|
||||
|
@ -41,6 +46,18 @@ type ExternalArtifactStatus struct {
|
|||
Conditions []metav1.Condition `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// GetRequeueAfter returns the duration after which the ExternalArtifact
|
||||
// must be reconciled again.
|
||||
func (in ExternalArtifact) GetRequeueAfter() time.Duration {
|
||||
return time.Minute
|
||||
}
|
||||
|
||||
// GetArtifact returns the latest Artifact from the ExternalArtifact if
|
||||
// present in the status sub-resource.
|
||||
func (in *ExternalArtifact) GetArtifact() *meta.Artifact {
|
||||
return in.Status.Artifact
|
||||
}
|
||||
|
||||
// +kubebuilder:object:root=true
|
||||
// +kubebuilder:subresource:status
|
||||
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description=""
|
||||
|
|
Loading…
Reference in New Issue