• 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/typed/acid.zalan.do/v1/fake/fake_postgresql.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
        "context"
29

30
        acidzalandov1 "github.com/zalando/postgres-operator/pkg/apis/acid.zalan.do/v1"
31
        v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
32
        labels "k8s.io/apimachinery/pkg/labels"
33
        schema "k8s.io/apimachinery/pkg/runtime/schema"
34
        types "k8s.io/apimachinery/pkg/types"
35
        watch "k8s.io/apimachinery/pkg/watch"
36
        testing "k8s.io/client-go/testing"
37
)
38

39
// FakePostgresqls implements PostgresqlInterface
40
type FakePostgresqls struct {
41
        Fake *FakeAcidV1
42
        ns   string
43
}
44

45
var postgresqlsResource = schema.GroupVersionResource{Group: "acid.zalan.do", Version: "v1", Resource: "postgresqls"}
46

47
var postgresqlsKind = schema.GroupVersionKind{Group: "acid.zalan.do", Version: "v1", Kind: "Postgresql"}
48

49
// Get takes name of the postgresql, and returns the corresponding postgresql object, and an error if there is any.
50
func (c *FakePostgresqls) Get(ctx context.Context, name string, options v1.GetOptions) (result *acidzalandov1.Postgresql, err error) {
×
51
        obj, err := c.Fake.
×
52
                Invokes(testing.NewGetAction(postgresqlsResource, c.ns, name), &acidzalandov1.Postgresql{})
×
53

×
54
        if obj == nil {
×
55
                return nil, err
×
56
        }
×
57
        return obj.(*acidzalandov1.Postgresql), err
×
58
}
59

60
// List takes label and field selectors, and returns the list of Postgresqls that match those selectors.
61
func (c *FakePostgresqls) List(ctx context.Context, opts v1.ListOptions) (result *acidzalandov1.PostgresqlList, err error) {
×
62
        obj, err := c.Fake.
×
63
                Invokes(testing.NewListAction(postgresqlsResource, postgresqlsKind, c.ns, opts), &acidzalandov1.PostgresqlList{})
×
64

×
65
        if obj == nil {
×
66
                return nil, err
×
67
        }
×
68

69
        label, _, _ := testing.ExtractFromListOptions(opts)
×
70
        if label == nil {
×
71
                label = labels.Everything()
×
72
        }
×
73
        list := &acidzalandov1.PostgresqlList{ListMeta: obj.(*acidzalandov1.PostgresqlList).ListMeta}
×
74
        for _, item := range obj.(*acidzalandov1.PostgresqlList).Items {
×
75
                if label.Matches(labels.Set(item.Labels)) {
×
76
                        list.Items = append(list.Items, item)
×
77
                }
×
78
        }
79
        return list, err
×
80
}
81

82
// Watch returns a watch.Interface that watches the requested postgresqls.
83
func (c *FakePostgresqls) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
×
84
        return c.Fake.
×
85
                InvokesWatch(testing.NewWatchAction(postgresqlsResource, c.ns, opts))
×
86

×
87
}
×
88

89
// Create takes the representation of a postgresql and creates it.  Returns the server's representation of the postgresql, and an error, if there is any.
UNCOV
90
func (c *FakePostgresqls) Create(ctx context.Context, postgresql *acidzalandov1.Postgresql, opts v1.CreateOptions) (result *acidzalandov1.Postgresql, err error) {
×
UNCOV
91
        obj, err := c.Fake.
×
UNCOV
92
                Invokes(testing.NewCreateAction(postgresqlsResource, c.ns, postgresql), &acidzalandov1.Postgresql{})
×
UNCOV
93

×
UNCOV
94
        if obj == nil {
×
95
                return nil, err
×
96
        }
×
UNCOV
97
        return obj.(*acidzalandov1.Postgresql), err
×
98
}
99

100
// Update takes the representation of a postgresql and updates it. Returns the server's representation of the postgresql, and an error, if there is any.
UNCOV
101
func (c *FakePostgresqls) Update(ctx context.Context, postgresql *acidzalandov1.Postgresql, opts v1.UpdateOptions) (result *acidzalandov1.Postgresql, err error) {
×
UNCOV
102
        obj, err := c.Fake.
×
UNCOV
103
                Invokes(testing.NewUpdateAction(postgresqlsResource, c.ns, postgresql), &acidzalandov1.Postgresql{})
×
UNCOV
104

×
UNCOV
105
        if obj == nil {
×
106
                return nil, err
×
107
        }
×
UNCOV
108
        return obj.(*acidzalandov1.Postgresql), err
×
109
}
110

111
// UpdateStatus was generated because the type contains a Status member.
112
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
113
func (c *FakePostgresqls) UpdateStatus(ctx context.Context, postgresql *acidzalandov1.Postgresql, opts v1.UpdateOptions) (*acidzalandov1.Postgresql, error) {
×
114
        obj, err := c.Fake.
×
115
                Invokes(testing.NewUpdateSubresourceAction(postgresqlsResource, "status", c.ns, postgresql), &acidzalandov1.Postgresql{})
×
116

×
117
        if obj == nil {
×
118
                return nil, err
×
119
        }
×
120
        return obj.(*acidzalandov1.Postgresql), err
×
121
}
122

123
// Delete takes name of the postgresql and deletes it. Returns an error if one occurs.
124
func (c *FakePostgresqls) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
×
125
        _, err := c.Fake.
×
126
                Invokes(testing.NewDeleteActionWithOptions(postgresqlsResource, c.ns, name, opts), &acidzalandov1.Postgresql{})
×
127

×
128
        return err
×
129
}
×
130

131
// DeleteCollection deletes a collection of objects.
132
func (c *FakePostgresqls) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
×
133
        action := testing.NewDeleteCollectionAction(postgresqlsResource, c.ns, listOpts)
×
134

×
135
        _, err := c.Fake.Invokes(action, &acidzalandov1.PostgresqlList{})
×
136
        return err
×
137
}
×
138

139
// Patch applies the patch and returns the patched postgresql.
UNCOV
140
func (c *FakePostgresqls) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *acidzalandov1.Postgresql, err error) {
×
UNCOV
141
        obj, err := c.Fake.
×
UNCOV
142
                Invokes(testing.NewPatchSubresourceAction(postgresqlsResource, c.ns, name, pt, data, subresources...), &acidzalandov1.Postgresql{})
×
UNCOV
143

×
UNCOV
144
        if obj == nil {
×
UNCOV
145
                return nil, err
×
UNCOV
146
        }
×
UNCOV
147
        return obj.(*acidzalandov1.Postgresql), err
×
148
}
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