Skip to content

Commit

Permalink
Add observedGeneration to remote nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
koct9i committed Nov 5, 2024
1 parent 98d988a commit 5d45249
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/v1/ytsaurus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,9 @@ const (
// CommonRemoteNodeStatus is a set of fields shared between `Remote*NodesStatus`.
// It is inlined in these specs.
type CommonRemoteNodeStatus struct {
ReleaseStatus RemoteNodeReleaseStatus `json:"releaseStatus,omitempty"`
// Reflects resource generation which was used for updating status.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
ReleaseStatus RemoteNodeReleaseStatus `json:"releaseStatus,omitempty"`
}

// YtsaurusSpec defines the desired state of Ytsaurus
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/cluster.ytsaurus.tech_remotedatanodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2507,6 +2507,11 @@ spec:
status:
description: RemoteDataNodesStatus defines the observed state of RemoteDataNodes
properties:
observedGeneration:
description: Reflects resource generation which was used for updating
status.
format: int64
type: integer
releaseStatus:
type: string
type: object
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/cluster.ytsaurus.tech_remoteexecnodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2700,6 +2700,11 @@ spec:
status:
description: RemoteExecNodesStatus defines the observed state of RemoteExecNodes
properties:
observedGeneration:
description: Reflects resource generation which was used for updating
status.
format: int64
type: integer
releaseStatus:
type: string
type: object
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/cluster.ytsaurus.tech_remotetabletnodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2507,6 +2507,11 @@ spec:
status:
description: RemoteTabletNodesStatus defines the observed state of RemoteTabletNodes
properties:
observedGeneration:
description: Reflects resource generation which was used for updating
status.
format: int64
type: integer
releaseStatus:
type: string
type: object
Expand Down
1 change: 1 addition & 0 deletions controllers/remotedatanodes_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (r *RemoteDataNodesReconciler) Sync(
resource.Status.ReleaseStatus = ytv1.RemoteNodeReleaseStatusRunning
requeue = false
}
resource.Status.ObservedGeneration = resource.Generation

logger.Info("Setting status for remote data nodes", "status", resource.Status.ReleaseStatus)
err = r.Client.Status().Update(ctx, resource)
Expand Down
1 change: 1 addition & 0 deletions controllers/remoteexecnodes_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (r *RemoteExecNodesReconciler) Sync(
resource.Status.ReleaseStatus = ytv1.RemoteNodeReleaseStatusRunning
requeue = false
}
resource.Status.ObservedGeneration = resource.Generation

logger.Info("Setting status for remote exec nodes", "status", resource.Status.ReleaseStatus)
err = r.Client.Status().Update(ctx, resource)
Expand Down
1 change: 1 addition & 0 deletions controllers/remotetabletnodes_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (r *RemoteTabletNodesReconciler) Sync(
resource.Status.ReleaseStatus = ytv1.RemoteNodeReleaseStatusRunning
requeue = false
}
resource.Status.ObservedGeneration = resource.Generation

logger.Info("Setting status for remote tablet nodes", "status", resource.Status.ReleaseStatus)
err = r.Client.Status().Update(ctx, resource)
Expand Down
1 change: 1 addition & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ _Appears in:_

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `observedGeneration` _integer_ | Reflects resource generation which was used for updating status. | | |
| `releaseStatus` _[RemoteNodeReleaseStatus](#remotenodereleasestatus)_ | | | |


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2518,6 +2518,11 @@ spec:
status:
description: RemoteDataNodesStatus defines the observed state of RemoteDataNodes
properties:
observedGeneration:
description: Reflects resource generation which was used for updating
status.
format: int64
type: integer
releaseStatus:
type: string
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2711,6 +2711,11 @@ spec:
status:
description: RemoteExecNodesStatus defines the observed state of RemoteExecNodes
properties:
observedGeneration:
description: Reflects resource generation which was used for updating
status.
format: int64
type: integer
releaseStatus:
type: string
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2518,6 +2518,11 @@ spec:
status:
description: RemoteTabletNodesStatus defines the observed state of RemoteTabletNodes
properties:
observedGeneration:
description: Reflects resource generation which was used for updating
status.
format: int64
type: integer
releaseStatus:
type: string
type: object
Expand Down

0 comments on commit 5d45249

Please sign in to comment.