Skip to content

Commit 9466ee1

Browse files
authored
Remove LastOperation from CRDs and restructure component operators (#192)
* Removed `LastOperation` from Status of `PodClique`, `PodCliqueScalingGroup` and `PodCliqueSet`. * Refactored structure of components to make it easy to correlate. * Combined constants into one file `internal/constants/constants.go` * Moved controller specific components within each controller package. * harmonized imports and use a common componentutils alias Signed-off-by: madhav bhargava <madhav.bhargava@sap.com> --------- Signed-off-by: madhav bhargava <madhav.bhargava@sap.com>
1 parent 84f59d9 commit 9466ee1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+248
-549
lines changed

docs/api-reference/operator-api.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -102,25 +102,6 @@ _Appears in:_
102102
| `observedAt` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.33/#time-v1-meta)_ | ObservedAt is the time at which the error was observed. | | |
103103

104104

105-
#### LastOperation
106-
107-
108-
109-
LastOperation captures the last operation done by the respective reconciler on the PodCliqueSet.
110-
111-
112-
113-
_Appears in:_
114-
- [PodCliqueScalingGroupStatus](#podcliquescalinggroupstatus)
115-
- [PodCliqueSetStatus](#podcliquesetstatus)
116-
- [PodCliqueStatus](#podcliquestatus)
117-
118-
| Field | Description | Default | Validation |
119-
| --- | --- | --- | --- |
120-
| `type` _[LastOperationType](#lastoperationtype)_ | Type is the type of the last operation. | | |
121-
| `state` _[LastOperationState](#lastoperationstate)_ | State is the state of the last operation. | | |
122-
| `description` _string_ | Description is a human-readable description of the last operation. | | |
123-
| `lastUpdateTime` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.33/#time-v1-meta)_ | LastUpdateTime is the time at which the last operation was updated. | | |
124105

125106

126107
#### LastOperationState
@@ -330,7 +311,6 @@ _Appears in:_
330311
| `updatedReplicas` _integer_ | UpdatedReplicas is the number of PodCliqueScalingGroup replicas that correspond with the latest PodCliqueSetGenerationHash. | 0 | |
331312
| `selector` _string_ | Selector is the selector used to identify the pods that belong to this scaling group. | | |
332313
| `observedGeneration` _integer_ | ObservedGeneration is the most recent generation observed by the controller. | | |
333-
| `lastOperation` _[LastOperation](#lastoperation)_ | LastOperation captures the last operation done by the respective reconciler on the PodClique. | | |
334314
| `lastErrors` _[LastError](#lasterror) array_ | LastErrors captures the last errors observed by the controller when reconciling the PodClique. | | |
335315
| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.33/#condition-v1-meta) array_ | Conditions represents the latest available observations of the PodCliqueScalingGroup by its controller. | | |
336316
| `currentPodCliqueSetGenerationHash` _string_ | CurrentPodCliqueSetGenerationHash establishes a correlation to PodCliqueSet generation hash indicating<br />that the spec of the PodCliqueSet at this generation is fully realized in the PodCliqueScalingGroup. | | |
@@ -425,7 +405,6 @@ _Appears in:_
425405
| Field | Description | Default | Validation |
426406
| --- | --- | --- | --- |
427407
| `observedGeneration` _integer_ | ObservedGeneration is the most recent generation observed by the controller. | | |
428-
| `lastOperation` _[LastOperation](#lastoperation)_ | LastOperation captures the last operation done by the respective reconciler on the PodCliqueSet. | | |
429408
| `lastErrors` _[LastError](#lasterror) array_ | LastErrors captures the last errors observed by the controller when reconciling the PodCliqueSet. | | |
430409
| `replicas` _integer_ | Replicas is the total number of PodCliqueSet replicas created. | | |
431410
| `updatedReplicas` _integer_ | UpdatedReplicas is the number of replicas that have been updated to the desired revision of the PodCliqueSet. | 0 | |
@@ -499,7 +478,6 @@ _Appears in:_
499478
| Field | Description | Default | Validation |
500479
| --- | --- | --- | --- |
501480
| `observedGeneration` _integer_ | ObservedGeneration is the most recent generation observed by the controller. | | |
502-
| `lastOperation` _[LastOperation](#lastoperation)_ | LastOperation captures the last operation done by the respective reconciler on the PodClique. | | |
503481
| `lastErrors` _[LastError](#lasterror) array_ | LastErrors captures the last errors observed by the controller when reconciling the PodClique. | | |
504482
| `replicas` _integer_ | Replicas is the total number of non-terminated Pods targeted by this PodClique. | | |
505483
| `readyReplicas` _integer_ | ReadyReplicas is the number of ready Pods targeted by this PodClique. | 0 | |

operator/api/core/v1alpha1/crds/grove.io_podcliques.yaml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8651,31 +8651,6 @@ spec:
86518651
- observedAt
86528652
type: object
86538653
type: array
8654-
lastOperation:
8655-
description: LastOperation captures the last operation done by the
8656-
respective reconciler on the PodClique.
8657-
properties:
8658-
description:
8659-
description: Description is a human-readable description of the
8660-
last operation.
8661-
type: string
8662-
lastUpdateTime:
8663-
description: LastUpdateTime is the time at which the last operation
8664-
was updated.
8665-
format: date-time
8666-
type: string
8667-
state:
8668-
description: State is the state of the last operation.
8669-
type: string
8670-
type:
8671-
description: Type is the type of the last operation.
8672-
type: string
8673-
required:
8674-
- description
8675-
- lastUpdateTime
8676-
- state
8677-
- type
8678-
type: object
86798654
observedGeneration:
86808655
description: ObservedGeneration is the most recent generation observed
86818656
by the controller.

operator/api/core/v1alpha1/crds/grove.io_podcliquescalinggroups.yaml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -174,31 +174,6 @@ spec:
174174
- observedAt
175175
type: object
176176
type: array
177-
lastOperation:
178-
description: LastOperation captures the last operation done by the
179-
respective reconciler on the PodClique.
180-
properties:
181-
description:
182-
description: Description is a human-readable description of the
183-
last operation.
184-
type: string
185-
lastUpdateTime:
186-
description: LastUpdateTime is the time at which the last operation
187-
was updated.
188-
format: date-time
189-
type: string
190-
state:
191-
description: State is the state of the last operation.
192-
type: string
193-
type:
194-
description: Type is the type of the last operation.
195-
type: string
196-
required:
197-
- description
198-
- lastUpdateTime
199-
- state
200-
- type
201-
type: object
202177
observedGeneration:
203178
description: ObservedGeneration is the most recent generation observed
204179
by the controller.

operator/api/core/v1alpha1/crds/grove.io_podcliquesets.yaml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9704,31 +9704,6 @@ spec:
97049704
- observedAt
97059705
type: object
97069706
type: array
9707-
lastOperation:
9708-
description: LastOperation captures the last operation done by the
9709-
respective reconciler on the PodCliqueSet.
9710-
properties:
9711-
description:
9712-
description: Description is a human-readable description of the
9713-
last operation.
9714-
type: string
9715-
lastUpdateTime:
9716-
description: LastUpdateTime is the time at which the last operation
9717-
was updated.
9718-
format: date-time
9719-
type: string
9720-
state:
9721-
description: State is the state of the last operation.
9722-
type: string
9723-
type:
9724-
description: Type is the type of the last operation.
9725-
type: string
9726-
required:
9727-
- description
9728-
- lastUpdateTime
9729-
- state
9730-
- type
9731-
type: object
97329707
observedGeneration:
97339708
description: ObservedGeneration is the most recent generation observed
97349709
by the controller.

operator/api/core/v1alpha1/podclique.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ type AutoScalingConfig struct {
104104
type PodCliqueStatus struct {
105105
// ObservedGeneration is the most recent generation observed by the controller.
106106
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
107-
// LastOperation captures the last operation done by the respective reconciler on the PodClique.
108-
LastOperation *LastOperation `json:"lastOperation,omitempty"`
109107
// LastErrors captures the last errors observed by the controller when reconciling the PodClique.
110108
LastErrors []LastError `json:"lastErrors,omitempty"`
111109
// Replicas is the total number of non-terminated Pods targeted by this PodClique.
@@ -169,8 +167,3 @@ type PodsSelectedToUpdate struct {
169167
func (pclq *PodClique) SetLastErrors(lastErrs ...LastError) {
170168
pclq.Status.LastErrors = lastErrs
171169
}
172-
173-
// SetLastOperation sets the last operation done by the respective reconciler on the PodClique.
174-
func (pclq *PodClique) SetLastOperation(operation *LastOperation) {
175-
pclq.Status.LastOperation = operation
176-
}

operator/api/core/v1alpha1/podcliqueset.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ type PodCliqueSetSpec struct {
6565
type PodCliqueSetStatus struct {
6666
// ObservedGeneration is the most recent generation observed by the controller.
6767
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
68-
// LastOperation captures the last operation done by the respective reconciler on the PodCliqueSet.
69-
LastOperation *LastOperation `json:"lastOperation,omitempty"`
7068
// LastErrors captures the last errors observed by the controller when reconciling the PodCliqueSet.
7169
LastErrors []LastError `json:"lastErrors,omitempty"`
7270
// Replicas is the total number of PodCliqueSet replicas created.
@@ -332,8 +330,3 @@ type LastError struct {
332330
func (pcs *PodCliqueSet) SetLastErrors(lastErrs ...LastError) {
333331
pcs.Status.LastErrors = lastErrs
334332
}
335-
336-
// SetLastOperation sets the last operation done by the respective reconciler on the PodCliqueSet.
337-
func (pcs *PodCliqueSet) SetLastOperation(operation *LastOperation) {
338-
pcs.Status.LastOperation = operation
339-
}

operator/api/core/v1alpha1/scalinggroup.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ type PodCliqueScalingGroupStatus struct {
9191
Selector *string `json:"selector,omitempty"`
9292
// ObservedGeneration is the most recent generation observed by the controller.
9393
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
94-
// LastOperation captures the last operation done by the respective reconciler on the PodClique.
95-
LastOperation *LastOperation `json:"lastOperation,omitempty"`
9694
// LastErrors captures the last errors observed by the controller when reconciling the PodClique.
9795
LastErrors []LastError `json:"lastErrors,omitempty"`
9896
// Conditions represents the latest available observations of the PodCliqueScalingGroup by its controller.
@@ -134,8 +132,3 @@ type PodCliqueScalingGroupReplicaRollingUpdateProgress struct {
134132
func (pcsg *PodCliqueScalingGroup) SetLastErrors(lastErrs ...LastError) {
135133
pcsg.Status.LastErrors = lastErrs
136134
}
137-
138-
// SetLastOperation sets the last operation done by the respective reconciler on the PodCliqueScalingGroup.
139-
func (pcsg *PodCliqueScalingGroup) SetLastOperation(lastOp *LastOperation) {
140-
pcsg.Status.LastOperation = lastOp
141-
}

operator/api/core/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

operator/initc/internal/wait.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626

2727
apicommon "github.com/NVIDIA/grove/operator/api/common"
2828
grovecorev1alpha1 "github.com/NVIDIA/grove/operator/api/core/v1alpha1"
29-
"github.com/NVIDIA/grove/operator/internal/common"
29+
"github.com/NVIDIA/grove/operator/internal/constants"
3030
groveerr "github.com/NVIDIA/grove/operator/internal/errors"
3131

3232
"github.com/go-logr/logr"
@@ -63,14 +63,14 @@ type ParentPodCliqueDependencies struct {
6363

6464
// NewPodCliqueState creates and initializes all parent PodCliques with an unready state.
6565
func NewPodCliqueState(podCliqueDependencies map[string]int, log logr.Logger) (*ParentPodCliqueDependencies, error) {
66-
podNamespaceFilePath := filepath.Join(common.VolumeMountPathPodInfo, common.PodNamespaceFileName)
66+
podNamespaceFilePath := filepath.Join(constants.VolumeMountPathPodInfo, constants.PodNamespaceFileName)
6767
podNamespace, err := os.ReadFile(podNamespaceFilePath)
6868
if err != nil {
6969
log.Error(err, "Failed to read the pod namespace from the file", "filepath", podNamespaceFilePath)
7070
return nil, err
7171
}
7272

73-
podGangNameFilePath := filepath.Join(common.VolumeMountPathPodInfo, common.PodGangNameFileName)
73+
podGangNameFilePath := filepath.Join(constants.VolumeMountPathPodInfo, constants.PodGangNameFileName)
7474
podGangName, err := os.ReadFile(podGangNameFilePath)
7575
if err != nil {
7676
log.Error(err, "Failed to read the PodGang name from the file", "filepath", podGangNameFilePath)

operator/internal/common/constants.go

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)