-
Notifications
You must be signed in to change notification settings - Fork 113
/
bindingPatch.go
251 lines (201 loc) · 11.5 KB
/
bindingPatch.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
// 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/installation-configuration/#server-side-apply) for
// additional information about using Server-Side Apply to manage Kubernetes resources with Pulumi.
// Binding ties one object to another; for example, a pod is bound to a node by a scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead.
type BindingPatch 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 target object that you want to bind to the standard object.
Target ObjectReferencePatchPtrOutput `pulumi:"target"`
}
// NewBindingPatch registers a new resource with the given unique name, arguments, and options.
func NewBindingPatch(ctx *pulumi.Context,
name string, args *BindingPatchArgs, opts ...pulumi.ResourceOption) (*BindingPatch, error) {
if args == nil {
args = &BindingPatchArgs{}
}
args.ApiVersion = pulumi.StringPtr("v1")
args.Kind = pulumi.StringPtr("Binding")
var resource BindingPatch
err := ctx.RegisterResource("kubernetes:core/v1:BindingPatch", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBindingPatch gets an existing BindingPatch 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 GetBindingPatch(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BindingPatchState, opts ...pulumi.ResourceOption) (*BindingPatch, error) {
var resource BindingPatch
err := ctx.ReadResource("kubernetes:core/v1:BindingPatch", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering BindingPatch resources.
type bindingPatchState struct {
}
type BindingPatchState struct {
}
func (BindingPatchState) ElementType() reflect.Type {
return reflect.TypeOf((*bindingPatchState)(nil)).Elem()
}
type bindingPatchArgs 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 target object that you want to bind to the standard object.
Target *ObjectReferencePatch `pulumi:"target"`
}
// The set of arguments for constructing a BindingPatch resource.
type BindingPatchArgs 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 target object that you want to bind to the standard object.
Target ObjectReferencePatchPtrInput
}
func (BindingPatchArgs) ElementType() reflect.Type {
return reflect.TypeOf((*bindingPatchArgs)(nil)).Elem()
}
type BindingPatchInput interface {
pulumi.Input
ToBindingPatchOutput() BindingPatchOutput
ToBindingPatchOutputWithContext(ctx context.Context) BindingPatchOutput
}
func (*BindingPatch) ElementType() reflect.Type {
return reflect.TypeOf((**BindingPatch)(nil)).Elem()
}
func (i *BindingPatch) ToBindingPatchOutput() BindingPatchOutput {
return i.ToBindingPatchOutputWithContext(context.Background())
}
func (i *BindingPatch) ToBindingPatchOutputWithContext(ctx context.Context) BindingPatchOutput {
return pulumi.ToOutputWithContext(ctx, i).(BindingPatchOutput)
}
// BindingPatchArrayInput is an input type that accepts BindingPatchArray and BindingPatchArrayOutput values.
// You can construct a concrete instance of `BindingPatchArrayInput` via:
//
// BindingPatchArray{ BindingPatchArgs{...} }
type BindingPatchArrayInput interface {
pulumi.Input
ToBindingPatchArrayOutput() BindingPatchArrayOutput
ToBindingPatchArrayOutputWithContext(context.Context) BindingPatchArrayOutput
}
type BindingPatchArray []BindingPatchInput
func (BindingPatchArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BindingPatch)(nil)).Elem()
}
func (i BindingPatchArray) ToBindingPatchArrayOutput() BindingPatchArrayOutput {
return i.ToBindingPatchArrayOutputWithContext(context.Background())
}
func (i BindingPatchArray) ToBindingPatchArrayOutputWithContext(ctx context.Context) BindingPatchArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(BindingPatchArrayOutput)
}
// BindingPatchMapInput is an input type that accepts BindingPatchMap and BindingPatchMapOutput values.
// You can construct a concrete instance of `BindingPatchMapInput` via:
//
// BindingPatchMap{ "key": BindingPatchArgs{...} }
type BindingPatchMapInput interface {
pulumi.Input
ToBindingPatchMapOutput() BindingPatchMapOutput
ToBindingPatchMapOutputWithContext(context.Context) BindingPatchMapOutput
}
type BindingPatchMap map[string]BindingPatchInput
func (BindingPatchMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BindingPatch)(nil)).Elem()
}
func (i BindingPatchMap) ToBindingPatchMapOutput() BindingPatchMapOutput {
return i.ToBindingPatchMapOutputWithContext(context.Background())
}
func (i BindingPatchMap) ToBindingPatchMapOutputWithContext(ctx context.Context) BindingPatchMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(BindingPatchMapOutput)
}
type BindingPatchOutput struct{ *pulumi.OutputState }
func (BindingPatchOutput) ElementType() reflect.Type {
return reflect.TypeOf((**BindingPatch)(nil)).Elem()
}
func (o BindingPatchOutput) ToBindingPatchOutput() BindingPatchOutput {
return o
}
func (o BindingPatchOutput) ToBindingPatchOutputWithContext(ctx context.Context) BindingPatchOutput {
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 BindingPatchOutput) ApiVersion() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BindingPatch) 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 BindingPatchOutput) Kind() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BindingPatch) 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 BindingPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
return o.ApplyT(func(v *BindingPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
}
// The target object that you want to bind to the standard object.
func (o BindingPatchOutput) Target() ObjectReferencePatchPtrOutput {
return o.ApplyT(func(v *BindingPatch) ObjectReferencePatchPtrOutput { return v.Target }).(ObjectReferencePatchPtrOutput)
}
type BindingPatchArrayOutput struct{ *pulumi.OutputState }
func (BindingPatchArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BindingPatch)(nil)).Elem()
}
func (o BindingPatchArrayOutput) ToBindingPatchArrayOutput() BindingPatchArrayOutput {
return o
}
func (o BindingPatchArrayOutput) ToBindingPatchArrayOutputWithContext(ctx context.Context) BindingPatchArrayOutput {
return o
}
func (o BindingPatchArrayOutput) Index(i pulumi.IntInput) BindingPatchOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *BindingPatch {
return vs[0].([]*BindingPatch)[vs[1].(int)]
}).(BindingPatchOutput)
}
type BindingPatchMapOutput struct{ *pulumi.OutputState }
func (BindingPatchMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BindingPatch)(nil)).Elem()
}
func (o BindingPatchMapOutput) ToBindingPatchMapOutput() BindingPatchMapOutput {
return o
}
func (o BindingPatchMapOutput) ToBindingPatchMapOutputWithContext(ctx context.Context) BindingPatchMapOutput {
return o
}
func (o BindingPatchMapOutput) MapIndex(k pulumi.StringInput) BindingPatchOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *BindingPatch {
return vs[0].(map[string]*BindingPatch)[vs[1].(string)]
}).(BindingPatchOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*BindingPatchInput)(nil)).Elem(), &BindingPatch{})
pulumi.RegisterInputType(reflect.TypeOf((*BindingPatchArrayInput)(nil)).Elem(), BindingPatchArray{})
pulumi.RegisterInputType(reflect.TypeOf((*BindingPatchMapInput)(nil)).Elem(), BindingPatchMap{})
pulumi.RegisterOutputType(BindingPatchOutput{})
pulumi.RegisterOutputType(BindingPatchArrayOutput{})
pulumi.RegisterOutputType(BindingPatchMapOutput{})
}