cloudbase/garm-provider-gcp

When instance does not exist (404) delete should be successful

Hdom opened this issue · 0 comments

Hdom commented

When instance does not exist (404) delete should be successful, otherwise it falls into an endless loop of attempting to remove an instance that doesn't exist.

My solution is as follows:
https://github.com/cloudbase/garm-provider-gcp/blob/main/internal/client/gcp.go#L176

	if err.(*apierror.APIError).HTTPCode() == 404 {
		return nil
	}

Fix can be found here: Hdom@a22e55a#diff-fd6fb078945fce9b41e3aced4a0cb03cf47c4d318e2423733b23c741b30b7975R178-R182