This is a workaround for a false positive in the staticcheck linter,
which has not been addressed yet.
See https://github.com/dominikh/go-tools/issues/1294.
Once this is fixed in staticcheck, we can just remove the exclude rule
from the golangci config.
Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
The workqueue implementation was recently updated to be strongly typed,
using Go generics. However the metrics implementation was not updated,
and continued using interface{}. This translated to unnecessary memory
allocations when invoking the queueMetrics interface methods to track
queue operation. We can avoid these extra heap allocations by using
generics for the metrics implementation as well.
Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
Go float64 values that have no fractional component and can be accurately represented as an int64,
when present in an unstructured object and roundtripped through JSON, appear in the resulting object
with the concrete type int64. For code that processes unstructured objects and expects to find
float64 values, this is a surprising edge case. NestedNumberAsFloat64 behaves the same as
NestedFloat64 when accessing a float64 value, but will additionally convert to float64 and return an
int64 value at the requested path. Errors are returned on encountering an int64 that cannot be
precisely represented as a float64.
The azure and gcp plugins no longer do anything other than point to
the corresponding external credential plugins. Client code should no
longer try to load them, so they should be removed from the examples.
Signed-off-by: Stephen Kitt <skitt@redhat.com>
During JSON roundtrips of unstructured objects, float64 values with no fractional component will in
certain cases roundtrip to int64. This is potentially surprising existing behavior. Adding dedicated
test coverage for this will help codify the behavior and mitigate future regression risk.
The intent is to check the real-world impact of an API change by
compiling controller-runtime with staging repos replaced by the
modified ones.
Such build checks must be requested explicitly with the new -b flag.
VolumeSnapshotContents object created for the pre-provisioned
snapshots does not include VolumeSnapshotClass. Therefore
secrets required by backing CSI driver cannot be provided
via external snapshot controller. The missing secrets causes
failure in the backing CSI driver.