• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zalando / postgres-operator / 17042710574

18 Aug 2025 01:55PM UTC coverage: 42.062% (-3.4%) from 45.498%
17042710574

Pull #2943

github

web-flow
Merge 045132513 into 51135b07d
Pull Request #2943: Ensure compatibility with Spilo after WAL-E removal (support old and new versions)

14 of 15 new or added lines in 3 files covered. (93.33%)

531 existing lines in 13 files now uncovered.

6494 of 15439 relevant lines covered (42.06%)

15.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pkg/generated/clientset/versioned/fake/clientset_generated.go
1
/*
2
Copyright 2025 Compose, Zalando SE
3

4
Permission is hereby granted, free of charge, to any person obtaining a copy
5
of this software and associated documentation files (the "Software"), to deal
6
in the Software without restriction, including without limitation the rights
7
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
copies of the Software, and to permit persons to whom the Software is
9
furnished to do so, subject to the following conditions:
10

11
The above copyright notice and this permission notice shall be included in all
12
copies or substantial portions of the Software.
13

14
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
SOFTWARE.
21
*/
22

23
// Code generated by client-gen. DO NOT EDIT.
24

25
package fake
26

27
import (
28
        clientset "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned"
29
        acidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1"
30
        fakeacidv1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/acid.zalan.do/v1/fake"
31
        zalandov1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/zalando.org/v1"
32
        fakezalandov1 "github.com/zalando/postgres-operator/pkg/generated/clientset/versioned/typed/zalando.org/v1/fake"
33
        "k8s.io/apimachinery/pkg/runtime"
34
        "k8s.io/apimachinery/pkg/watch"
35
        "k8s.io/client-go/discovery"
36
        fakediscovery "k8s.io/client-go/discovery/fake"
37
        "k8s.io/client-go/testing"
38
)
39

40
// NewSimpleClientset returns a clientset that will respond with the provided objects.
41
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
42
// without applying any validations and/or defaults. It shouldn't be considered a replacement
43
// for a real clientset and is mostly useful in simple unit tests.
UNCOV
44
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
×
UNCOV
45
        o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
×
UNCOV
46
        for _, obj := range objects {
×
47
                if err := o.Add(obj); err != nil {
×
48
                        panic(err)
×
49
                }
50
        }
51

UNCOV
52
        cs := &Clientset{tracker: o}
×
UNCOV
53
        cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
×
UNCOV
54
        cs.AddReactor("*", "*", testing.ObjectReaction(o))
×
UNCOV
55
        cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
×
56
                gvr := action.GetResource()
×
57
                ns := action.GetNamespace()
×
58
                watch, err := o.Watch(gvr, ns)
×
59
                if err != nil {
×
60
                        return false, nil, err
×
61
                }
×
62
                return true, watch, nil
×
63
        })
64

UNCOV
65
        return cs
×
66
}
67

68
// Clientset implements clientset.Interface. Meant to be embedded into a
69
// struct to get a default implementation. This makes faking out just the method
70
// you want to test easier.
71
type Clientset struct {
72
        testing.Fake
73
        discovery *fakediscovery.FakeDiscovery
74
        tracker   testing.ObjectTracker
75
}
76

77
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
×
78
        return c.discovery
×
79
}
×
80

81
func (c *Clientset) Tracker() testing.ObjectTracker {
×
82
        return c.tracker
×
83
}
×
84

85
var (
86
        _ clientset.Interface = &Clientset{}
87
        _ testing.FakeClient  = &Clientset{}
88
)
89

90
// AcidV1 retrieves the AcidV1Client
UNCOV
91
func (c *Clientset) AcidV1() acidv1.AcidV1Interface {
×
UNCOV
92
        return &fakeacidv1.FakeAcidV1{Fake: &c.Fake}
×
UNCOV
93
}
×
94

95
// ZalandoV1 retrieves the ZalandoV1Client
UNCOV
96
func (c *Clientset) ZalandoV1() zalandov1.ZalandoV1Interface {
×
UNCOV
97
        return &fakezalandov1.FakeZalandoV1{Fake: &c.Fake}
×
UNCOV
98
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc