github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/apps/v1beta2/statefulSetPatch.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 v1beta2 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 // StatefulSet represents a set of pods with consistent identities. Identities are defined as: 21 // - Network: A single stable DNS and hostname. 22 // - Storage: As many VolumeClaims as requested. 23 // The StatefulSet guarantees that a given network identity will always map to the same storage identity. 24 // 25 // This resource waits until its status is ready before registering success 26 // for create/update, and populating output properties from the current state of the resource. 27 // The following conditions are used to determine whether the resource creation has 28 // succeeded or failed: 29 // 30 // 1. The value of 'spec.replicas' matches '.status.replicas', '.status.currentReplicas', 31 // and '.status.readyReplicas'. 32 // 2. The value of '.status.updateRevision' matches '.status.currentRevision'. 33 // 34 // If the StatefulSet has not reached a Ready state after 10 minutes, it will 35 // time out and mark the resource update as Failed. You can override the default timeout value 36 // by setting the 'customTimeouts' option on the resource. 37 // 38 // Deprecated: apps/v1beta2/StatefulSet is deprecated by apps/v1/StatefulSet and not supported by Kubernetes v1.16+ clusters. 39 type StatefulSetPatch struct { 40 pulumi.CustomResourceState 41 42 // 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 43 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 44 // 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 45 Kind pulumi.StringPtrOutput `pulumi:"kind"` 46 Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"` 47 // Spec defines the desired identities of pods in this set. 48 Spec StatefulSetSpecPatchPtrOutput `pulumi:"spec"` 49 // Status is the current status of Pods in this StatefulSet. This data may be out of date by some window of time. 50 Status StatefulSetStatusPatchPtrOutput `pulumi:"status"` 51 } 52 53 // NewStatefulSetPatch registers a new resource with the given unique name, arguments, and options. 54 func NewStatefulSetPatch(ctx *pulumi.Context, 55 name string, args *StatefulSetPatchArgs, opts ...pulumi.ResourceOption) (*StatefulSetPatch, error) { 56 if args == nil { 57 args = &StatefulSetPatchArgs{} 58 } 59 60 args.ApiVersion = pulumi.StringPtr("apps/v1beta2") 61 args.Kind = pulumi.StringPtr("StatefulSet") 62 aliases := pulumi.Aliases([]pulumi.Alias{ 63 { 64 Type: pulumi.String("kubernetes:apps/v1:StatefulSetPatch"), 65 }, 66 { 67 Type: pulumi.String("kubernetes:apps/v1beta1:StatefulSetPatch"), 68 }, 69 }) 70 opts = append(opts, aliases) 71 var resource StatefulSetPatch 72 err := ctx.RegisterResource("kubernetes:apps/v1beta2:StatefulSetPatch", name, args, &resource, opts...) 73 if err != nil { 74 return nil, err 75 } 76 return &resource, nil 77 } 78 79 // GetStatefulSetPatch gets an existing StatefulSetPatch resource's state with the given name, ID, and optional 80 // state properties that are used to uniquely qualify the lookup (nil if not required). 81 func GetStatefulSetPatch(ctx *pulumi.Context, 82 name string, id pulumi.IDInput, state *StatefulSetPatchState, opts ...pulumi.ResourceOption) (*StatefulSetPatch, error) { 83 var resource StatefulSetPatch 84 err := ctx.ReadResource("kubernetes:apps/v1beta2:StatefulSetPatch", name, id, state, &resource, opts...) 85 if err != nil { 86 return nil, err 87 } 88 return &resource, nil 89 } 90 91 // Input properties used for looking up and filtering StatefulSetPatch resources. 92 type statefulSetPatchState struct { 93 } 94 95 type StatefulSetPatchState struct { 96 } 97 98 func (StatefulSetPatchState) ElementType() reflect.Type { 99 return reflect.TypeOf((*statefulSetPatchState)(nil)).Elem() 100 } 101 102 type statefulSetPatchArgs struct { 103 // 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 104 ApiVersion *string `pulumi:"apiVersion"` 105 // 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 106 Kind *string `pulumi:"kind"` 107 Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"` 108 // Spec defines the desired identities of pods in this set. 109 Spec *StatefulSetSpecPatch `pulumi:"spec"` 110 } 111 112 // The set of arguments for constructing a StatefulSetPatch resource. 113 type StatefulSetPatchArgs struct { 114 // 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 115 ApiVersion pulumi.StringPtrInput 116 // 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 117 Kind pulumi.StringPtrInput 118 Metadata metav1.ObjectMetaPatchPtrInput 119 // Spec defines the desired identities of pods in this set. 120 Spec StatefulSetSpecPatchPtrInput 121 } 122 123 func (StatefulSetPatchArgs) ElementType() reflect.Type { 124 return reflect.TypeOf((*statefulSetPatchArgs)(nil)).Elem() 125 } 126 127 type StatefulSetPatchInput interface { 128 pulumi.Input 129 130 ToStatefulSetPatchOutput() StatefulSetPatchOutput 131 ToStatefulSetPatchOutputWithContext(ctx context.Context) StatefulSetPatchOutput 132 } 133 134 func (*StatefulSetPatch) ElementType() reflect.Type { 135 return reflect.TypeOf((**StatefulSetPatch)(nil)).Elem() 136 } 137 138 func (i *StatefulSetPatch) ToStatefulSetPatchOutput() StatefulSetPatchOutput { 139 return i.ToStatefulSetPatchOutputWithContext(context.Background()) 140 } 141 142 func (i *StatefulSetPatch) ToStatefulSetPatchOutputWithContext(ctx context.Context) StatefulSetPatchOutput { 143 return pulumi.ToOutputWithContext(ctx, i).(StatefulSetPatchOutput) 144 } 145 146 // StatefulSetPatchArrayInput is an input type that accepts StatefulSetPatchArray and StatefulSetPatchArrayOutput values. 147 // You can construct a concrete instance of `StatefulSetPatchArrayInput` via: 148 // 149 // StatefulSetPatchArray{ StatefulSetPatchArgs{...} } 150 type StatefulSetPatchArrayInput interface { 151 pulumi.Input 152 153 ToStatefulSetPatchArrayOutput() StatefulSetPatchArrayOutput 154 ToStatefulSetPatchArrayOutputWithContext(context.Context) StatefulSetPatchArrayOutput 155 } 156 157 type StatefulSetPatchArray []StatefulSetPatchInput 158 159 func (StatefulSetPatchArray) ElementType() reflect.Type { 160 return reflect.TypeOf((*[]*StatefulSetPatch)(nil)).Elem() 161 } 162 163 func (i StatefulSetPatchArray) ToStatefulSetPatchArrayOutput() StatefulSetPatchArrayOutput { 164 return i.ToStatefulSetPatchArrayOutputWithContext(context.Background()) 165 } 166 167 func (i StatefulSetPatchArray) ToStatefulSetPatchArrayOutputWithContext(ctx context.Context) StatefulSetPatchArrayOutput { 168 return pulumi.ToOutputWithContext(ctx, i).(StatefulSetPatchArrayOutput) 169 } 170 171 // StatefulSetPatchMapInput is an input type that accepts StatefulSetPatchMap and StatefulSetPatchMapOutput values. 172 // You can construct a concrete instance of `StatefulSetPatchMapInput` via: 173 // 174 // StatefulSetPatchMap{ "key": StatefulSetPatchArgs{...} } 175 type StatefulSetPatchMapInput interface { 176 pulumi.Input 177 178 ToStatefulSetPatchMapOutput() StatefulSetPatchMapOutput 179 ToStatefulSetPatchMapOutputWithContext(context.Context) StatefulSetPatchMapOutput 180 } 181 182 type StatefulSetPatchMap map[string]StatefulSetPatchInput 183 184 func (StatefulSetPatchMap) ElementType() reflect.Type { 185 return reflect.TypeOf((*map[string]*StatefulSetPatch)(nil)).Elem() 186 } 187 188 func (i StatefulSetPatchMap) ToStatefulSetPatchMapOutput() StatefulSetPatchMapOutput { 189 return i.ToStatefulSetPatchMapOutputWithContext(context.Background()) 190 } 191 192 func (i StatefulSetPatchMap) ToStatefulSetPatchMapOutputWithContext(ctx context.Context) StatefulSetPatchMapOutput { 193 return pulumi.ToOutputWithContext(ctx, i).(StatefulSetPatchMapOutput) 194 } 195 196 type StatefulSetPatchOutput struct{ *pulumi.OutputState } 197 198 func (StatefulSetPatchOutput) ElementType() reflect.Type { 199 return reflect.TypeOf((**StatefulSetPatch)(nil)).Elem() 200 } 201 202 func (o StatefulSetPatchOutput) ToStatefulSetPatchOutput() StatefulSetPatchOutput { 203 return o 204 } 205 206 func (o StatefulSetPatchOutput) ToStatefulSetPatchOutputWithContext(ctx context.Context) StatefulSetPatchOutput { 207 return o 208 } 209 210 // 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 211 func (o StatefulSetPatchOutput) ApiVersion() pulumi.StringPtrOutput { 212 return o.ApplyT(func(v *StatefulSetPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 213 } 214 215 // 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 216 func (o StatefulSetPatchOutput) Kind() pulumi.StringPtrOutput { 217 return o.ApplyT(func(v *StatefulSetPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 218 } 219 220 func (o StatefulSetPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput { 221 return o.ApplyT(func(v *StatefulSetPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput) 222 } 223 224 // Spec defines the desired identities of pods in this set. 225 func (o StatefulSetPatchOutput) Spec() StatefulSetSpecPatchPtrOutput { 226 return o.ApplyT(func(v *StatefulSetPatch) StatefulSetSpecPatchPtrOutput { return v.Spec }).(StatefulSetSpecPatchPtrOutput) 227 } 228 229 // Status is the current status of Pods in this StatefulSet. This data may be out of date by some window of time. 230 func (o StatefulSetPatchOutput) Status() StatefulSetStatusPatchPtrOutput { 231 return o.ApplyT(func(v *StatefulSetPatch) StatefulSetStatusPatchPtrOutput { return v.Status }).(StatefulSetStatusPatchPtrOutput) 232 } 233 234 type StatefulSetPatchArrayOutput struct{ *pulumi.OutputState } 235 236 func (StatefulSetPatchArrayOutput) ElementType() reflect.Type { 237 return reflect.TypeOf((*[]*StatefulSetPatch)(nil)).Elem() 238 } 239 240 func (o StatefulSetPatchArrayOutput) ToStatefulSetPatchArrayOutput() StatefulSetPatchArrayOutput { 241 return o 242 } 243 244 func (o StatefulSetPatchArrayOutput) ToStatefulSetPatchArrayOutputWithContext(ctx context.Context) StatefulSetPatchArrayOutput { 245 return o 246 } 247 248 func (o StatefulSetPatchArrayOutput) Index(i pulumi.IntInput) StatefulSetPatchOutput { 249 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *StatefulSetPatch { 250 return vs[0].([]*StatefulSetPatch)[vs[1].(int)] 251 }).(StatefulSetPatchOutput) 252 } 253 254 type StatefulSetPatchMapOutput struct{ *pulumi.OutputState } 255 256 func (StatefulSetPatchMapOutput) ElementType() reflect.Type { 257 return reflect.TypeOf((*map[string]*StatefulSetPatch)(nil)).Elem() 258 } 259 260 func (o StatefulSetPatchMapOutput) ToStatefulSetPatchMapOutput() StatefulSetPatchMapOutput { 261 return o 262 } 263 264 func (o StatefulSetPatchMapOutput) ToStatefulSetPatchMapOutputWithContext(ctx context.Context) StatefulSetPatchMapOutput { 265 return o 266 } 267 268 func (o StatefulSetPatchMapOutput) MapIndex(k pulumi.StringInput) StatefulSetPatchOutput { 269 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *StatefulSetPatch { 270 return vs[0].(map[string]*StatefulSetPatch)[vs[1].(string)] 271 }).(StatefulSetPatchOutput) 272 } 273 274 func init() { 275 pulumi.RegisterInputType(reflect.TypeOf((*StatefulSetPatchInput)(nil)).Elem(), &StatefulSetPatch{}) 276 pulumi.RegisterInputType(reflect.TypeOf((*StatefulSetPatchArrayInput)(nil)).Elem(), StatefulSetPatchArray{}) 277 pulumi.RegisterInputType(reflect.TypeOf((*StatefulSetPatchMapInput)(nil)).Elem(), StatefulSetPatchMap{}) 278 pulumi.RegisterOutputType(StatefulSetPatchOutput{}) 279 pulumi.RegisterOutputType(StatefulSetPatchArrayOutput{}) 280 pulumi.RegisterOutputType(StatefulSetPatchMapOutput{}) 281 }