Skip to content

Commit

Permalink
Add Version field to ETCDSnapshotRestoreSpec
Browse files Browse the repository at this point in the history
Signed-off-by: Vatsal Parekh <[email protected]>
  • Loading branch information
vatsalparekh committed Dec 4, 2024
1 parent 5662135 commit d57df2a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ spec:
type: string
machineName:
type: string
version:
type: string
required:
- clusterName
type: object
Expand Down
1 change: 1 addition & 0 deletions exp/etcdrestore/api/v1alpha1/etcdmachinesnapshot_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type ETCDMachineSnapshotSpec struct {
ClusterName string `json:"clusterName"`
MachineName string `json:"machineName,omitempty"`
Location string `json:"location,omitempty"`
Version string `json:"version,omitempty"`
}

// EtcdSnapshotRestoreStatus defines observed state of EtcdSnapshotRestore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ spec:
type: string
machineName:
type: string
version:
type: string
required:
- clusterName
type: object
Expand Down
4 changes: 4 additions & 0 deletions exp/etcdrestore/controllers/etcdmachinesnapshot_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ func (r *ETCDMachineSnapshotReconciler) reconcileNormal(
// Initial phase, set to Pending
etcdMachineSnapshot.Status.Phase = snapshotrestorev1.ETCDSnapshotPhasePending

log.Info("\n\n\nCluster version is: %v\n\n\n", scope.cluster.Spec.Topology.Version)
// Set the Version field as k8s version of the cluster
//etcdMachineSnapshot.Spec.Version = scope.cluster.Spec.Topology.Version

return ctrl.Result{}, nil
case snapshotrestorev1.ETCDSnapshotPhasePending, snapshotrestorev1.ETCDSnapshotPhasePlanning:
// Transition to Running
Expand Down

0 comments on commit d57df2a

Please sign in to comment.