@@ -96,3 +96,75 @@ type ExecEnvVar struct {
96
96
Name string `json:"name"`
97
97
Value string `json:"value"`
98
98
}
99
+
100
+ // ImagePullIntent is a record of the kubelet attempting to pull an image.
101
+ //
102
+ // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
103
+ type ImagePullIntent struct {
104
+ metav1.TypeMeta `json:",inline"`
105
+
106
+ // Image is the image spec from a Container's `image` field.
107
+ // The filename is a SHA-256 hash of this value. This is to avoid filename-unsafe
108
+ // characters like ':' and '/'.
109
+ Image string `json:"image"`
110
+ }
111
+
112
+ // ImagePullRecord is a record of an image that was pulled by the kubelet.
113
+ //
114
+ // If there are no records in the `kubernetesSecrets` field and both `nodeWideCredentials`
115
+ // and `anonymous` are `false`, credentials must be re-checked the next time an
116
+ // image represented by this record is being requested.
117
+ //
118
+ // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
119
+ type ImagePulledRecord struct {
120
+ metav1.TypeMeta `json:",inline"`
121
+
122
+ // LastUpdatedTime is the time of the last update to this record
123
+ LastUpdatedTime metav1.Time `json:"lastUpdatedTime"`
124
+
125
+ // ImageRef is a reference to the image represented by this file as received
126
+ // from the CRI.
127
+ // The filename is a SHA-256 hash of this value. This is to avoid filename-unsafe
128
+ // characters like ':' and '/'.
129
+ ImageRef string `json:"imageRef"`
130
+
131
+ // CredentialMapping maps `image` to the set of credentials that it was
132
+ // previously pulled with.
133
+ // `image` in this case is the content of a pod's container `image` field that's
134
+ // got its tag/digest removed.
135
+ //
136
+ // Example:
137
+ // Container requests the `hello-world:latest@sha256:91fb4b041da273d5a3273b6d587d62d518300a6ad268b28628f74997b93171b2` image:
138
+ // "credentialMapping": {
139
+ // "hello-world": { "nodePodsAccessible": true }
140
+ // }
141
+ CredentialMapping map [string ]ImagePullCredentials `json:"credentialMapping,omitempty"`
142
+ }
143
+
144
+ // ImagePullCredentials describe credentials that can be used to pull an image.
145
+ type ImagePullCredentials struct {
146
+ // KuberneteSecretCoordinates is an index of coordinates of all the kubernetes
147
+ // secrets that were used to pull the image.
148
+ // +optional
149
+ // +listType=set
150
+ KubernetesSecrets []ImagePullSecret `json:"kubernetesSecrets"`
151
+
152
+ // NodePodsAccessible is a flag denoting the pull credentials are accessible
153
+ // by all the pods on the node, or that no credentials are needed for the pull.
154
+ //
155
+ // If true, it is mutually exclusive with the `kubernetesSecrets` field.
156
+ // +optional
157
+ NodePodsAccessible bool `json:"nodePodsAccessible,omitempty"`
158
+ }
159
+
160
+ // ImagePullSecret is a representation of a Kubernetes secret object coordinates along
161
+ // with a credential hash of the pull secret credentials this object contains.
162
+ type ImagePullSecret struct {
163
+ UID string `json:"uid"`
164
+ Namespace string `json:"namespace"`
165
+ Name string `json:"name"`
166
+
167
+ // CredentialHash is a SHA-256 retrieved by hashing the image pull credentials
168
+ // content of the secret specified by the UID/Namespace/Name coordinates.
169
+ CredentialHash string `json:"credentialHash"`
170
+ }
0 commit comments