github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/apps/v1/deploymentPatch.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 // Deployment enables declarative updates for Pods and ReplicaSets. 21 // 22 // This resource waits until its status is ready before registering success 23 // for create/update, and populating output properties from the current state of the resource. 24 // The following conditions are used to determine whether the resource creation has 25 // succeeded or failed: 26 // 27 // 1. The Deployment has begun to be updated by the Deployment controller. If the current 28 // generation of the Deployment is > 1, then this means that the current generation must 29 // be different from the generation reported by the last outputs. 30 // 2. There exists a ReplicaSet whose revision is equal to the current revision of the 31 // Deployment. 32 // 3. The Deployment's '.status.conditions' has a status of type 'Available' whose 'status' 33 // member is set to 'True'. 34 // 4. If the Deployment has generation > 1, then '.status.conditions' has a status of type 35 // 'Progressing', whose 'status' member is set to 'True', and whose 'reason' is 36 // 'NewReplicaSetAvailable'. For generation <= 1, this status field does not exist, 37 // because it doesn't do a rollout (i.e., it simply creates the Deployment and 38 // corresponding ReplicaSet), and therefore there is no rollout to mark as 'Progressing'. 39 // 40 // If the Deployment has not reached a Ready state after 10 minutes, it will 41 // time out and mark the resource update as Failed. You can override the default timeout value 42 // by setting the 'customTimeouts' option on the resource. 43 type DeploymentPatch struct { 44 pulumi.CustomResourceState 45 46 // 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 47 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 48 // 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 49 Kind pulumi.StringPtrOutput `pulumi:"kind"` 50 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 51 Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"` 52 // Specification of the desired behavior of the Deployment. 53 Spec DeploymentSpecPatchPtrOutput `pulumi:"spec"` 54 // Most recently observed status of the Deployment. 55 Status DeploymentStatusPatchPtrOutput `pulumi:"status"` 56 } 57 58 // NewDeploymentPatch registers a new resource with the given unique name, arguments, and options. 59 func NewDeploymentPatch(ctx *pulumi.Context, 60 name string, args *DeploymentPatchArgs, opts ...pulumi.ResourceOption) (*DeploymentPatch, error) { 61 if args == nil { 62 args = &DeploymentPatchArgs{} 63 } 64 65 args.ApiVersion = pulumi.StringPtr("apps/v1") 66 args.Kind = pulumi.StringPtr("Deployment") 67 aliases := pulumi.Aliases([]pulumi.Alias{ 68 { 69 Type: pulumi.String("kubernetes:apps/v1beta1:DeploymentPatch"), 70 }, 71 { 72 Type: pulumi.String("kubernetes:apps/v1beta2:DeploymentPatch"), 73 }, 74 { 75 Type: pulumi.String("kubernetes:extensions/v1beta1:DeploymentPatch"), 76 }, 77 }) 78 opts = append(opts, aliases) 79 var resource DeploymentPatch 80 err := ctx.RegisterResource("kubernetes:apps/v1:DeploymentPatch", name, args, &resource, opts...) 81 if err != nil { 82 return nil, err 83 } 84 return &resource, nil 85 } 86 87 // GetDeploymentPatch gets an existing DeploymentPatch resource's state with the given name, ID, and optional 88 // state properties that are used to uniquely qualify the lookup (nil if not required). 89 func GetDeploymentPatch(ctx *pulumi.Context, 90 name string, id pulumi.IDInput, state *DeploymentPatchState, opts ...pulumi.ResourceOption) (*DeploymentPatch, error) { 91 var resource DeploymentPatch 92 err := ctx.ReadResource("kubernetes:apps/v1:DeploymentPatch", name, id, state, &resource, opts...) 93 if err != nil { 94 return nil, err 95 } 96 return &resource, nil 97 } 98 99 // Input properties used for looking up and filtering DeploymentPatch resources. 100 type deploymentPatchState struct { 101 } 102 103 type DeploymentPatchState struct { 104 } 105 106 func (DeploymentPatchState) ElementType() reflect.Type { 107 return reflect.TypeOf((*deploymentPatchState)(nil)).Elem() 108 } 109 110 type deploymentPatchArgs struct { 111 // 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 112 ApiVersion *string `pulumi:"apiVersion"` 113 // 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 114 Kind *string `pulumi:"kind"` 115 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 116 Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"` 117 // Specification of the desired behavior of the Deployment. 118 Spec *DeploymentSpecPatch `pulumi:"spec"` 119 } 120 121 // The set of arguments for constructing a DeploymentPatch resource. 122 type DeploymentPatchArgs struct { 123 // 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 124 ApiVersion pulumi.StringPtrInput 125 // 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 126 Kind pulumi.StringPtrInput 127 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 128 Metadata metav1.ObjectMetaPatchPtrInput 129 // Specification of the desired behavior of the Deployment. 130 Spec DeploymentSpecPatchPtrInput 131 } 132 133 func (DeploymentPatchArgs) ElementType() reflect.Type { 134 return reflect.TypeOf((*deploymentPatchArgs)(nil)).Elem() 135 } 136 137 type DeploymentPatchInput interface { 138 pulumi.Input 139 140 ToDeploymentPatchOutput() DeploymentPatchOutput 141 ToDeploymentPatchOutputWithContext(ctx context.Context) DeploymentPatchOutput 142 } 143 144 func (*DeploymentPatch) ElementType() reflect.Type { 145 return reflect.TypeOf((**DeploymentPatch)(nil)).Elem() 146 } 147 148 func (i *DeploymentPatch) ToDeploymentPatchOutput() DeploymentPatchOutput { 149 return i.ToDeploymentPatchOutputWithContext(context.Background()) 150 } 151 152 func (i *DeploymentPatch) ToDeploymentPatchOutputWithContext(ctx context.Context) DeploymentPatchOutput { 153 return pulumi.ToOutputWithContext(ctx, i).(DeploymentPatchOutput) 154 } 155 156 // DeploymentPatchArrayInput is an input type that accepts DeploymentPatchArray and DeploymentPatchArrayOutput values. 157 // You can construct a concrete instance of `DeploymentPatchArrayInput` via: 158 // 159 // DeploymentPatchArray{ DeploymentPatchArgs{...} } 160 type DeploymentPatchArrayInput interface { 161 pulumi.Input 162 163 ToDeploymentPatchArrayOutput() DeploymentPatchArrayOutput 164 ToDeploymentPatchArrayOutputWithContext(context.Context) DeploymentPatchArrayOutput 165 } 166 167 type DeploymentPatchArray []DeploymentPatchInput 168 169 func (DeploymentPatchArray) ElementType() reflect.Type { 170 return reflect.TypeOf((*[]*DeploymentPatch)(nil)).Elem() 171 } 172 173 func (i DeploymentPatchArray) ToDeploymentPatchArrayOutput() DeploymentPatchArrayOutput { 174 return i.ToDeploymentPatchArrayOutputWithContext(context.Background()) 175 } 176 177 func (i DeploymentPatchArray) ToDeploymentPatchArrayOutputWithContext(ctx context.Context) DeploymentPatchArrayOutput { 178 return pulumi.ToOutputWithContext(ctx, i).(DeploymentPatchArrayOutput) 179 } 180 181 // DeploymentPatchMapInput is an input type that accepts DeploymentPatchMap and DeploymentPatchMapOutput values. 182 // You can construct a concrete instance of `DeploymentPatchMapInput` via: 183 // 184 // DeploymentPatchMap{ "key": DeploymentPatchArgs{...} } 185 type DeploymentPatchMapInput interface { 186 pulumi.Input 187 188 ToDeploymentPatchMapOutput() DeploymentPatchMapOutput 189 ToDeploymentPatchMapOutputWithContext(context.Context) DeploymentPatchMapOutput 190 } 191 192 type DeploymentPatchMap map[string]DeploymentPatchInput 193 194 func (DeploymentPatchMap) ElementType() reflect.Type { 195 return reflect.TypeOf((*map[string]*DeploymentPatch)(nil)).Elem() 196 } 197 198 func (i DeploymentPatchMap) ToDeploymentPatchMapOutput() DeploymentPatchMapOutput { 199 return i.ToDeploymentPatchMapOutputWithContext(context.Background()) 200 } 201 202 func (i DeploymentPatchMap) ToDeploymentPatchMapOutputWithContext(ctx context.Context) DeploymentPatchMapOutput { 203 return pulumi.ToOutputWithContext(ctx, i).(DeploymentPatchMapOutput) 204 } 205 206 type DeploymentPatchOutput struct{ *pulumi.OutputState } 207 208 func (DeploymentPatchOutput) ElementType() reflect.Type { 209 return reflect.TypeOf((**DeploymentPatch)(nil)).Elem() 210 } 211 212 func (o DeploymentPatchOutput) ToDeploymentPatchOutput() DeploymentPatchOutput { 213 return o 214 } 215 216 func (o DeploymentPatchOutput) ToDeploymentPatchOutputWithContext(ctx context.Context) DeploymentPatchOutput { 217 return o 218 } 219 220 // 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 221 func (o DeploymentPatchOutput) ApiVersion() pulumi.StringPtrOutput { 222 return o.ApplyT(func(v *DeploymentPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 223 } 224 225 // 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 226 func (o DeploymentPatchOutput) Kind() pulumi.StringPtrOutput { 227 return o.ApplyT(func(v *DeploymentPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 228 } 229 230 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 231 func (o DeploymentPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput { 232 return o.ApplyT(func(v *DeploymentPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput) 233 } 234 235 // Specification of the desired behavior of the Deployment. 236 func (o DeploymentPatchOutput) Spec() DeploymentSpecPatchPtrOutput { 237 return o.ApplyT(func(v *DeploymentPatch) DeploymentSpecPatchPtrOutput { return v.Spec }).(DeploymentSpecPatchPtrOutput) 238 } 239 240 // Most recently observed status of the Deployment. 241 func (o DeploymentPatchOutput) Status() DeploymentStatusPatchPtrOutput { 242 return o.ApplyT(func(v *DeploymentPatch) DeploymentStatusPatchPtrOutput { return v.Status }).(DeploymentStatusPatchPtrOutput) 243 } 244 245 type DeploymentPatchArrayOutput struct{ *pulumi.OutputState } 246 247 func (DeploymentPatchArrayOutput) ElementType() reflect.Type { 248 return reflect.TypeOf((*[]*DeploymentPatch)(nil)).Elem() 249 } 250 251 func (o DeploymentPatchArrayOutput) ToDeploymentPatchArrayOutput() DeploymentPatchArrayOutput { 252 return o 253 } 254 255 func (o DeploymentPatchArrayOutput) ToDeploymentPatchArrayOutputWithContext(ctx context.Context) DeploymentPatchArrayOutput { 256 return o 257 } 258 259 func (o DeploymentPatchArrayOutput) Index(i pulumi.IntInput) DeploymentPatchOutput { 260 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DeploymentPatch { 261 return vs[0].([]*DeploymentPatch)[vs[1].(int)] 262 }).(DeploymentPatchOutput) 263 } 264 265 type DeploymentPatchMapOutput struct{ *pulumi.OutputState } 266 267 func (DeploymentPatchMapOutput) ElementType() reflect.Type { 268 return reflect.TypeOf((*map[string]*DeploymentPatch)(nil)).Elem() 269 } 270 271 func (o DeploymentPatchMapOutput) ToDeploymentPatchMapOutput() DeploymentPatchMapOutput { 272 return o 273 } 274 275 func (o DeploymentPatchMapOutput) ToDeploymentPatchMapOutputWithContext(ctx context.Context) DeploymentPatchMapOutput { 276 return o 277 } 278 279 func (o DeploymentPatchMapOutput) MapIndex(k pulumi.StringInput) DeploymentPatchOutput { 280 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DeploymentPatch { 281 return vs[0].(map[string]*DeploymentPatch)[vs[1].(string)] 282 }).(DeploymentPatchOutput) 283 } 284 285 func init() { 286 pulumi.RegisterInputType(reflect.TypeOf((*DeploymentPatchInput)(nil)).Elem(), &DeploymentPatch{}) 287 pulumi.RegisterInputType(reflect.TypeOf((*DeploymentPatchArrayInput)(nil)).Elem(), DeploymentPatchArray{}) 288 pulumi.RegisterInputType(reflect.TypeOf((*DeploymentPatchMapInput)(nil)).Elem(), DeploymentPatchMap{}) 289 pulumi.RegisterOutputType(DeploymentPatchOutput{}) 290 pulumi.RegisterOutputType(DeploymentPatchArrayOutput{}) 291 pulumi.RegisterOutputType(DeploymentPatchMapOutput{}) 292 }