Skip to content

Commit

Permalink
Fix BMC reconciliation and print columns (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
afritzler authored Apr 29, 2024
1 parent 8f285df commit 57f46ef
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion api/v1alpha1/bmc_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ const (
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:printcolumn:name="MACAddress",type=string,JSONPath=`.status.macAddress`
// +kubebuilder:printcolumn:name="MACAddress",type=string,JSONPath=`.status.ip`
// +kubebuilder:printcolumn:name="Manufacturer",type=string,JSONPath=`.status.manufacturer`
// +kubebuilder:printcolumn:name="Model",type=string,JSONPath=`.status.model`
// +kubebuilder:printcolumn:name="SKU",type=string,JSONPath=`.status.sku`,priority=100
// +kubebuilder:printcolumn:name="SerialNumber",type=string,JSONPath=`.status.serialNumber`,priority=100
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion internal/controller/bmc_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ func (r *BMCReconciler) discoverServers(ctx context.Context, bmcObj *metalv1alph
func (r *BMCReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&metalv1alpha1.BMC{}).
Owns(&metalv1alpha1.Server{}).
// TODO: don't recreate Server if deleted manually
//Owns(&metalv1alpha1.Server{}).
// TODO: add watches for Endpoints and BMCSecrets
Complete(r)
}
1 change: 0 additions & 1 deletion internal/controller/server_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ func (r *ServerReconciler) ensureServerStateTransition(ctx context.Context, log
}
log.V(1).Info("Reconciled available state")
case metalv1alpha1.ServerStateReserved:

if err := r.updateServerStatus(ctx, log, server); err != nil {
return false, err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/server_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ var _ = Describe("Server Controller", func() {
Name: server.Name,
},
}
Eventually(Get(config)).Should(Satisfy(apierrors.IsNotFound))
Consistently(Get(config)).Should(Satisfy(apierrors.IsNotFound))
})

// TODO: test server with manual BMC registration
Expand Down

0 comments on commit 57f46ef

Please sign in to comment.