-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Nextcloud Backups to API #212
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0e11d90
Use claim instead of composite for PostgreSQL
Kidswiss 00e8b0f
Add Nextcloud backup listing
Kidswiss bd7276b
Increase test timeout
Kidswiss 25d7155
Add Nextcloud API test
Kidswiss ae15330
Fix issue where we apply claim fields to the comp
Kidswiss 5890794
Fix RBAC generation
Kidswiss 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 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
package v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/apiserver-runtime/pkg/builder/resource" | ||
) | ||
|
||
// VSHNNextcloudBackup needs to implement the builder resource interface | ||
var _ resource.Object = &VSHNNextcloudBackup{} | ||
var _ resource.ObjectList = &VSHNNextcloudBackupList{} | ||
|
||
// +kubebuilder:object:root=true | ||
// +k8s:openapi-gen=true | ||
type VSHNNextcloudBackup struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Status VSHNNextcloudBackupStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +k8s:openapi-gen=true | ||
type VSHNNextcloudBackupStatus struct { | ||
// FileBackupAvailable indicates if this backup contains a file backup for Nextcloud. | ||
// Not every file backup might have a database backup associated, because the retention is not enforced at the same time. | ||
FileBackupAvailable bool | ||
// DatabaseBackupAvailable indicates if this backup contains a database backup for Nextcloud. | ||
// Not every file backup might have a database backup associated, because the retention is not enforced at the same time. | ||
DatabaseBackupAvailable bool | ||
NextcloudFileBackup VSHNNextcloudFileBackupStatus `json:"nextcloudFileBackup,omitempty"` | ||
DatabaseBackupStatus VSHNPostgresBackupStatus `json:"databaseBackupStatus,omitempty"` | ||
} | ||
|
||
// +k8s:openapi-gen=true | ||
type VSHNNextcloudFileBackupStatus struct { | ||
ID string `json:"id,omitempty"` | ||
Date metav1.Time `json:"date,omitempty"` | ||
Instance string `json:"instance,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
// +k8s:openapi-gen=true | ||
type VSHNNextcloudBackupList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
|
||
Items []VSHNNextcloudBackup `json:"items,omitempty"` | ||
} | ||
|
||
// GetGroupVersionResource returns the GroupVersionResource for this resource. | ||
// The resource should be the all lowercase and pluralized kind | ||
func (in *VSHNNextcloudBackup) GetGroupVersionResource() schema.GroupVersionResource { | ||
return schema.GroupVersionResource{ | ||
Group: GroupVersion.Group, | ||
Version: GroupVersion.Version, | ||
Resource: "vshnnextcloudbackups", | ||
} | ||
} | ||
|
||
func (in *VSHNNextcloudBackup) GetObjectMeta() *metav1.ObjectMeta { | ||
return &in.ObjectMeta | ||
} | ||
|
||
// IsStorageVersion returns true if the object is also the internal version -- i.e. is the type defined for the API group or an alias to this object. | ||
// If false, the resource is expected to implement MultiVersionObject interface. | ||
func (in *VSHNNextcloudBackup) IsStorageVersion() bool { | ||
return true | ||
} | ||
|
||
func (in *VSHNNextcloudBackup) NamespaceScoped() bool { | ||
return true | ||
} | ||
|
||
func (in *VSHNNextcloudBackup) New() runtime.Object { | ||
return &VSHNNextcloudBackup{} | ||
} | ||
|
||
func (in *VSHNNextcloudBackup) NewList() runtime.Object { | ||
return &VSHNNextcloudBackupList{} | ||
} | ||
|
||
func (in *VSHNNextcloudBackupList) GetListMeta() *metav1.ListMeta { | ||
return &in.ListMeta | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 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 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.
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.
Why is this hardcoded to true, even though the comment suggests, that this could be false?
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.
We currently don't have multiple versions. This is part of the interface and needs to be implemented.