Skip to content

Commit

Permalink
chore: update patchOpenStackCluster to modify only apiServerFixedIP a…
Browse files Browse the repository at this point in the history
…nd apiServerPort in spec (#150)
  • Loading branch information
nilpntr authored Nov 13, 2024
1 parent d9b9220 commit 2c9b50f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions controllers/kamajicontrolplane_controller_cluster_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,12 @@ func (r *KamajiControlPlaneReconciler) patchOpenStackCluster(ctx context.Context
return errors.Wrap(err, "unable to create patch helper")
}

if err = unstructured.SetNestedMap(osc.Object, map[string]interface{}{
"apiServerFixedIP": endpoint,
"apiServerPort": port,
}, "spec"); err != nil {
return errors.Wrap(err, fmt.Sprintf("unable to set unstructured %s spec patch", osc.GetKind()))
if err = unstructured.SetNestedField(osc.Object, endpoint, "spec", "apiServerFixedIP"); err != nil {
return errors.Wrap(err, fmt.Sprintf("unable to set unstructured %s spec apiServerFixedIP", osc.GetKind()))
}

if err = unstructured.SetNestedField(osc.Object, port, "spec", "apiServerPort"); err != nil {
return errors.Wrap(err, fmt.Sprintf("unable to set unstructured %s spec apiServerPort", osc.GetKind()))
}

if err = patchHelper.Patch(ctx, &osc); err != nil {
Expand Down

0 comments on commit 2c9b50f

Please sign in to comment.