2.6 KiB
2.6 KiB
Common
Common defines resources used across types.
Specification
Source status
Source objects should contain a status sub-resource that embeds an artifact object:
// Artifact represents the output of a source synchronisation
type Artifact struct {
// Path is the local file path of this artifact.
// +required
Path string `json:"path"`
// URL is the HTTP address of this artifact.
// +required
URL string `json:"url"`
// Revision is a human readable identifier traceable in the origin source system.
// It can be a commit sha, git tag, a helm index timestamp,
// a helm chart version, a checksum, etc.
// +optional
Revision string `json:"revision"`
// LastUpdateTime is the timestamp corresponding to the last
// update of this artifact.
// +required
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
}
Source condition
Note: to be replaced with https://github.com/kubernetes/enhancements/pull/1624 once made available.
// SourceCondition contains condition information for a source.
type SourceCondition struct {
// Type of the condition, currently ('Ready').
// +required
Type string `json:"type"`
// Status of the condition, one of ('True', 'False', 'Unknown').
// +required
Status corev1.ConditionStatus `json:"status"`
// LastTransitionTime is the timestamp corresponding to the last status
// change of this condition.
// +required
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
// Reason is a brief machine readable explanation for the condition's last
// transition.
// +required
Reason string `json:"reason,omitempty"`
// Message is a human readable description of the details of the last
// transition, complementing reason.
// +optional
Message string `json:"message,omitempty"`
}
Types
const (
// ReadyCondition represents the fact that a given source is in ready state.
ReadyCondition string = "Ready"
)
Reasons
const (
// InitializingReason represents the fact that a given source is being initialized.
InitializingReason string = "Initializing"
// URLInvalidReason represents the fact that a given source has an invalid URL.
URLInvalidReason string = "URLInvalid"
// StorageOperationFailedReason signals a failure caused by a storage operation.
StorageOperationFailedReason string = "StorageOperationFailed"
// AuthenticationFailedReason represents the fact that the provided credentials are not valid.
AuthenticationFailedReason string = "AuthenticationFailed"
)
Examples
See the Git repository and Helm chart APIs.