Skip to content

Commit

Permalink
Merge branch 'main' into support/system-account
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-inf committed Jan 7, 2025
2 parents b931be3 + 9bf690a commit 8b88452
Show file tree
Hide file tree
Showing 43 changed files with 1,063 additions and 422 deletions.
1 change: 1 addition & 0 deletions apis/apps/v1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ type ClusterComponentService struct {
// Indicates whether to generate individual Services for each Pod.
// If set to true, a separate Service will be created for each Pod in the Cluster.
//
// +kubebuilder:default=false
// +optional
PodService *bool `json:"podService,omitempty"`
}
Expand Down
1 change: 1 addition & 0 deletions apis/apps/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,7 @@ type ClusterComponentService struct {
// Indicates whether to generate individual Services for each Pod.
// If set to true, a separate Service will be created for each Pod in the Cluster.
//
// +kubebuilder:default=false
// +optional
PodService *bool `json:"podService,omitempty"`
}
Expand Down
12 changes: 12 additions & 0 deletions apis/dataprotection/v1alpha1/backup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,18 @@ type BackupStatus struct {
// +optional
VolumeSnapshots []VolumeSnapshotStatus `json:"volumeSnapshots,omitempty"`

// Records the parent backup name for incremental or differential backup.
// When the parent backup is deleted, the backup will also be deleted.
//
// +optional
ParentBackupName string `json:"parentBackupName,omitempty"`

// Records the base full backup name for incremental backup or differential backup.
// When the base backup is deleted, the backup will also be deleted.
//
// +optional
BaseBackupName string `json:"baseBackupName,omitempty"`

// Records any additional information for the backup.
//
// +optional
Expand Down
6 changes: 6 additions & 0 deletions apis/dataprotection/v1alpha1/backuppolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ type BackupMethod struct {
// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
Name string `json:"name"`

// The name of the compatible full backup method, used by incremental backups.
//
// +optional
// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
CompatibleMethod string `json:"compatibleMethod,omitempty"`

// Specifies whether to take snapshots of persistent volumes. If true,
// the ActionSetName is not required, the controller will use the CSI volume
// snapshotter to create the snapshot.
Expand Down
6 changes: 6 additions & 0 deletions apis/dataprotection/v1alpha1/backuppolicytemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ type BackupMethodTPL struct {
// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
Name string `json:"name"`

// The name of the compatible full backup method, used by incremental backups.
//
// +optional
// +kubebuilder:validation:Pattern:=`^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$`
CompatibleMethod string `json:"compatibleMethod,omitempty"`

// Specifies whether to take snapshots of persistent volumes. If true,
// the ActionSetName is not required, the controller will use the CSI volume
// snapshotter to create the snapshot.
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/apps.kubeblocks.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5233,6 +5233,7 @@ spec:
maxLength: 25
type: string
podService:
default: false
description: |-
Indicates whether to generate individual Services for each Pod.
If set to true, a separate Service will be created for each Pod in the Cluster.
Expand Down Expand Up @@ -13943,6 +13944,7 @@ spec:
maxLength: 25
type: string
podService:
default: false
description: |-
Indicates whether to generate individual Services for each Pod.
If set to true, a separate Service will be created for each Pod in the Cluster.
Expand Down Expand Up @@ -21630,6 +21632,7 @@ spec:
maxLength: 25
type: string
podService:
default: false
description: |-
Indicates whether to generate individual Services for each Pod.
If set to true, a separate Service will be created for each Pod in the Cluster.
Expand Down Expand Up @@ -30862,6 +30865,7 @@ spec:
maxLength: 25
type: string
podService:
default: false
description: |-
Indicates whether to generate individual Services for each Pod.
If set to true, a separate Service will be created for each Pod in the Cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ spec:
For volume snapshot backup, the actionSet is not required, the controller
will use the CSI volume snapshotter to create the snapshot.
type: string
compatibleMethod:
description: The name of the compatible full backup method,
used by incremental backups.
pattern: ^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$
type: string
env:
description: Specifies the environment variables for the backup
workload.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ spec:
For volume snapshot backup, the actionSet is not required, the controller
will use the CSI volume snapshotter to create the snapshot.
type: string
compatibleMethod:
description: The name of the compatible full backup method,
used by incremental backups.
pattern: ^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$
type: string
env:
description: Specifies the environment variables for the backup
workload.
Expand Down
15 changes: 15 additions & 0 deletions config/crd/bases/dataprotection.kubeblocks.io_backups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ spec:
For volume snapshot backup, the actionSet is not required, the controller
will use the CSI volume snapshotter to create the snapshot.
type: string
compatibleMethod:
description: The name of the compatible full backup method, used
by incremental backups.
pattern: ^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$
type: string
env:
description: Specifies the environment variables for the backup
workload.
Expand Down Expand Up @@ -1013,6 +1018,11 @@ spec:
backupRepoName:
description: The name of the backup repository.
type: string
baseBackupName:
description: |-
Records the base full backup name for incremental backup or differential backup.
When the base backup is deleted, the backup will also be deleted.
type: string
completionTimestamp:
description: |-
Records the time when the backup operation was completed.
Expand Down Expand Up @@ -1092,6 +1102,11 @@ spec:
kopiaRepoPath:
description: Records the path of the Kopia repository.
type: string
parentBackupName:
description: |-
Records the parent backup name for incremental or differential backup.
When the parent backup is deleted, the backup will also be deleted.
type: string
path:
description: |-
The directory within the backup repository where the backup data is stored.
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/operations.kubeblocks.io_opsrequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8530,6 +8530,7 @@ spec:
maxLength: 25
type: string
podService:
default: false
description: |-
Indicates whether to generate individual Services for each Pod.
If set to true, a separate Service will be created for each Pod in the Cluster.
Expand Down
11 changes: 6 additions & 5 deletions controllers/apps/transformer_cluster_backup_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,12 @@ func (r *backupPolicyBuilder) syncBackupMethods(backupPolicy *dpv1alpha1.BackupP
}
for _, backupMethodTPL := range r.backupPolicyTPL.Spec.BackupMethods {
backupMethod := dpv1alpha1.BackupMethod{
Name: backupMethodTPL.Name,
ActionSetName: backupMethodTPL.ActionSetName,
SnapshotVolumes: backupMethodTPL.SnapshotVolumes,
TargetVolumes: backupMethodTPL.TargetVolumes,
RuntimeSettings: backupMethodTPL.RuntimeSettings,
Name: backupMethodTPL.Name,
CompatibleMethod: backupMethodTPL.CompatibleMethod,
ActionSetName: backupMethodTPL.ActionSetName,
SnapshotVolumes: backupMethodTPL.SnapshotVolumes,
TargetVolumes: backupMethodTPL.TargetVolumes,
RuntimeSettings: backupMethodTPL.RuntimeSettings,
}
if m, ok := oldBackupMethodMap[backupMethodTPL.Name]; ok {
backupMethod = m
Expand Down
8 changes: 8 additions & 0 deletions controllers/apps/transformer_cluster_component.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,14 @@ func (c *phasePrecondition) compMatch(transCtx *clusterTransformContext, dag *gr
return false, client.IgnoreNotFound(err)
}
if !c.expected(comp) {
transCtx.Logger.Info("waiting for predecessor component in expected phase",
"component", comp.Name, "predecessor", name)
return false, nil
}
// create or update in DAG?
if dagGet() {
transCtx.Logger.Info("waiting for predecessor component in DAG",
"component", comp.Name, "predecessor", name)
return false, nil
}
return true, nil
Expand Down Expand Up @@ -524,11 +528,15 @@ func (c *phasePrecondition) shardingMatch(transCtx *clusterTransformContext, dag
}
for _, comp := range comps {
if !c.expected(&comp) {
transCtx.Logger.Info("waiting for predecessor sharding in expected phase",
"shard", comp.Name, "predecessor sharding", name)
return false, nil
}
}
// create or update in DAG?
if dagList() {
transCtx.Logger.Info("waiting for predecessor sharding in DAG",
"shards", comps, "predecessor sharding", name)
return false, nil
}
return true, nil
Expand Down
4 changes: 2 additions & 2 deletions controllers/dataprotection/actionset_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ var _ = Describe("ActionSet Controller test", func() {

Context("create a actionSet", func() {
It("should be available", func() {
as := testdp.NewFakeActionSet(&testCtx)
as := testdp.NewFakeActionSet(&testCtx, nil)
Expect(as).ShouldNot(BeNil())
})
})

Context("validate a actionSet", func() {
It("validate withParameters", func() {
as := testdp.NewFakeActionSet(&testCtx)
as := testdp.NewFakeActionSet(&testCtx, nil)
Expect(as).ShouldNot(BeNil())
By("set invalid withParameters and schema")
Expect(testapps.ChangeObj(&testCtx, as, func(action *dpv1alpha1.ActionSet) {
Expand Down
Loading

0 comments on commit 8b88452

Please sign in to comment.