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

Improve error handling when InitializeMachine method is not yet implement by a provider #934

Closed
ashwani2k opened this issue Aug 13, 2024 · 1 comment · Fixed by #940
Closed
Assignees
Labels
kind/bug Bug priority/2 Priority (lower number equals higher priority) status/closed Issue is closed (either delivered or triaged)

Comments

@ashwani2k
Copy link
Contributor

How to categorize this issue?

/area logging|ops-productivity
/kind bug
/priority 2

What happened:
Currently the InitializeMachine is not implemented by every provider other than AWS.
However as the call to the provider implementation results in Unimplemented error type, MCM logs the error and doesn't check the semantics to rather ignore this error. https://github.com/gardener/machine-controller-manager/blob/ff8261398277c3e5a481f0[…]fb57c417dfd07754/pkg/util/provider/machinecontroller/machine.go.

  klog.V(3).Infof("Initializing VM instance for Machine %q", machine.Name)
    resp, err := c.driver.InitializeMachine(ctx, req)
    if err != nil {
        errStatus, ok := status.FromError(err)
        if !ok {
            klog.Errorf("Cannot decode Driver error for machine %q: %s. Unexpected behaviour as Driver errors are expected to be of type status.Status", machine.Name, err)
            return machineutils.LongRetry, err
        }
        klog.Errorf("Error occurred while initializing VM instance for machine %q: %s", machine.Name, err)
        switch errStatus.Code() {
        case codes.Unimplemented:
            klog.V(3).Infof("Provider does not support Driver.InitializeMachine - skipping VM instance initialization for %q.", machine.Name)

Can we mark this as an Info/Warning message instead of error.

What you expected to happen:
The system to ignore the error when the method is not yet implemented and just log the behavior as an Info log.
How to reproduce it (as minimally and precisely as possible):
Create a machine in Azure where this method is not implemented and you should see the logs containing this error.

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version):
  • Cloud provider or hardware configuration:
  • Others: azure|gcp|openstack
@ashwani2k ashwani2k added the kind/bug Bug label Aug 13, 2024
@gardener-robot gardener-robot added the priority/2 Priority (lower number equals higher priority) label Aug 13, 2024
@gardener-robot
Copy link

@ashwani2k Label area/logging|ops-productivity does not exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bug priority/2 Priority (lower number equals higher priority) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
3 participants