-
-
Notifications
You must be signed in to change notification settings - Fork 119
feat(backup): add support for new velero fields #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
27
commits into
main
Choose a base branch
from
copilot/fix-435
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
c5cd27d
Initial plan
Copilot 4c3c782
Update Velero backup fields: replace defaultVolumesToRestic with defa…
Copilot 87fd82b
Add comprehensive Velero backup fields and improve documentation
Copilot cfc6008
Address feedback: remove labelSelector field, fix common labels usage…
Copilot 86acf7c
Clean up temporary files and update gitignore
Copilot 0d201a9
Remove specified backup fields and fix includedNamespaces multi-names…
Copilot eef0bfb
Remove .gitignore change for helm-unittest.tar.gz
Copilot c963770
Update backup.yaml
aslafy-z e8a17f3
Update values.yaml
aslafy-z d266b19
Fix backup unit tests after field removal
Copilot d1dd157
Update backup_test.yaml
aslafy-z 651bd83
Update values.yaml
aslafy-z 1e3d9da
Update backup_test.yaml
aslafy-z d54b159
Update values.yaml
aslafy-z 5b3c48a
Update backup_test.yaml
aslafy-z e4e0aee
Update README.md
aslafy-z 60c0eab
Update backup_test.yaml
aslafy-z 26b88ea
Merge branch 'main' into copilot/fix-435
rasheedamir ecca2f6
Merge branch 'main' into copilot/fix-435
rasheedamir 6036732
Update backup.yaml
aslafy-z 975ac71
Add test for explicit deprecated restic integration in backup
aslafy-z 9c2d809
Reorder backup parameters in values.yaml
aslafy-z c8c4e21
Refactor conditional checks for backup volumes
aslafy-z 3473a8a
docs(README): Reorder backup options
aslafy-z e32911c
Merge branch 'main' into copilot/fix-435
aslafy-z 4d6b1fb
fix: add capability guard
aslafy-z 731cc2e
Update backup_test.yaml with capabilities section
aslafy-z File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,76 @@ | ||
| {{- if (.Values.backup).enabled }} | ||
| {{- if and .Values.backup .Values.backup.enabled (.Capabilities.APIVersions.Has "velero.io/v1") -}} | ||
| apiVersion: velero.io/v1 | ||
| kind: Backup | ||
| metadata: | ||
| name: {{ printf "%s-backup" .Values.applicationName | trunc 63 | quote }} | ||
| namespace: {{ .Values.backup.namespace | default ( include "application.namespace" . ) | quote }} | ||
| labels: | ||
| {{- include "application.labels" $ | nindent 4 }} | ||
| {{- if .Values.backup.additionalLabels }} | ||
| {{ toYaml .Values.backup.additionalLabels | indent 4 }} | ||
| {{- end }} | ||
| {{- if .Values.backup.annotations }} | ||
| {{- include "application.labels" $ | nindent 4 }} | ||
| {{- if .Values.backup.additionalLabels }} | ||
| {{- toYaml .Values.backup.additionalLabels | nindent 4 }} | ||
| {{- end }} | ||
| {{- if .Values.backup.annotations }} | ||
| annotations: | ||
| {{ toYaml .Values.backup.annotations | indent 4 }} | ||
| {{- end }} | ||
| {{- toYaml .Values.backup.annotations | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| labelSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/part-of: {{ include "application.name" . }} | ||
| {{- include "application.selectorLabels" . | nindent 6 }} | ||
| {{- if not (kindIs "invalid" .Values.backup.includedNamespaces) }} | ||
| includedNamespaces: | ||
| {{- range $namespace := .Values.backup.includedNamespaces }} | ||
| - {{ include "application.tplvalues.render" ( dict "value" $namespace "context" $ ) }} | ||
| {{- end }} | ||
| {{- end }} | ||
| defaultVolumesToRestic: {{ .Values.backup.defaultVolumesToRestic }} | ||
| {{- if not (kindIs "invalid" .Values.backup.defaultVolumesToRestic) }} | ||
| defaultVolumesToRestic: {{ .Values.backup.defaultVolumesToRestic }} | ||
| {{- else if not (kindIs "invalid" .Values.backup.defaultVolumesToFsBackup) }} | ||
| defaultVolumesToFsBackup: {{ .Values.backup.defaultVolumesToFsBackup }} | ||
| {{- end }} | ||
| {{- if not (kindIs "invalid" .Values.backup.snapshotVolumes) }} | ||
| snapshotVolumes: {{ .Values.backup.snapshotVolumes }} | ||
| {{- end }} | ||
| {{- if not (kindIs "invalid" .Values.backup.snapshotMoveData) }} | ||
| snapshotMoveData: {{ .Values.backup.snapshotMoveData }} | ||
| {{- end }} | ||
| {{- if not (kindIs "invalid" .Values.backup.csiSnapshotTimeout) }} | ||
| csiSnapshotTimeout: {{ .Values.backup.csiSnapshotTimeout | quote }} | ||
| {{- end }} | ||
| {{- if not (kindIs "invalid" .Values.backup.datamover) }} | ||
| datamover: {{ .Values.backup.datamover | quote }} | ||
| {{- end }} | ||
| {{- if not (kindIs "invalid" .Values.backup.itemOperationTimeout) }} | ||
| itemOperationTimeout: {{ .Values.backup.itemOperationTimeout | quote }} | ||
| {{- end }} | ||
| {{- if not (kindIs "invalid" .Values.backup.storageLocation) }} | ||
| storageLocation: {{ .Values.backup.storageLocation | quote }} | ||
| ttl: {{ .Values.backup.ttl }} | ||
| {{- if .Values.backup.includedResources }} | ||
| {{- end }} | ||
| {{- if not (kindIs "invalid" .Values.backup.ttl) }} | ||
| ttl: {{ .Values.backup.ttl | quote }} | ||
| {{- end }} | ||
| {{- if not (kindIs "invalid" .Values.backup.volumeSnapshotLocations) }} | ||
| volumeSnapshotLocations: | ||
| {{- toYaml .Values.backup.volumeSnapshotLocations | nindent 4 }} | ||
| {{- end }} | ||
| {{- if not (kindIs "invalid" .Values.backup.includedResources) }} | ||
| includedResources: | ||
| {{ toYaml .Values.backup.includedResources | indent 4 }} | ||
| {{- end -}} | ||
| {{- if .Values.backup.excludedResources }} | ||
| {{- toYaml .Values.backup.includedResources | nindent 4 }} | ||
| {{- end }} | ||
| {{- if not (kindIs "invalid" .Values.backup.excludedResources) }} | ||
| excludedResources: | ||
| {{ toYaml .Values.backup.excludedResources | indent 4 }} | ||
| {{- end -}} | ||
| {{- toYaml .Values.backup.excludedResources | nindent 4 }} | ||
| {{- end }} | ||
| {{- if not (kindIs "invalid" .Values.backup.includedNamespaceScopedResources) }} | ||
| includedNamespaceScopedResources: | ||
| {{- toYaml .Values.backup.includedNamespaceScopedResources | nindent 4 }} | ||
| {{- end }} | ||
| {{- if not (kindIs "invalid" .Values.backup.excludedNamespaceScopedResources) }} | ||
| excludedNamespaceScopedResources: | ||
| {{- toYaml .Values.backup.excludedNamespaceScopedResources | nindent 4 }} | ||
| {{- end }} | ||
| {{- if not (kindIs "invalid" .Values.backup.orderedResources) }} | ||
| orderedResources: | ||
| {{- toYaml .Values.backup.orderedResources | nindent 4 }} | ||
| {{- end }} | ||
| {{- end }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether Velero acknowledges it or not, this is a breaking change for us, since it would inhibit current chart users from continuing to use Velero 1.9 and below.
defaultVolumesToFsBackupdid not exist prior to 1.10, and this should've been a major bump for this CRD's API version, in my opinion.Regardless, we are able to support this without creating too much trouble for ourselves. Here's a diff built on top of ecca2f6:
If we do move forward with this, the question then becomes: do we keep the current behavior and allow users to explicitly set
defaultVolumesToFsBackup, or do we default to Velero 1.10+ behavior and allow users to explicitly set the old behavior? Is this another major bump or no?What do you think, @rasheedamir and @aslafy-z? Personally, I think we should default to 1.10+ behavior and don't think a major bump is really necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this was definitely not the goal. This comment-based workflow is not ideal.
I've integrated your patch to re-add support for defaultVolumesToRestic. The 1.10+ behavior is now the default. I don't think a major bump is required, but I wouldn't vote against.