Skip to content

Commit

Permalink
Update pvc backup restore task name (#13)
Browse files Browse the repository at this point in the history
Signed-off-by: hmsayem <[email protected]>
  • Loading branch information
hmsayem authored Jan 18, 2024
1 parent bb6f607 commit da41d9d
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 2,599 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
kmodules.xyz/client-go v0.29.6
kmodules.xyz/offshoot-api v0.29.0
kubestash.dev/apimachinery v0.3.1-0.20240111011911-c3c3817fcf7c
kubestash.dev/apimachinery v0.3.1-0.20240117045620-70eeee2df194
sigs.k8s.io/controller-runtime v0.16.3
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,8 @@ kmodules.xyz/offshoot-api v0.29.0 h1:GHLhxxT9jU1N8+FvOCCeJNyU5g0duYS46UGrs6AHNLY
kmodules.xyz/offshoot-api v0.29.0/go.mod h1:5NxhBblXoDHWStx9HCDJR2KFTwYjEZ7i1Id3jelIunw=
kmodules.xyz/prober v0.29.0 h1:Ex7m4F9rH7uWNNJlLgP63ROOM+nUATJkC2L5OQ7nwMg=
kmodules.xyz/prober v0.29.0/go.mod h1:UtK+HKyI1lFLEKX+HFLyOCVju6TO93zv3kwGpzqmKOo=
kubestash.dev/apimachinery v0.3.1-0.20240111011911-c3c3817fcf7c h1:Ec4XNFVWyq/cTOH7sOmLj1IBK8spyrJnUKPdxZuV2Jo=
kubestash.dev/apimachinery v0.3.1-0.20240111011911-c3c3817fcf7c/go.mod h1:mqOML23d9Hm2kSyzlRy6Gr69RGEUaOCTWYl2egklac8=
kubestash.dev/apimachinery v0.3.1-0.20240117045620-70eeee2df194 h1:ivnFkXm492x/4oX+EacslU+tVQB//IQdoyiE5NG3Ji0=
kubestash.dev/apimachinery v0.3.1-0.20240117045620-70eeee2df194/go.mod h1:mqOML23d9Hm2kSyzlRy6Gr69RGEUaOCTWYl2egklac8=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
Expand Down
4 changes: 2 additions & 2 deletions pkg/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ const (
// Constants for PVC cloning
const (
PVCAddon = "pvc-addon"
PVCBackupTask = "LogicalBackup"
PVCRestoreTask = "LogicalBackupRestore"
PVCBackupTask = "logical-backup"
PVCRestoreTask = "logical-backup-restore"
PVCSchedule = "*/59 * * * *"
LatestSnapshot = "latest"
)

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions vendor/kubestash.dev/apimachinery/apis/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ const (

const (
ComponentPod = "pod"
ComponentDeployment = "deployment"
ComponentPVC = "pvc"
ComponentDump = "dump"
ComponentWal = "wal"
ComponentManifest = "manifest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,6 @@ func (b *BackupConfiguration) validateSessions(ctx context.Context, c client.Cli
}
}

if err := b.validateUniqueRepo(); err != nil {
return err
}

if err := b.validateUniqueRepoDir(ctx, c); err != nil {
return err
}
Expand Down Expand Up @@ -365,21 +361,6 @@ func (b *BackupConfiguration) validateRepositories(ctx context.Context, c client
return nil
}

func (b *BackupConfiguration) validateUniqueRepo() error {
mapRepoToBackend := make(map[string]map[string]string)
for _, session := range b.Spec.Sessions {
for _, repo := range session.Repositories {
if repoInfo, ok := mapRepoToBackend[repo.Name]; ok && repoInfo[repo.Backend] == repo.Name {
return fmt.Errorf("repository %q can not be used from multiple sessions. Please choose a different repository", repo.Name)
}
mapRepoToBackend[repo.Name] = map[string]string{
repo.Backend: repo.Name,
}
}
}
return nil
}

func (b *BackupConfiguration) validateUniqueRepoDir(ctx context.Context, c client.Client) error {
if err := b.validateRepoDirectories(); err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kmapi "kmodules.xyz/client-go/api/v1"
ofst "kmodules.xyz/offshoot-api/api/v1"
)

const (
Expand Down Expand Up @@ -69,10 +68,6 @@ type RestoreSessionSpec struct {
// +optional
Timeout *metav1.Duration `json:"timeout,omitempty"`

// RuntimeSettings allow to specify Resources, NodeSelector, Affinity, Toleration, ReadinessProbe etc.
// +optional
RuntimeSettings ofst.RuntimeSettings `json:"runtimeSettings,omitempty"`

// ManifestOptions provide options to select particular manifest object to restore
// +optional
ManifestOptions *ManifestRestoreOptions `json:"manifestOptions,omitempty"`
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit da41d9d

Please sign in to comment.