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

Function GetFencedInstances

pkg/utils/fencing.go:52–64  ·  view source on GitHub ↗

GetFencedInstances gets the set of fenced servers from the annotations

(annotations map[string]string)

Source from the content-addressed store, hash-verified

50
51// GetFencedInstances gets the set of fenced servers from the annotations
52func GetFencedInstances(annotations map[string]string) (*stringset.Data, error) {
53 fencedInstances, ok := annotations[FencedInstanceAnnotation]
54 if !ok {
55 return stringset.New(), nil
56 }
57
58 var fencedInstancesList []string
59 if err := json.Unmarshal([]byte(fencedInstances), &fencedInstancesList); err != nil {
60 return nil, ErrorFencedInstancesSyntax
61 }
62
63 return stringset.From(fencedInstancesList), nil
64}
65
66// setFencedInstances sets the list of fenced servers inside the annotations
67func setFencedInstances(object metav1.Object, data *stringset.Data) error {

Callers 7

ensurePodIsFencedMethod · 0.92
offline_test.goFile · 0.92
reconciler_test.goFile · 0.92
printBasicInfoMethod · 0.92
IsInstanceFencedMethod · 0.92
AddFencedInstanceFunction · 0.85
removeFencedInstanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected