@@ -23,37 +23,41 @@ import (
2323 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2424)
2525
26- // Artifact represents the output of a source synchronisation
26+ // Artifact represents the output of a source synchronisation.
2727type Artifact struct {
28- // Path is the local file path of this artifact.
28+ // Path is the relative file path of this artifact.
2929 // +required
3030 Path string `json:"path"`
3131
3232 // URL is the HTTP address of this artifact.
3333 // +required
3434 URL string `json:"url"`
3535
36- // Revision is a human readable identifier traceable in the origin source system.
37- // It can be a commit sha, git tag, a helm index timestamp,
38- // a helm chart version, a checksum , etc.
36+ // Revision is a human readable identifier traceable in the origin
37+ // source system. It can be a Git commit sha, Git tag, a Helm index
38+ // timestamp, a Helm chart version, etc.
3939 // +optional
4040 Revision string `json:"revision"`
4141
42+ // Checksum is the SHA1 checksum of the artifact.
43+ // +optional
44+ Checksum string `json:"checksum"`
45+
4246 // LastUpdateTime is the timestamp corresponding to the last
4347 // update of this artifact.
4448 // +required
4549 LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
4650}
4751
4852// ArtifactDir returns the artifact dir path in the form of
49- // <source-kind>/<source-namespace>/<source-name>
53+ // <source-kind>/<source-namespace>/<source-name>.
5054func ArtifactDir (kind , namespace , name string ) string {
5155 kind = strings .ToLower (kind )
5256 return path .Join (kind , namespace , name )
5357}
5458
5559// ArtifactPath returns the artifact path in the form of
56- // <source-kind>/<source-namespace>/<source-name>/<artifact-filename>
60+ // <source-kind>/<source-namespace>/<source-name>/<artifact-filename>.
5761func ArtifactPath (kind , namespace , name , filename string ) string {
5862 return path .Join (ArtifactDir (kind , namespace , name ), filename )
5963}
0 commit comments