Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning for node out of capacity #201

Merged
merged 3 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/v1beta1/conditions_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const (
OutOfMemoryReason = "OutOfMemory"
// OutOfCapacityReason used when the AzureStackHCI resource is out of capacity.
OutOfCapacityReason = "OutOfCapacity"
// OutOfNodeCapacityReason used when the AzureStackHCI node is out of capacity.
OutOfNodeCapacityReason = "OutOfNodeCapacity"
)

// Conditions and condition Reasons for the AzureStackHCICluster object
Expand Down
2 changes: 2 additions & 0 deletions controllers/azurestackhcivirtualmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ func (r *AzureStackHCIVirtualMachineReconciler) getOrCreate(virtualMachineScope
conditions.MarkFalse(virtualMachineScope.AzureStackHCIVirtualMachine, infrav1.VMRunningCondition, infrav1.OutOfMemoryReason, clusterv1.ConditionSeverityError, err.Error())
case mocerrors.OutOfCapacity.Error():
conditions.MarkFalse(virtualMachineScope.AzureStackHCIVirtualMachine, infrav1.VMRunningCondition, infrav1.OutOfCapacityReason, clusterv1.ConditionSeverityError, err.Error())
case mocerrors.OutOfNodeCapacity.Error():
conditions.MarkFalse(virtualMachineScope.AzureStackHCIVirtualMachine, infrav1.VMRunningCondition, infrav1.OutOfNodeCapacityReason, clusterv1.ConditionSeverityWarning, err.Error())
default:
conditions.MarkFalse(virtualMachineScope.AzureStackHCIVirtualMachine, infrav1.VMRunningCondition, infrav1.VMProvisionFailedReason, clusterv1.ConditionSeverityError, err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/Azure/go-autorest/autorest/to v0.4.0
github.com/blang/semver v3.5.1+incompatible
github.com/go-logr/logr v1.2.0
github.com/microsoft/moc v0.10.27-alpha.0
github.com/microsoft/moc v0.10.27-alpha.4
github.com/microsoft/moc-sdk-for-go v0.10.27-alpha.7
github.com/pkg/errors v0.9.1
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/microsoft/moc v0.10.27-alpha.0 h1:/BMgy++D3o1lxArYsAjr8PdCpre7erlOOFYt1RDif3k=
github.com/microsoft/moc v0.10.27-alpha.0/go.mod h1:dOkeGSUQPI+L6YB8DlwCQOgpfUzqHvkk9uzd8sdvgTs=
github.com/microsoft/moc v0.10.27-alpha.4 h1:kL2TS+TUb+3wvl3nRM0W2HChSMLZo7hFqoHJOyFBWfc=
github.com/microsoft/moc v0.10.27-alpha.4/go.mod h1:dOkeGSUQPI+L6YB8DlwCQOgpfUzqHvkk9uzd8sdvgTs=
github.com/microsoft/moc-sdk-for-go v0.10.27-alpha.7 h1:aSKmGfLIF4tLSCYglQQCA0wpbibUrqkrQjc3oig5TUw=
github.com/microsoft/moc-sdk-for-go v0.10.27-alpha.7/go.mod h1:HI19skmLOOjcAatNofLMbdMsMIq83YYopdu/b1OMvZU=
github.com/microsoft/wmi v0.5.0-alpha.11 h1:4RMeVJQgaC4Ai/JoPwvfUrpXK5F77bgav4Imp7Zgmss=
Expand Down