forked from openshift/origin
/
oc_copy.go
75 lines (58 loc) · 2.43 KB
/
oc_copy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package operators
import (
"github.com/docker/distribution"
digest "github.com/opencontainers/go-digest"
imageapi "github.com/openshift/api/image/v1"
"github.com/openshift/library-go/pkg/image/dockerv1client"
imagereference "github.com/openshift/library-go/pkg/image/reference"
)
type CincinnatiMetadata struct {
Kind string `json:"kind"`
Version string `json:"version"`
Previous []string `json:"previous"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
type ReleaseDiff struct {
From *ReleaseInfo `json:"from"`
To *ReleaseInfo `json:"to"`
ChangedImages map[string]*ImageReferenceDiff `json:"changedImages"`
ChangedManifests map[string]*ReleaseManifestDiff `json:"changedManifests"`
}
type ImageReferenceDiff struct {
Name string `json:"name"`
From *imageapi.TagReference `json:"from"`
To *imageapi.TagReference `json:"to"`
}
type ReleaseManifestDiff struct {
Filename string `json:"filename"`
From []byte `json:"from"`
To []byte `json:"to"`
}
type ReleaseInfo struct {
Image string `json:"image"`
ImageRef imagereference.DockerImageReference `json:"-"`
Digest digest.Digest `json:"digest"`
ContentDigest digest.Digest `json:"contentDigest"`
// TODO: return the list digest in the future
// ListDigest digest.Digest `json:"listDigest"`
Config *dockerv1client.DockerImageConfig `json:"config"`
Metadata *CincinnatiMetadata `json:"metadata"`
References *imageapi.ImageStream `json:"references"`
ComponentVersions map[string]string `json:"versions"`
Images map[string]*Image `json:"images"`
RawMetadata map[string][]byte `json:"-"`
ManifestFiles map[string][]byte `json:"-"`
UnknownFiles []string `json:"-"`
Warnings []string `json:"warnings"`
}
type Image struct {
Name string `json:"name"`
Ref imagereference.DockerImageReference `json:"-"`
Digest digest.Digest `json:"digest"`
ContentDigest digest.Digest `json:"contentDigest"`
ListDigest digest.Digest `json:"listDigest"`
MediaType string `json:"mediaType"`
Layers []distribution.Descriptor `json:"layers"`
Config *dockerv1client.DockerImageConfig `json:"config"`
Manifest distribution.Manifest `json:"-"`
}