-
Notifications
You must be signed in to change notification settings - Fork 113
/
endpointsPatch.go
263 lines (213 loc) · 13.6 KB
/
endpointsPatch.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
// Code generated by pulumigen DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"context"
"reflect"
metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Patch resources are used to modify existing Kubernetes resources by using
// Server-Side Apply updates. The name of the resource must be specified, but all other properties are optional. More than
// one patch may be applied to the same resource, and a random FieldManager name will be used for each Patch resource.
// Conflicts will result in an error by default, but can be forced using the "pulumi.com/patchForce" annotation. See the
// [Server-Side Apply Docs](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/managing-resources-with-server-side-apply/) for
// additional information about using Server-Side Apply to manage Kubernetes resources with Pulumi.
// Endpoints is a collection of endpoints that implement the actual service. Example:
//
// Name: "mysvc",
// Subsets: [
// {
// Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}],
// Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}]
// },
// {
// Addresses: [{"ip": "10.10.3.3"}],
// Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}]
// },
// ]
type EndpointsPatch struct {
pulumi.CustomResourceState
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Kind pulumi.StringPtrOutput `pulumi:"kind"`
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"`
// The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service.
Subsets EndpointSubsetPatchArrayOutput `pulumi:"subsets"`
}
// NewEndpointsPatch registers a new resource with the given unique name, arguments, and options.
func NewEndpointsPatch(ctx *pulumi.Context,
name string, args *EndpointsPatchArgs, opts ...pulumi.ResourceOption) (*EndpointsPatch, error) {
if args == nil {
args = &EndpointsPatchArgs{}
}
args.ApiVersion = pulumi.StringPtr("v1")
args.Kind = pulumi.StringPtr("Endpoints")
var resource EndpointsPatch
err := ctx.RegisterResource("kubernetes:core/v1:EndpointsPatch", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEndpointsPatch gets an existing EndpointsPatch resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetEndpointsPatch(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EndpointsPatchState, opts ...pulumi.ResourceOption) (*EndpointsPatch, error) {
var resource EndpointsPatch
err := ctx.ReadResource("kubernetes:core/v1:EndpointsPatch", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EndpointsPatch resources.
type endpointsPatchState struct {
}
type EndpointsPatchState struct {
}
func (EndpointsPatchState) ElementType() reflect.Type {
return reflect.TypeOf((*endpointsPatchState)(nil)).Elem()
}
type endpointsPatchArgs struct {
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
ApiVersion *string `pulumi:"apiVersion"`
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Kind *string `pulumi:"kind"`
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
// The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service.
Subsets []EndpointSubsetPatch `pulumi:"subsets"`
}
// The set of arguments for constructing a EndpointsPatch resource.
type EndpointsPatchArgs struct {
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
ApiVersion pulumi.StringPtrInput
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Kind pulumi.StringPtrInput
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
Metadata metav1.ObjectMetaPatchPtrInput
// The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service.
Subsets EndpointSubsetPatchArrayInput
}
func (EndpointsPatchArgs) ElementType() reflect.Type {
return reflect.TypeOf((*endpointsPatchArgs)(nil)).Elem()
}
type EndpointsPatchInput interface {
pulumi.Input
ToEndpointsPatchOutput() EndpointsPatchOutput
ToEndpointsPatchOutputWithContext(ctx context.Context) EndpointsPatchOutput
}
func (*EndpointsPatch) ElementType() reflect.Type {
return reflect.TypeOf((**EndpointsPatch)(nil)).Elem()
}
func (i *EndpointsPatch) ToEndpointsPatchOutput() EndpointsPatchOutput {
return i.ToEndpointsPatchOutputWithContext(context.Background())
}
func (i *EndpointsPatch) ToEndpointsPatchOutputWithContext(ctx context.Context) EndpointsPatchOutput {
return pulumi.ToOutputWithContext(ctx, i).(EndpointsPatchOutput)
}
// EndpointsPatchArrayInput is an input type that accepts EndpointsPatchArray and EndpointsPatchArrayOutput values.
// You can construct a concrete instance of `EndpointsPatchArrayInput` via:
//
// EndpointsPatchArray{ EndpointsPatchArgs{...} }
type EndpointsPatchArrayInput interface {
pulumi.Input
ToEndpointsPatchArrayOutput() EndpointsPatchArrayOutput
ToEndpointsPatchArrayOutputWithContext(context.Context) EndpointsPatchArrayOutput
}
type EndpointsPatchArray []EndpointsPatchInput
func (EndpointsPatchArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*EndpointsPatch)(nil)).Elem()
}
func (i EndpointsPatchArray) ToEndpointsPatchArrayOutput() EndpointsPatchArrayOutput {
return i.ToEndpointsPatchArrayOutputWithContext(context.Background())
}
func (i EndpointsPatchArray) ToEndpointsPatchArrayOutputWithContext(ctx context.Context) EndpointsPatchArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(EndpointsPatchArrayOutput)
}
// EndpointsPatchMapInput is an input type that accepts EndpointsPatchMap and EndpointsPatchMapOutput values.
// You can construct a concrete instance of `EndpointsPatchMapInput` via:
//
// EndpointsPatchMap{ "key": EndpointsPatchArgs{...} }
type EndpointsPatchMapInput interface {
pulumi.Input
ToEndpointsPatchMapOutput() EndpointsPatchMapOutput
ToEndpointsPatchMapOutputWithContext(context.Context) EndpointsPatchMapOutput
}
type EndpointsPatchMap map[string]EndpointsPatchInput
func (EndpointsPatchMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*EndpointsPatch)(nil)).Elem()
}
func (i EndpointsPatchMap) ToEndpointsPatchMapOutput() EndpointsPatchMapOutput {
return i.ToEndpointsPatchMapOutputWithContext(context.Background())
}
func (i EndpointsPatchMap) ToEndpointsPatchMapOutputWithContext(ctx context.Context) EndpointsPatchMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(EndpointsPatchMapOutput)
}
type EndpointsPatchOutput struct{ *pulumi.OutputState }
func (EndpointsPatchOutput) ElementType() reflect.Type {
return reflect.TypeOf((**EndpointsPatch)(nil)).Elem()
}
func (o EndpointsPatchOutput) ToEndpointsPatchOutput() EndpointsPatchOutput {
return o
}
func (o EndpointsPatchOutput) ToEndpointsPatchOutputWithContext(ctx context.Context) EndpointsPatchOutput {
return o
}
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
func (o EndpointsPatchOutput) ApiVersion() pulumi.StringPtrOutput {
return o.ApplyT(func(v *EndpointsPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
}
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
func (o EndpointsPatchOutput) Kind() pulumi.StringPtrOutput {
return o.ApplyT(func(v *EndpointsPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
}
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
func (o EndpointsPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
return o.ApplyT(func(v *EndpointsPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
}
// The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service.
func (o EndpointsPatchOutput) Subsets() EndpointSubsetPatchArrayOutput {
return o.ApplyT(func(v *EndpointsPatch) EndpointSubsetPatchArrayOutput { return v.Subsets }).(EndpointSubsetPatchArrayOutput)
}
type EndpointsPatchArrayOutput struct{ *pulumi.OutputState }
func (EndpointsPatchArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*EndpointsPatch)(nil)).Elem()
}
func (o EndpointsPatchArrayOutput) ToEndpointsPatchArrayOutput() EndpointsPatchArrayOutput {
return o
}
func (o EndpointsPatchArrayOutput) ToEndpointsPatchArrayOutputWithContext(ctx context.Context) EndpointsPatchArrayOutput {
return o
}
func (o EndpointsPatchArrayOutput) Index(i pulumi.IntInput) EndpointsPatchOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EndpointsPatch {
return vs[0].([]*EndpointsPatch)[vs[1].(int)]
}).(EndpointsPatchOutput)
}
type EndpointsPatchMapOutput struct{ *pulumi.OutputState }
func (EndpointsPatchMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*EndpointsPatch)(nil)).Elem()
}
func (o EndpointsPatchMapOutput) ToEndpointsPatchMapOutput() EndpointsPatchMapOutput {
return o
}
func (o EndpointsPatchMapOutput) ToEndpointsPatchMapOutputWithContext(ctx context.Context) EndpointsPatchMapOutput {
return o
}
func (o EndpointsPatchMapOutput) MapIndex(k pulumi.StringInput) EndpointsPatchOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EndpointsPatch {
return vs[0].(map[string]*EndpointsPatch)[vs[1].(string)]
}).(EndpointsPatchOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*EndpointsPatchInput)(nil)).Elem(), &EndpointsPatch{})
pulumi.RegisterInputType(reflect.TypeOf((*EndpointsPatchArrayInput)(nil)).Elem(), EndpointsPatchArray{})
pulumi.RegisterInputType(reflect.TypeOf((*EndpointsPatchMapInput)(nil)).Elem(), EndpointsPatchMap{})
pulumi.RegisterOutputType(EndpointsPatchOutput{})
pulumi.RegisterOutputType(EndpointsPatchArrayOutput{})
pulumi.RegisterOutputType(EndpointsPatchMapOutput{})
}