MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / DetectVolumeSnapshotExist

Function DetectVolumeSnapshotExist

pkg/utils/discovery.go:157–164  ·  view source on GitHub ↗

DetectVolumeSnapshotExist connects to the discovery API and find out if the VolumeSnapshot CRD exist in the cluster

(client discovery.DiscoveryInterface)

Source from the content-addressed store, hash-verified

155// DetectVolumeSnapshotExist connects to the discovery API and find out if
156// the VolumeSnapshot CRD exist in the cluster
157func DetectVolumeSnapshotExist(client discovery.DiscoveryInterface) (err error) {
158 haveVolumeSnapshot, err = resourceExist(client, "snapshot.storage.k8s.io/v1", "volumesnapshots")
159 if err != nil {
160 return err
161 }
162
163 return nil
164}
165
166// SetVolumeSnapshot set the haveVolumeSnapshot variable to a specific value for testing purposes
167// IMPORTANT: use it only in the unit tests

Callers 2

RunControllerFunction · 0.92
discovery_test.goFile · 0.85

Calls 1

resourceExistFunction · 0.85

Tested by

no test coverage detected