Whyt velero use files in directory like "resources/pods/namespaces/nginx-example" rather than "resources/pods/v1-preferredversion/namespaces/nginx-example" to restore? #3274
-
velero version : 1.5.2 Hello, I found that velero must generate file in directory like "resources/pods/namespaces/nginx-example" during the process of backup when I read code. But velero doesn't generate file in directory like "resources/pods/v1-preferredversion/namespaces/nginx-example" if the version of resource is not equal to preferredVersion. Then velero use files in the former directory to restore. I think it maybe a risk. So would you like to explain it for me ? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@nrb do you have an insight on this? |
Beta Was this translation helpful? Give feedback.
-
The difference between the two directory structures is the The directory structure, "resources/pods/namespaces/nginx-example"", uses backup format version 1.0.0. The structure "resources/pods/v1-preferredversion/namespaces/nginx-example" uses backup format version 1.1.0. Backup format version 1.1.0 (the newer one) started to be used after Velero version 1.4.0 when PR #2373 was merged. The reason the backup format was changed was to create the Enable API Group Versions feature, enabled using The EnableAPIGroupVersions feature is not enabled by default. By default, the old directory structure will be used. The new directory structure can only be used for restore once PR #3133 is merged where it will be possible to restore a non-preferred API Group Version. Hopefully, I was able to answer your question. Let me know if I can answer more questions. |
Beta Was this translation helpful? Give feedback.
The difference between the two directory structures is the
BackupFormatVersion
(code link).The directory structure, "resources/pods/namespaces/nginx-example"", uses backup format version 1.0.0. The structure "resources/pods/v1-preferredversion/namespaces/nginx-example" uses backup format version 1.1.0.
Backup format version 1.1.0 (the newer one) started to be used after Velero version 1.4.0 when PR #2373 was merged. The reason the backup format was changed was to create the Enable API Group Versions feature, enabled using
--featureflags=EnableAPIGroupVersions
.The EnableAPIGroupVersions feature is not enabled by default. By default, the old directory structure will be used.
The new direc…