You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
iflen(destSupportedManifestMIMETypes) ==0 { // Coverage: This should never happen, empty values were replaced by ociEncryptionMIMETypes
100
+
returnmanifestConversionPlan{}, errors.New("internal error: destSupportedManifestMIMETypes is empty")
101
+
}
102
+
// We know, and have verified, that destSupportedManifestMIMETypes is not empty, so encryption must have been involved.
103
+
if!in.requiresOCIEncryption { // Coverage: This should never happen, destSupportedManifestMIMETypes was not empty, so we should have filtered for encryption.
104
+
returnmanifestConversionPlan{}, errors.New("internal error: supportedByDest is empty but destSupportedManifestMIMETypes is not, and not encrypting")
105
+
}
106
+
// destSupportedManifestMIMETypes has three possible origins:
// Finally, try anything else the destination supports.
124
152
for_, t:=rangedestSupportedManifestMIMETypes {
125
-
prioritizedTypes.append(t)
153
+
ifsupportedByDest.Contains(t) {
154
+
prioritizedTypes.append(t)
155
+
}
126
156
}
127
157
128
158
logrus.Debugf("Manifest has MIME type %s, ordered candidate list [%s]", srcType, strings.Join(prioritizedTypes.list, ", "))
129
-
iflen(prioritizedTypes.list) ==0 { // Coverage: destSupportedManifestMIMETypes is not empty (or we would have exited in the “Anything goes” case above), so this should never happen.
159
+
iflen(prioritizedTypes.list) ==0 { // Coverage: destSupportedManifestMIMETypes and supportedByDest, which is a subset, is not empty (or we would have exited above), so this should never happen.
130
160
returnmanifestConversionPlan{}, errors.New("Internal error: no candidate MIME types")
0 commit comments