apis: add AsOwner function restore types
@@ -36,6 +36,17 @@ type EtcdRestore struct {
Status RestoreStatus `json:"status,omitempty"`
}
+func (er *EtcdRestore) AsOwner() metav1.OwnerReference {
+ trueVar := true
+ return metav1.OwnerReference{
+ APIVersion: SchemeGroupVersion.String(),
+ Kind: EtcdRestoreResourceKind,
+ Name: er.Name,
+ UID: er.UID,
+ Controller: &trueVar,
+ }
+}
+
// RestoreSpec defines how to restore an etcd cluster from existing backup.
type RestoreSpec struct {
// ClusterSpec defines the same spec that etcd operator will run later.
