Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ require (
kmodules.xyz/client-go v0.34.3
kmodules.xyz/custom-resources v0.34.0
kmodules.xyz/monitoring-agent-api v0.34.1
kubedb.dev/apimachinery v0.67.0-rc.0
kubedb.dev/db-client-go v0.22.0-rc.0
kubedb.dev/apimachinery v0.67.0-rc.1
kubedb.dev/db-client-go v0.22.0-rc.1
kubeops.dev/petset v0.1.1-0.20260709161836-19b3570c41ab
sigs.k8s.io/controller-runtime v0.22.4
sigs.k8s.io/yaml v1.6.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -795,10 +795,10 @@ kmodules.xyz/resource-metadata v0.46.1 h1:mm4sWZvQMFJJiLdKlPGxD9Cj6f44SCdHB7Csbk
kmodules.xyz/resource-metadata v0.46.1/go.mod h1:ejz7IVjhqmj6VH8CVfprocJK/IM++OeunrfUp51ZrIw=
kmodules.xyz/resource-metrics v0.34.0 h1:cqscgTx3PONxHj6PIySK3sTlKKv8iKTGzRd+S6YSwXg=
kmodules.xyz/resource-metrics v0.34.0/go.mod h1:R34IKtp5+NqcQz7AQJheBJK6Iem0LqrCbm/55Mn+ECQ=
kubedb.dev/apimachinery v0.67.0-rc.0 h1:+BerQvPs70WyWUh+FvJSU2r96xKDEMc9jSS4cMLrXcU=
kubedb.dev/apimachinery v0.67.0-rc.0/go.mod h1:JDH2CEo4d0f7hySMPrYoPrO70S7MeLDB220U9mebHN4=
kubedb.dev/db-client-go v0.22.0-rc.0 h1:NQmg3n5Rh53jR/LSOGuC30hHeYAHmpPrT9yjoDVDkVk=
kubedb.dev/db-client-go v0.22.0-rc.0/go.mod h1:LvBT/TgaQj0LszxyyIrZDKDBRvw6ZZjfMN9BZp0B1vg=
kubedb.dev/apimachinery v0.67.0-rc.1 h1:pPc4Pg8GVXNdoBKdGKrZupueX1flk4whjVHxYIOR8Vw=
kubedb.dev/apimachinery v0.67.0-rc.1/go.mod h1:JDH2CEo4d0f7hySMPrYoPrO70S7MeLDB220U9mebHN4=
kubedb.dev/db-client-go v0.22.0-rc.1 h1:X+0uB/6mrZyuHBFCGh1Tz40ptK2xaqlVSNkcTcBkBHE=
kubedb.dev/db-client-go v0.22.0-rc.1/go.mod h1:qAlKuo6hUfHkihXK+nBnuj8qjtU2HdXkRJ85DhKIAH8=
kubeops.dev/csi-driver-cacerts v0.5.1-0.20260418091014-4f539f46235c h1:ZKmBV3fFfCWQ3jDeWBbUi2J4WjJ2ff88n+cTqJ8ZXT8=
kubeops.dev/csi-driver-cacerts v0.5.1-0.20260418091014-4f539f46235c/go.mod h1:VNbwC3gTWfmdQCVxd8mkVx+n1+0F1lOA5X3usyZN1rk=
kubeops.dev/operator-shard-manager v0.0.6-0.20260418091213-65daf7da824d h1:/nZYflp2w1x+wQmxDtHR0Sbzl39fcuaJ66oqgVXBBwQ=
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
Copyright AppsCode Inc. and Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
dbapi "kubedb.dev/apimachinery/apis/kubedb/v1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

var _ Accessor = &EtcdArchiver{}

func (m *EtcdArchiver) GetObjectMeta() metav1.ObjectMeta {
return m.ObjectMeta
}

func (m *EtcdArchiver) GetConsumers() *dbapi.AllowedConsumers {
return m.Spec.Databases
}

var _ ListAccessor = EtcdArchiverList{}

func (l EtcdArchiverList) GetItems() []Accessor {
res := make([]Accessor, len(l.Items))
for i := range l.Items {
res[i] = &l.Items[i]
}
return res
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
Copyright AppsCode Inc. and Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
dbapi "kubedb.dev/apimachinery/apis/kubedb/v1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kmapi "kmodules.xyz/client-go/api/v1"
storageapi "kubestash.dev/apimachinery/apis/storage/v1alpha1"
)

const (
ResourceKindEtcdArchiver = "EtcdArchiver"
ResourceSingularEtcdArchiver = "etcdarchiver"
ResourcePluralEtcdArchiver = "etcdarchivers"
)

// +genclient
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=etcdarchivers,singular=etcdarchiver,shortName=etcdarchiver,categories={archiver,kubedb,appscode}
// +kubebuilder:subresource:status
type EtcdArchiver struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec EtcdArchiverSpec `json:"spec,omitempty"`
Status EtcdArchiverStatus `json:"status,omitempty"`
}

// EtcdArchiverSpec defines the desired state of EtcdArchiver.
//
// etcd has no WAL-equivalent continuous archiving primitive that can be shipped
// out of the cluster, so the etcd archiver is snapshot-only: there is no
// LogBackup section and therefore no point-in-time recovery between two full
// snapshots.
type EtcdArchiverSpec struct {
// Databases define which Etcd databases are allowed to consume this archiver
Databases *dbapi.AllowedConsumers `json:"databases"`
// Pause defines if the backup process should be paused or not
// +optional
Pause bool `json:"pause,omitempty"`
// RetentionPolicy field is the RetentionPolicy of the backupConfiguration's backend
// +optional
RetentionPolicy *kmapi.ObjectReference `json:"retentionPolicy"`
// FullBackup defines the sessionConfig of the fullBackup
// This options will eventually go to the full-backup job's yaml
// +optional
FullBackup *FullBackupOptions `json:"fullBackup"`
// ManifestBackup defines the sessionConfig of the manifestBackup
// This options will eventually go to the manifest-backup job's yaml
// +optional
ManifestBackup *ManifestBackupOptions `json:"manifestBackup"`
// +optional
EncryptionSecret *kmapi.ObjectReference `json:"encryptionSecret"`
// BackupStorage is the backend storageRef of the BackupConfiguration
// +optional
BackupStorage *BackupStorage `json:"backupStorage"`
// DeletionPolicy defines the created repository's deletionPolicy
// +optional
DeletionPolicy *storageapi.BackupConfigDeletionPolicy `json:"deletionPolicy"`
}

// EtcdArchiverStatus defines the observed state of EtcdArchiver
type EtcdArchiverStatus struct {
// Specifies the information of all the databases managed by this archiver
// +optional
DatabaseRefs []ArchiverDatabaseRef `json:"databaseRefs,omitempty"`
}

// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type EtcdArchiverList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []EtcdArchiver `json:"items"`
}

func init() {
SchemeBuilder.Register(&EtcdArchiver{}, &EtcdArchiverList{})
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func (ClickHouseArchiver) CustomResourceDefinition() *apiextensions.CustomResour
return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralClickHouseArchiver))
}

func (EtcdArchiver) CustomResourceDefinition() *apiextensions.CustomResourceDefinition {
return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralEtcdArchiver))
}

func SetDefaultLogBackupOptions(log *LogBackupOptions) *LogBackupOptions {
if log == nil {
log = &LogBackupOptions{
Expand Down

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

Loading
Loading