Skip to content
Merged
Changes from all 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
17 changes: 17 additions & 0 deletions api/v1/externalartifact_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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=""
Expand Down