github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/apps/v1beta1/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 v1beta1 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 // 44 // Deprecated: apps/v1beta1/Deployment is deprecated by apps/v1/Deployment and not supported by Kubernetes v1.16+ clusters. 45 type DeploymentPatch struct { 46 pulumi.CustomResourceState 47 48 // 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 49 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 50 // 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 51 Kind pulumi.StringPtrOutput `pulumi:"kind"` 52 // Standard object metadata. 53 Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"` 54 // Specification of the desired behavior of the Deployment. 55 Spec DeploymentSpecPatchPtrOutput `pulumi:"spec"` 56 // Most recently observed status of the Deployment. 57 Status DeploymentStatusPatchPtrOutput `pulumi:"status"` 58 } 59 60 // NewDeploymentPatch registers a new resource with the given unique name, arguments, and options. 61 func NewDeploymentPatch(ctx *pulumi.Context, 62 name string, args *DeploymentPatchArgs, opts ...pulumi.ResourceOption) (*DeploymentPatch, error) { 63 if args == nil { 64 args = &DeploymentPatchArgs{} 65 } 66 67 args.ApiVersion = pulumi.StringPtr("apps/v1beta1") 68 args.Kind = pulumi.StringPtr("Deployment") 69 aliases := pulumi.Aliases([]pulumi.Alias{ 70 { 71 Type: pulumi.String("kubernetes:apps/v1:DeploymentPatch"), 72 }, 73 { 74 Type: pulumi.String("kubernetes:apps/v1beta2:DeploymentPatch"), 75 }, 76 { 77 Type: pulumi.String("kubernetes:extensions/v1beta1:DeploymentPatch"), 78 }, 79 }) 80 opts = append(opts, aliases) 81 var resource DeploymentPatch 82 err := ctx.RegisterResource("kubernetes:apps/v1beta1:DeploymentPatch", name, args, &resource, opts...) 83 if err != nil { 84 return nil, err 85 } 86 return &resource, nil 87 } 88 89 // GetDeploymentPatch gets an existing DeploymentPatch resource's state with the given name, ID, and optional 90 // state properties that are used to uniquely qualify the lookup (nil if not required). 91 func GetDeploymentPatch(ctx *pulumi.Context, 92 name string, id pulumi.IDInput, state *DeploymentPatchState, opts ...pulumi.ResourceOption) (*DeploymentPatch, error) { 93 var resource DeploymentPatch 94 err := ctx.ReadResource("kubernetes:apps/v1beta1:DeploymentPatch", name, id, state, &resource, opts...) 95 if err != nil { 96 return nil, err 97 } 98 return &resource, nil 99 } 100 101 // Input properties used for looking up and filtering DeploymentPatch resources. 102 type deploymentPatchState struct { 103 } 104 105 type DeploymentPatchState struct { 106 } 107 108 func (DeploymentPatchState) ElementType() reflect.Type { 109 return reflect.TypeOf((*deploymentPatchState)(nil)).Elem() 110 } 111 112 type deploymentPatchArgs struct { 113 // 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 114 ApiVersion *string `pulumi:"apiVersion"` 115 // 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 116 Kind *string `pulumi:"kind"` 117 // Standard object metadata. 118 Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"` 119 // Specification of the desired behavior of the Deployment. 120 Spec *DeploymentSpecPatch `pulumi:"spec"` 121 } 122 123 // The set of arguments for constructing a DeploymentPatch resource. 124 type DeploymentPatchArgs struct { 125 // 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 126 ApiVersion pulumi.StringPtrInput 127 // 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 128 Kind pulumi.StringPtrInput 129 // Standard object metadata. 130 Metadata metav1.ObjectMetaPatchPtrInput 131 // Specification of the desired behavior of the Deployment. 132 Spec DeploymentSpecPatchPtrInput 133 } 134 135 func (DeploymentPatchArgs) ElementType() reflect.Type { 136 return reflect.TypeOf((*deploymentPatchArgs)(nil)).Elem() 137 } 138 139 type DeploymentPatchInput interface { 140 pulumi.Input 141 142 ToDeploymentPatchOutput() DeploymentPatchOutput 143 ToDeploymentPatchOutputWithContext(ctx context.Context) DeploymentPatchOutput 144 } 145 146 func (*DeploymentPatch) ElementType() reflect.Type { 147 return reflect.TypeOf((**DeploymentPatch)(nil)).Elem() 148 } 149 150 func (i *DeploymentPatch) ToDeploymentPatchOutput() DeploymentPatchOutput { 151 return i.ToDeploymentPatchOutputWithContext(context.Background()) 152 } 153 154 func (i *DeploymentPatch) ToDeploymentPatchOutputWithContext(ctx context.Context) DeploymentPatchOutput { 155 return pulumi.ToOutputWithContext(ctx, i).(DeploymentPatchOutput) 156 } 157 158 // DeploymentPatchArrayInput is an input type that accepts DeploymentPatchArray and DeploymentPatchArrayOutput values. 159 // You can construct a concrete instance of `DeploymentPatchArrayInput` via: 160 // 161 // DeploymentPatchArray{ DeploymentPatchArgs{...} } 162 type DeploymentPatchArrayInput interface { 163 pulumi.Input 164 165 ToDeploymentPatchArrayOutput() DeploymentPatchArrayOutput 166 ToDeploymentPatchArrayOutputWithContext(context.Context) DeploymentPatchArrayOutput 167 } 168 169 type DeploymentPatchArray []DeploymentPatchInput 170 171 func (DeploymentPatchArray) ElementType() reflect.Type { 172 return reflect.TypeOf((*[]*DeploymentPatch)(nil)).Elem() 173 } 174 175 func (i DeploymentPatchArray) ToDeploymentPatchArrayOutput() DeploymentPatchArrayOutput { 176 return i.ToDeploymentPatchArrayOutputWithContext(context.Background()) 177 } 178 179 func (i DeploymentPatchArray) ToDeploymentPatchArrayOutputWithContext(ctx context.Context) DeploymentPatchArrayOutput { 180 return pulumi.ToOutputWithContext(ctx, i).(DeploymentPatchArrayOutput) 181 } 182 183 // DeploymentPatchMapInput is an input type that accepts DeploymentPatchMap and DeploymentPatchMapOutput values. 184 // You can construct a concrete instance of `DeploymentPatchMapInput` via: 185 // 186 // DeploymentPatchMap{ "key": DeploymentPatchArgs{...} } 187 type DeploymentPatchMapInput interface { 188 pulumi.Input 189 190 ToDeploymentPatchMapOutput() DeploymentPatchMapOutput 191 ToDeploymentPatchMapOutputWithContext(context.Context) DeploymentPatchMapOutput 192 } 193 194 type DeploymentPatchMap map[string]DeploymentPatchInput 195 196 func (DeploymentPatchMap) ElementType() reflect.Type { 197 return reflect.TypeOf((*map[string]*DeploymentPatch)(nil)).Elem() 198 } 199 200 func (i DeploymentPatchMap) ToDeploymentPatchMapOutput() DeploymentPatchMapOutput { 201 return i.ToDeploymentPatchMapOutputWithContext(context.Background()) 202 } 203 204 func (i DeploymentPatchMap) ToDeploymentPatchMapOutputWithContext(ctx context.Context) DeploymentPatchMapOutput { 205 return pulumi.ToOutputWithContext(ctx, i).(DeploymentPatchMapOutput) 206 } 207 208 type DeploymentPatchOutput struct{ *pulumi.OutputState } 209 210 func (DeploymentPatchOutput) ElementType() reflect.Type { 211 return reflect.TypeOf((**DeploymentPatch)(nil)).Elem() 212 } 213 214 func (o DeploymentPatchOutput) ToDeploymentPatchOutput() DeploymentPatchOutput { 215 return o 216 } 217 218 func (o DeploymentPatchOutput) ToDeploymentPatchOutputWithContext(ctx context.Context) DeploymentPatchOutput { 219 return o 220 } 221 222 // 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 223 func (o DeploymentPatchOutput) ApiVersion() pulumi.StringPtrOutput { 224 return o.ApplyT(func(v *DeploymentPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 225 } 226 227 // 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 228 func (o DeploymentPatchOutput) Kind() pulumi.StringPtrOutput { 229 return o.ApplyT(func(v *DeploymentPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 230 } 231 232 // Standard object metadata. 233 func (o DeploymentPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput { 234 return o.ApplyT(func(v *DeploymentPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput) 235 } 236 237 // Specification of the desired behavior of the Deployment. 238 func (o DeploymentPatchOutput) Spec() DeploymentSpecPatchPtrOutput { 239 return o.ApplyT(func(v *DeploymentPatch) DeploymentSpecPatchPtrOutput { return v.Spec }).(DeploymentSpecPatchPtrOutput) 240 } 241 242 // Most recently observed status of the Deployment. 243 func (o DeploymentPatchOutput) Status() DeploymentStatusPatchPtrOutput { 244 return o.ApplyT(func(v *DeploymentPatch) DeploymentStatusPatchPtrOutput { return v.Status }).(DeploymentStatusPatchPtrOutput) 245 } 246 247 type DeploymentPatchArrayOutput struct{ *pulumi.OutputState } 248 249 func (DeploymentPatchArrayOutput) ElementType() reflect.Type { 250 return reflect.TypeOf((*[]*DeploymentPatch)(nil)).Elem() 251 } 252 253 func (o DeploymentPatchArrayOutput) ToDeploymentPatchArrayOutput() DeploymentPatchArrayOutput { 254 return o 255 } 256 257 func (o DeploymentPatchArrayOutput) ToDeploymentPatchArrayOutputWithContext(ctx context.Context) DeploymentPatchArrayOutput { 258 return o 259 } 260 261 func (o DeploymentPatchArrayOutput) Index(i pulumi.IntInput) DeploymentPatchOutput { 262 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DeploymentPatch { 263 return vs[0].([]*DeploymentPatch)[vs[1].(int)] 264 }).(DeploymentPatchOutput) 265 } 266 267 type DeploymentPatchMapOutput struct{ *pulumi.OutputState } 268 269 func (DeploymentPatchMapOutput) ElementType() reflect.Type { 270 return reflect.TypeOf((*map[string]*DeploymentPatch)(nil)).Elem() 271 } 272 273 func (o DeploymentPatchMapOutput) ToDeploymentPatchMapOutput() DeploymentPatchMapOutput { 274 return o 275 } 276 277 func (o DeploymentPatchMapOutput) ToDeploymentPatchMapOutputWithContext(ctx context.Context) DeploymentPatchMapOutput { 278 return o 279 } 280 281 func (o DeploymentPatchMapOutput) MapIndex(k pulumi.StringInput) DeploymentPatchOutput { 282 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DeploymentPatch { 283 return vs[0].(map[string]*DeploymentPatch)[vs[1].(string)] 284 }).(DeploymentPatchOutput) 285 } 286 287 func init() { 288 pulumi.RegisterInputType(reflect.TypeOf((*DeploymentPatchInput)(nil)).Elem(), &DeploymentPatch{}) 289 pulumi.RegisterInputType(reflect.TypeOf((*DeploymentPatchArrayInput)(nil)).Elem(), DeploymentPatchArray{}) 290 pulumi.RegisterInputType(reflect.TypeOf((*DeploymentPatchMapInput)(nil)).Elem(), DeploymentPatchMap{}) 291 pulumi.RegisterOutputType(DeploymentPatchOutput{}) 292 pulumi.RegisterOutputType(DeploymentPatchArrayOutput{}) 293 pulumi.RegisterOutputType(DeploymentPatchMapOutput{}) 294 }