-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
base: main
Are you sure you want to change the base?
Conversation
…ultVolumesToFsBackup and add snapshotMoveData Co-authored-by: aslafy-z <[email protected]>
|
@copilot I opened the network flows.
|
Co-authored-by: aslafy-z <[email protected]>
I've completed a comprehensive review of the Velero CRDs and added all major missing backup fields. Here's what was added: Additional fields from Velero CRD:
Improved documentation: Testing: Commit: 87fd82b |
|
…, improve type checking, and update README Co-authored-by: aslafy-z <[email protected]>
All feedback addressed in commit cfc6008: • Removed labelSelector field updates from backup.yaml (reverted to original) The backup template now maintains backward compatibility while properly handling null boolean values. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: aslafy-z <[email protected]>
|
|
@copilot remove the .gitignore change |
…pace support Co-authored-by: aslafy-z <[email protected]>
Completed the requested changes in commit 0d201a9: • Removed fields: includeClusterResources, excludedNamespaces, includedClusterScopedResources, excludedClusterScopedResources from backup template, values.yaml, and README documentation • Fixed includedNamespaces: Now properly supports multiple namespaces without YAML structure issues. The field is correctly rendered as a single array instead of repeating the key for each namespace. Template now correctly generates: includedNamespaces:
- namespace1
- namespace2
- namespace3Instead of the problematic structure that would repeat the key. |
|
@copilot Analyze PR content and update the PR description to reflect the real changes. |
Updated the PR description to accurately reflect the actual changes implemented. The key updates focus on:
The description now provides clear before/after examples showing the critical namespace bug fix and demonstrates proper usage of the new fields. |
|
@aslafy-z looks good to me but I will definitely suggest to do some integration testing and validate it works as expected b4 merging |
|
@d3adb5 can you please review this as well? |
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.
Support for defaultVolumesToRestic is being dropped entirely despite its mention in the values file and the values table in the README.md.
Additionally, I think the Helm templating should be indented to match the indentation level of the fields they are manipulating, as shown in one of the threads I opened. Without that, the eyes have to dart to the left more than I'd like. Plus, the nindent function kind of exists to allow us to indent our template expansions.
| {{- range $namespace := .Values.backup.includedNamespaces }} | ||
| - {{ include "application.tplvalues.render" ( dict "value" $namespace "context" $ ) }} | ||
| {{- end }} | ||
| defaultVolumesToRestic: {{ .Values.backup.defaultVolumesToRestic }} |
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. defaultVolumesToFsBackup did 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:
diff --git a/application/templates/backup.yaml b/application/templates/backup.yaml
index a8831e5..0c2853d 100644
--- a/application/templates/backup.yaml
+++ b/application/templates/backup.yaml
@@ -23,7 +23,11 @@ spec:
- {{ include "application.tplvalues.render" ( dict "value" $namespace "context" $ ) }}
{{- end }}
{{- end }}
+ {{- if not (kindIs "invalid" .Values.backup.defaultVolumesToRestic) }}
+ defaultVolumesToRestic: {{ .Values.backup.defaultVolumesToRestic }}
+ {{- else if not (kindIs "invalid" .Values.backup.defaultVolumesToFsBackup) }}
defaultVolumesToFsBackup: {{ .Values.backup.defaultVolumesToFsBackup }}
+ {{- end }}
snapshotVolumes: {{ .Values.backup.snapshotVolumes }}
{{- if not (kindIs "invalid" .Values.backup.snapshotMoveData) }}
snapshotMoveData: {{ .Values.backup.snapshotMoveData }}
diff --git a/application/tests/backup_test.yaml b/application/tests/backup_test.yaml
index 1a79430..fcfb1c3 100644
--- a/application/tests/backup_test.yaml
+++ b/application/tests/backup_test.yaml
@@ -66,6 +66,20 @@ tests:
path: spec.ttl
value: "1h0m0s"
+ - it: uses restic integration is explicitly enabled
+ set:
+ backup:
+ enabled: true
+ namespace: my-namespace
+ storageLocation: my-storage-location
+ defaultVolumesToRestic: true
+ asserts:
+ - notExists:
+ path: spec.defaultVolumesToFsBackup
+ - equal:
+ path: spec.defaultVolumesToRestic
+ value: true
+
- it: includes correct includedNamespaces by default
set:
namespaceOverride: base-namespaceIf 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.
Add capabilities section with API versions for tests
This pull request enhances and extends the backup configuration options for the Helm chart, introducing new parameters, deprecating an old one, and updating the template and tests to support these changes. The main focus is to provide more flexibility and clarity in how backups are configured and managed.
Key changes:
Backup Parameter Enhancements
values.yamland documented them inREADME.md, includingdefaultVolumesToFsBackup(now preferred overdefaultVolumesToRestic),snapshotMoveData,csiSnapshotTimeout,datamover,itemOperationTimeout,volumeSnapshotLocations,includedNamespaceScopedResources,excludedNamespaceScopedResources, andorderedResources.defaultVolumesToResticin favor ofdefaultVolumesToFsBackup, updating documentation to reflect this change.Template and Logic Updates
backup.yamlHelm template to conditionally include the new parameters and to use application selector labels for improved label selection.Testing Improvements
backup_test.yamlto cover all new parameters, verify correct inclusion/exclusion of fields, and ensure backward compatibility betweendefaultVolumesToResticanddefaultVolumesToFsBackup.These changes provide more granular control over backup operations and improve the clarity and maintainability of backup configuration.