Skip to content

Commit

Permalink
WIP: demo: ApplyState usage
Browse files Browse the repository at this point in the history
the new API ApplyState should initially used only
in the new code which deals with HCP and machineconfig
removal (PR #1025)

Signed-off-by: Francesco Romani <[email protected]>
  • Loading branch information
ffromani committed Oct 9, 2024
1 parent b148f46 commit 2f145d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/numaresourcesoperator_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func (r *NUMAResourcesOperatorReconciler) syncNodeResourceTopologyAPI(ctx contex
var updatedCount int
objStates := existing.State(r.APIManifests)
for _, objState := range objStates {
_, updated, err2 := apply.ApplyObject(ctx, r.Client, objState)
_, updated, err2 := apply.ApplyState(ctx, r.Client, objState)
if err2 != nil {
err = errors.Wrapf(err2, "could not create %s", objState.Desired.GetObjectKind().GroupVersionKind().String())
break
Expand Down Expand Up @@ -338,7 +338,7 @@ func (r *NUMAResourcesOperatorReconciler) syncMachineConfigs(ctx context.Context
break
}

_, updated, err2 := apply.ApplyObject(ctx, r.Client, objState)
_, updated, err2 := apply.ApplyState(ctx, r.Client, objState)
if err2 != nil {
err = errors.Wrapf(err2, "could not apply (%s) %s/%s", objState.Desired.GetObjectKind().GroupVersionKind(), objState.Desired.GetNamespace(), objState.Desired.GetName())
break
Expand Down Expand Up @@ -477,7 +477,7 @@ func (r *NUMAResourcesOperatorReconciler) syncNUMAResourcesOperatorResources(ctx
if err != nil {
return nil, errors.Wrapf(err, "failed to set controller reference to %s %s", objState.Desired.GetNamespace(), objState.Desired.GetName())
}
obj, _, err := apply.ApplyObject(ctx, r.Client, objState)
obj, _, err := apply.ApplyState(ctx, r.Client, objState)
if err != nil {
return nil, errors.Wrapf(err, "failed to apply (%s) %s/%s", objState.Desired.GetObjectKind().GroupVersionKind(), objState.Desired.GetNamespace(), objState.Desired.GetName())
}
Expand Down

0 comments on commit 2f145d9

Please sign in to comment.