@@ -13,8 +13,10 @@ import (
13
13
"path/filepath"
14
14
)
15
15
16
+ // Type of registry
16
17
type RegistryType string
17
18
19
+ // Registries const
18
20
const (
19
21
Docker RegistryType = "Docker"
20
22
ECR RegistryType = "ECR"
@@ -27,22 +29,26 @@ const (
27
29
)
28
30
29
31
type (
32
+ // Image stores the image data
30
33
Image struct {
31
34
Image string `json:"image"`
32
35
Digest string `json:"digest"`
33
36
}
37
+ // Date stores the registry data
34
38
Data struct {
35
39
RegistryType RegistryType `json:"registryType"`
36
40
RegistryUrl string `json:"registryUrl"`
37
41
Images []Image `json:"images"`
38
42
}
43
+ // DockerArtifact is the current artifact
39
44
DockerArtifact struct {
40
45
Kind string `json:"kind"`
41
46
Data Data `json:"data"`
42
47
}
43
48
)
44
49
45
- func WritePluginArtifactFile (registryType RegistryType , artifactFilePath , registryUrl , imageName , digest string , tags []string ) error {
50
+ // WritePluginArtifactFile writes the docker artifact data to the provided artifact file
51
+ func WritePluginArtifactFile (registryType RegistryType , artifactFilePath , registryURL , imageName , digest string , tags []string ) error {
46
52
var images []Image
47
53
for _ , tag := range tags {
48
54
images = append (images , Image {
@@ -52,7 +58,7 @@ func WritePluginArtifactFile(registryType RegistryType, artifactFilePath, regist
52
58
}
53
59
data := Data {
54
60
RegistryType : registryType ,
55
- RegistryUrl : registryUrl ,
61
+ RegistryUrl : registryURL ,
56
62
Images : images ,
57
63
}
58
64
0 commit comments