github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/core/v1/podTemplatePatch.go (about) 1 // Code generated by pulumigen DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package v1 5 6 import ( 7 "context" 8 "reflect" 9 10 metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Patch resources are used to modify existing Kubernetes resources by using 15 // Server-Side Apply updates. The name of the resource must be specified, but all other properties are optional. More than 16 // one patch may be applied to the same resource, and a random FieldManager name will be used for each Patch resource. 17 // Conflicts will result in an error by default, but can be forced using the "pulumi.com/patchForce" annotation. See the 18 // [Server-Side Apply Docs](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/managing-resources-with-server-side-apply/) for 19 // additional information about using Server-Side Apply to manage Kubernetes resources with Pulumi. 20 // PodTemplate describes a template for creating copies of a predefined pod. 21 type PodTemplatePatch struct { 22 pulumi.CustomResourceState 23 24 // 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 25 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 26 // 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 27 Kind pulumi.StringPtrOutput `pulumi:"kind"` 28 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 29 Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"` 30 // Template defines the pods that will be created from this pod template. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 31 Template PodTemplateSpecPatchPtrOutput `pulumi:"template"` 32 } 33 34 // NewPodTemplatePatch registers a new resource with the given unique name, arguments, and options. 35 func NewPodTemplatePatch(ctx *pulumi.Context, 36 name string, args *PodTemplatePatchArgs, opts ...pulumi.ResourceOption) (*PodTemplatePatch, error) { 37 if args == nil { 38 args = &PodTemplatePatchArgs{} 39 } 40 41 args.ApiVersion = pulumi.StringPtr("v1") 42 args.Kind = pulumi.StringPtr("PodTemplate") 43 var resource PodTemplatePatch 44 err := ctx.RegisterResource("kubernetes:core/v1:PodTemplatePatch", name, args, &resource, opts...) 45 if err != nil { 46 return nil, err 47 } 48 return &resource, nil 49 } 50 51 // GetPodTemplatePatch gets an existing PodTemplatePatch resource's state with the given name, ID, and optional 52 // state properties that are used to uniquely qualify the lookup (nil if not required). 53 func GetPodTemplatePatch(ctx *pulumi.Context, 54 name string, id pulumi.IDInput, state *PodTemplatePatchState, opts ...pulumi.ResourceOption) (*PodTemplatePatch, error) { 55 var resource PodTemplatePatch 56 err := ctx.ReadResource("kubernetes:core/v1:PodTemplatePatch", name, id, state, &resource, opts...) 57 if err != nil { 58 return nil, err 59 } 60 return &resource, nil 61 } 62 63 // Input properties used for looking up and filtering PodTemplatePatch resources. 64 type podTemplatePatchState struct { 65 } 66 67 type PodTemplatePatchState struct { 68 } 69 70 func (PodTemplatePatchState) ElementType() reflect.Type { 71 return reflect.TypeOf((*podTemplatePatchState)(nil)).Elem() 72 } 73 74 type podTemplatePatchArgs struct { 75 // 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 76 ApiVersion *string `pulumi:"apiVersion"` 77 // 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 78 Kind *string `pulumi:"kind"` 79 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 80 Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"` 81 // Template defines the pods that will be created from this pod template. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 82 Template *PodTemplateSpecPatch `pulumi:"template"` 83 } 84 85 // The set of arguments for constructing a PodTemplatePatch resource. 86 type PodTemplatePatchArgs struct { 87 // 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 88 ApiVersion pulumi.StringPtrInput 89 // 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 90 Kind pulumi.StringPtrInput 91 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 92 Metadata metav1.ObjectMetaPatchPtrInput 93 // Template defines the pods that will be created from this pod template. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 94 Template PodTemplateSpecPatchPtrInput 95 } 96 97 func (PodTemplatePatchArgs) ElementType() reflect.Type { 98 return reflect.TypeOf((*podTemplatePatchArgs)(nil)).Elem() 99 } 100 101 type PodTemplatePatchInput interface { 102 pulumi.Input 103 104 ToPodTemplatePatchOutput() PodTemplatePatchOutput 105 ToPodTemplatePatchOutputWithContext(ctx context.Context) PodTemplatePatchOutput 106 } 107 108 func (*PodTemplatePatch) ElementType() reflect.Type { 109 return reflect.TypeOf((**PodTemplatePatch)(nil)).Elem() 110 } 111 112 func (i *PodTemplatePatch) ToPodTemplatePatchOutput() PodTemplatePatchOutput { 113 return i.ToPodTemplatePatchOutputWithContext(context.Background()) 114 } 115 116 func (i *PodTemplatePatch) ToPodTemplatePatchOutputWithContext(ctx context.Context) PodTemplatePatchOutput { 117 return pulumi.ToOutputWithContext(ctx, i).(PodTemplatePatchOutput) 118 } 119 120 // PodTemplatePatchArrayInput is an input type that accepts PodTemplatePatchArray and PodTemplatePatchArrayOutput values. 121 // You can construct a concrete instance of `PodTemplatePatchArrayInput` via: 122 // 123 // PodTemplatePatchArray{ PodTemplatePatchArgs{...} } 124 type PodTemplatePatchArrayInput interface { 125 pulumi.Input 126 127 ToPodTemplatePatchArrayOutput() PodTemplatePatchArrayOutput 128 ToPodTemplatePatchArrayOutputWithContext(context.Context) PodTemplatePatchArrayOutput 129 } 130 131 type PodTemplatePatchArray []PodTemplatePatchInput 132 133 func (PodTemplatePatchArray) ElementType() reflect.Type { 134 return reflect.TypeOf((*[]*PodTemplatePatch)(nil)).Elem() 135 } 136 137 func (i PodTemplatePatchArray) ToPodTemplatePatchArrayOutput() PodTemplatePatchArrayOutput { 138 return i.ToPodTemplatePatchArrayOutputWithContext(context.Background()) 139 } 140 141 func (i PodTemplatePatchArray) ToPodTemplatePatchArrayOutputWithContext(ctx context.Context) PodTemplatePatchArrayOutput { 142 return pulumi.ToOutputWithContext(ctx, i).(PodTemplatePatchArrayOutput) 143 } 144 145 // PodTemplatePatchMapInput is an input type that accepts PodTemplatePatchMap and PodTemplatePatchMapOutput values. 146 // You can construct a concrete instance of `PodTemplatePatchMapInput` via: 147 // 148 // PodTemplatePatchMap{ "key": PodTemplatePatchArgs{...} } 149 type PodTemplatePatchMapInput interface { 150 pulumi.Input 151 152 ToPodTemplatePatchMapOutput() PodTemplatePatchMapOutput 153 ToPodTemplatePatchMapOutputWithContext(context.Context) PodTemplatePatchMapOutput 154 } 155 156 type PodTemplatePatchMap map[string]PodTemplatePatchInput 157 158 func (PodTemplatePatchMap) ElementType() reflect.Type { 159 return reflect.TypeOf((*map[string]*PodTemplatePatch)(nil)).Elem() 160 } 161 162 func (i PodTemplatePatchMap) ToPodTemplatePatchMapOutput() PodTemplatePatchMapOutput { 163 return i.ToPodTemplatePatchMapOutputWithContext(context.Background()) 164 } 165 166 func (i PodTemplatePatchMap) ToPodTemplatePatchMapOutputWithContext(ctx context.Context) PodTemplatePatchMapOutput { 167 return pulumi.ToOutputWithContext(ctx, i).(PodTemplatePatchMapOutput) 168 } 169 170 type PodTemplatePatchOutput struct{ *pulumi.OutputState } 171 172 func (PodTemplatePatchOutput) ElementType() reflect.Type { 173 return reflect.TypeOf((**PodTemplatePatch)(nil)).Elem() 174 } 175 176 func (o PodTemplatePatchOutput) ToPodTemplatePatchOutput() PodTemplatePatchOutput { 177 return o 178 } 179 180 func (o PodTemplatePatchOutput) ToPodTemplatePatchOutputWithContext(ctx context.Context) PodTemplatePatchOutput { 181 return o 182 } 183 184 // 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 185 func (o PodTemplatePatchOutput) ApiVersion() pulumi.StringPtrOutput { 186 return o.ApplyT(func(v *PodTemplatePatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 187 } 188 189 // 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 190 func (o PodTemplatePatchOutput) Kind() pulumi.StringPtrOutput { 191 return o.ApplyT(func(v *PodTemplatePatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 192 } 193 194 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 195 func (o PodTemplatePatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput { 196 return o.ApplyT(func(v *PodTemplatePatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput) 197 } 198 199 // Template defines the pods that will be created from this pod template. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 200 func (o PodTemplatePatchOutput) Template() PodTemplateSpecPatchPtrOutput { 201 return o.ApplyT(func(v *PodTemplatePatch) PodTemplateSpecPatchPtrOutput { return v.Template }).(PodTemplateSpecPatchPtrOutput) 202 } 203 204 type PodTemplatePatchArrayOutput struct{ *pulumi.OutputState } 205 206 func (PodTemplatePatchArrayOutput) ElementType() reflect.Type { 207 return reflect.TypeOf((*[]*PodTemplatePatch)(nil)).Elem() 208 } 209 210 func (o PodTemplatePatchArrayOutput) ToPodTemplatePatchArrayOutput() PodTemplatePatchArrayOutput { 211 return o 212 } 213 214 func (o PodTemplatePatchArrayOutput) ToPodTemplatePatchArrayOutputWithContext(ctx context.Context) PodTemplatePatchArrayOutput { 215 return o 216 } 217 218 func (o PodTemplatePatchArrayOutput) Index(i pulumi.IntInput) PodTemplatePatchOutput { 219 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PodTemplatePatch { 220 return vs[0].([]*PodTemplatePatch)[vs[1].(int)] 221 }).(PodTemplatePatchOutput) 222 } 223 224 type PodTemplatePatchMapOutput struct{ *pulumi.OutputState } 225 226 func (PodTemplatePatchMapOutput) ElementType() reflect.Type { 227 return reflect.TypeOf((*map[string]*PodTemplatePatch)(nil)).Elem() 228 } 229 230 func (o PodTemplatePatchMapOutput) ToPodTemplatePatchMapOutput() PodTemplatePatchMapOutput { 231 return o 232 } 233 234 func (o PodTemplatePatchMapOutput) ToPodTemplatePatchMapOutputWithContext(ctx context.Context) PodTemplatePatchMapOutput { 235 return o 236 } 237 238 func (o PodTemplatePatchMapOutput) MapIndex(k pulumi.StringInput) PodTemplatePatchOutput { 239 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PodTemplatePatch { 240 return vs[0].(map[string]*PodTemplatePatch)[vs[1].(string)] 241 }).(PodTemplatePatchOutput) 242 } 243 244 func init() { 245 pulumi.RegisterInputType(reflect.TypeOf((*PodTemplatePatchInput)(nil)).Elem(), &PodTemplatePatch{}) 246 pulumi.RegisterInputType(reflect.TypeOf((*PodTemplatePatchArrayInput)(nil)).Elem(), PodTemplatePatchArray{}) 247 pulumi.RegisterInputType(reflect.TypeOf((*PodTemplatePatchMapInput)(nil)).Elem(), PodTemplatePatchMap{}) 248 pulumi.RegisterOutputType(PodTemplatePatchOutput{}) 249 pulumi.RegisterOutputType(PodTemplatePatchArrayOutput{}) 250 pulumi.RegisterOutputType(PodTemplatePatchMapOutput{}) 251 }