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

Function PodMonitorExist

pkg/utils/discovery.go:179–186  ·  view source on GitHub ↗

PodMonitorExist tries to find the PodMonitor resource in the current cluster

(client discovery.DiscoveryInterface)

Source from the content-addressed store, hash-verified

177
178// PodMonitorExist tries to find the PodMonitor resource in the current cluster
179func PodMonitorExist(client discovery.DiscoveryInterface) (bool, error) {
180 exist, err := resourceExist(client, "monitoring.coreos.com/v1", "podmonitors")
181 if err != nil {
182 return false, err
183 }
184
185 return exist, nil
186}
187
188// extractK8sMinorVersion extracts and parses the Kubernetes minor version from
189// the version info that's been detected by discovery client

Callers 3

createOrPatchPodMonitorFunction · 0.92
monitoring_test.goFile · 0.92
discovery_test.goFile · 0.85

Calls 1

resourceExistFunction · 0.85

Tested by

no test coverage detected