-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
we can afford an extra (now) deprecated Restic repository type
..better than using unstructured and be the deer in headlights Signed-off-by: Archit Sharma <[email protected]>
- Loading branch information
Showing
4 changed files
with
182 additions
and
25 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package analyzer | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// ResticRepositorySpec is the specification for a ResticRepository. | ||
type ResticRepositorySpec struct { | ||
// VolumeNamespace is the namespace this restic repository contains | ||
// pod volume backups for. | ||
VolumeNamespace string `json:"volumeNamespace"` | ||
|
||
// BackupStorageLocation is the name of the BackupStorageLocation | ||
// that should contain this repository. | ||
BackupStorageLocation string `json:"backupStorageLocation"` | ||
|
||
// ResticIdentifier is the full restic-compatible string for identifying | ||
// this repository. | ||
ResticIdentifier string `json:"resticIdentifier"` | ||
|
||
// MaintenanceFrequency is how often maintenance should be run. | ||
MaintenanceFrequency metav1.Duration `json:"maintenanceFrequency"` | ||
} | ||
|
||
// ResticRepositoryPhase represents the lifecycle phase of a ResticRepository. | ||
// +kubebuilder:validation:Enum=New;Ready;NotReady | ||
type ResticRepositoryPhase string | ||
|
||
const ( | ||
ResticRepositoryPhaseNew ResticRepositoryPhase = "New" | ||
ResticRepositoryPhaseReady ResticRepositoryPhase = "Ready" | ||
ResticRepositoryPhaseNotReady ResticRepositoryPhase = "NotReady" | ||
) | ||
|
||
// ResticRepositoryStatus is the current status of a ResticRepository. | ||
type ResticRepositoryStatus struct { | ||
// Phase is the current state of the ResticRepository. | ||
// +optional | ||
Phase ResticRepositoryPhase `json:"phase,omitempty"` | ||
|
||
// Message is a message about the current status of the ResticRepository. | ||
// +optional | ||
Message string `json:"message,omitempty"` | ||
|
||
// LastMaintenanceTime is the last time maintenance was run. | ||
// +optional | ||
// +nullable | ||
LastMaintenanceTime *metav1.Time `json:"lastMaintenanceTime,omitempty"` | ||
} | ||
|
||
type ResticRepository struct { | ||
metav1.TypeMeta `json:",inline"` | ||
|
||
// +optional | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// +optional | ||
Spec ResticRepositorySpec `json:"spec,omitempty"` | ||
|
||
// +optional | ||
Status ResticRepositoryStatus `json:"status,omitempty"` | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package types | ||
|
||
import "fmt" | ||
import ( | ||
"fmt" | ||
) | ||
|
||
type NotFoundError struct { | ||
Name string | ||
|