github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/apps/v1/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 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 // 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 // 24 // The StatefulSet guarantees that a given network identity will always map to the same storage identity. 25 // 26 // This resource waits until its status is ready before registering success 27 // for create/update, and populating output properties from the current state of the resource. 28 // The following conditions are used to determine whether the resource creation has 29 // succeeded or failed: 30 // 31 // 1. The value of 'spec.replicas' matches '.status.replicas', '.status.currentReplicas', 32 // and '.status.readyReplicas'. 33 // 2. The value of '.status.updateRevision' matches '.status.currentRevision'. 34 // 35 // If the StatefulSet has not reached a Ready state after 10 minutes, it will 36 // time out and mark the resource update as Failed. You can override the default timeout value 37 // by setting the 'customTimeouts' option on the resource. 38 type StatefulSetPatch struct { 39 pulumi.CustomResourceState 40 41 // 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 42 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 43 // 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 44 Kind pulumi.StringPtrOutput `pulumi:"kind"` 45 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 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/v1") 61 args.Kind = pulumi.StringPtr("StatefulSet") 62 aliases := pulumi.Aliases([]pulumi.Alias{ 63 { 64 Type: pulumi.String("kubernetes:apps/v1beta1:StatefulSetPatch"), 65 }, 66 { 67 Type: pulumi.String("kubernetes:apps/v1beta2:StatefulSetPatch"), 68 }, 69 }) 70 opts = append(opts, aliases) 71 var resource StatefulSetPatch 72 err := ctx.RegisterResource("kubernetes:apps/v1: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/v1: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 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 108 Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"` 109 // Spec defines the desired identities of pods in this set. 110 Spec *StatefulSetSpecPatch `pulumi:"spec"` 111 } 112 113 // The set of arguments for constructing a StatefulSetPatch resource. 114 type StatefulSetPatchArgs struct { 115 // 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 116 ApiVersion pulumi.StringPtrInput 117 // 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 118 Kind pulumi.StringPtrInput 119 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 120 Metadata metav1.ObjectMetaPatchPtrInput 121 // Spec defines the desired identities of pods in this set. 122 Spec StatefulSetSpecPatchPtrInput 123 } 124 125 func (StatefulSetPatchArgs) ElementType() reflect.Type { 126 return reflect.TypeOf((*statefulSetPatchArgs)(nil)).Elem() 127 } 128 129 type StatefulSetPatchInput interface { 130 pulumi.Input 131 132 ToStatefulSetPatchOutput() StatefulSetPatchOutput 133 ToStatefulSetPatchOutputWithContext(ctx context.Context) StatefulSetPatchOutput 134 } 135 136 func (*StatefulSetPatch) ElementType() reflect.Type { 137 return reflect.TypeOf((**StatefulSetPatch)(nil)).Elem() 138 } 139 140 func (i *StatefulSetPatch) ToStatefulSetPatchOutput() StatefulSetPatchOutput { 141 return i.ToStatefulSetPatchOutputWithContext(context.Background()) 142 } 143 144 func (i *StatefulSetPatch) ToStatefulSetPatchOutputWithContext(ctx context.Context) StatefulSetPatchOutput { 145 return pulumi.ToOutputWithContext(ctx, i).(StatefulSetPatchOutput) 146 } 147 148 // StatefulSetPatchArrayInput is an input type that accepts StatefulSetPatchArray and StatefulSetPatchArrayOutput values. 149 // You can construct a concrete instance of `StatefulSetPatchArrayInput` via: 150 // 151 // StatefulSetPatchArray{ StatefulSetPatchArgs{...} } 152 type StatefulSetPatchArrayInput interface { 153 pulumi.Input 154 155 ToStatefulSetPatchArrayOutput() StatefulSetPatchArrayOutput 156 ToStatefulSetPatchArrayOutputWithContext(context.Context) StatefulSetPatchArrayOutput 157 } 158 159 type StatefulSetPatchArray []StatefulSetPatchInput 160 161 func (StatefulSetPatchArray) ElementType() reflect.Type { 162 return reflect.TypeOf((*[]*StatefulSetPatch)(nil)).Elem() 163 } 164 165 func (i StatefulSetPatchArray) ToStatefulSetPatchArrayOutput() StatefulSetPatchArrayOutput { 166 return i.ToStatefulSetPatchArrayOutputWithContext(context.Background()) 167 } 168 169 func (i StatefulSetPatchArray) ToStatefulSetPatchArrayOutputWithContext(ctx context.Context) StatefulSetPatchArrayOutput { 170 return pulumi.ToOutputWithContext(ctx, i).(StatefulSetPatchArrayOutput) 171 } 172 173 // StatefulSetPatchMapInput is an input type that accepts StatefulSetPatchMap and StatefulSetPatchMapOutput values. 174 // You can construct a concrete instance of `StatefulSetPatchMapInput` via: 175 // 176 // StatefulSetPatchMap{ "key": StatefulSetPatchArgs{...} } 177 type StatefulSetPatchMapInput interface { 178 pulumi.Input 179 180 ToStatefulSetPatchMapOutput() StatefulSetPatchMapOutput 181 ToStatefulSetPatchMapOutputWithContext(context.Context) StatefulSetPatchMapOutput 182 } 183 184 type StatefulSetPatchMap map[string]StatefulSetPatchInput 185 186 func (StatefulSetPatchMap) ElementType() reflect.Type { 187 return reflect.TypeOf((*map[string]*StatefulSetPatch)(nil)).Elem() 188 } 189 190 func (i StatefulSetPatchMap) ToStatefulSetPatchMapOutput() StatefulSetPatchMapOutput { 191 return i.ToStatefulSetPatchMapOutputWithContext(context.Background()) 192 } 193 194 func (i StatefulSetPatchMap) ToStatefulSetPatchMapOutputWithContext(ctx context.Context) StatefulSetPatchMapOutput { 195 return pulumi.ToOutputWithContext(ctx, i).(StatefulSetPatchMapOutput) 196 } 197 198 type StatefulSetPatchOutput struct{ *pulumi.OutputState } 199 200 func (StatefulSetPatchOutput) ElementType() reflect.Type { 201 return reflect.TypeOf((**StatefulSetPatch)(nil)).Elem() 202 } 203 204 func (o StatefulSetPatchOutput) ToStatefulSetPatchOutput() StatefulSetPatchOutput { 205 return o 206 } 207 208 func (o StatefulSetPatchOutput) ToStatefulSetPatchOutputWithContext(ctx context.Context) StatefulSetPatchOutput { 209 return o 210 } 211 212 // 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 213 func (o StatefulSetPatchOutput) ApiVersion() pulumi.StringPtrOutput { 214 return o.ApplyT(func(v *StatefulSetPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 215 } 216 217 // 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 218 func (o StatefulSetPatchOutput) Kind() pulumi.StringPtrOutput { 219 return o.ApplyT(func(v *StatefulSetPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 220 } 221 222 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 223 func (o StatefulSetPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput { 224 return o.ApplyT(func(v *StatefulSetPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput) 225 } 226 227 // Spec defines the desired identities of pods in this set. 228 func (o StatefulSetPatchOutput) Spec() StatefulSetSpecPatchPtrOutput { 229 return o.ApplyT(func(v *StatefulSetPatch) StatefulSetSpecPatchPtrOutput { return v.Spec }).(StatefulSetSpecPatchPtrOutput) 230 } 231 232 // Status is the current status of Pods in this StatefulSet. This data may be out of date by some window of time. 233 func (o StatefulSetPatchOutput) Status() StatefulSetStatusPatchPtrOutput { 234 return o.ApplyT(func(v *StatefulSetPatch) StatefulSetStatusPatchPtrOutput { return v.Status }).(StatefulSetStatusPatchPtrOutput) 235 } 236 237 type StatefulSetPatchArrayOutput struct{ *pulumi.OutputState } 238 239 func (StatefulSetPatchArrayOutput) ElementType() reflect.Type { 240 return reflect.TypeOf((*[]*StatefulSetPatch)(nil)).Elem() 241 } 242 243 func (o StatefulSetPatchArrayOutput) ToStatefulSetPatchArrayOutput() StatefulSetPatchArrayOutput { 244 return o 245 } 246 247 func (o StatefulSetPatchArrayOutput) ToStatefulSetPatchArrayOutputWithContext(ctx context.Context) StatefulSetPatchArrayOutput { 248 return o 249 } 250 251 func (o StatefulSetPatchArrayOutput) Index(i pulumi.IntInput) StatefulSetPatchOutput { 252 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *StatefulSetPatch { 253 return vs[0].([]*StatefulSetPatch)[vs[1].(int)] 254 }).(StatefulSetPatchOutput) 255 } 256 257 type StatefulSetPatchMapOutput struct{ *pulumi.OutputState } 258 259 func (StatefulSetPatchMapOutput) ElementType() reflect.Type { 260 return reflect.TypeOf((*map[string]*StatefulSetPatch)(nil)).Elem() 261 } 262 263 func (o StatefulSetPatchMapOutput) ToStatefulSetPatchMapOutput() StatefulSetPatchMapOutput { 264 return o 265 } 266 267 func (o StatefulSetPatchMapOutput) ToStatefulSetPatchMapOutputWithContext(ctx context.Context) StatefulSetPatchMapOutput { 268 return o 269 } 270 271 func (o StatefulSetPatchMapOutput) MapIndex(k pulumi.StringInput) StatefulSetPatchOutput { 272 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *StatefulSetPatch { 273 return vs[0].(map[string]*StatefulSetPatch)[vs[1].(string)] 274 }).(StatefulSetPatchOutput) 275 } 276 277 func init() { 278 pulumi.RegisterInputType(reflect.TypeOf((*StatefulSetPatchInput)(nil)).Elem(), &StatefulSetPatch{}) 279 pulumi.RegisterInputType(reflect.TypeOf((*StatefulSetPatchArrayInput)(nil)).Elem(), StatefulSetPatchArray{}) 280 pulumi.RegisterInputType(reflect.TypeOf((*StatefulSetPatchMapInput)(nil)).Elem(), StatefulSetPatchMap{}) 281 pulumi.RegisterOutputType(StatefulSetPatchOutput{}) 282 pulumi.RegisterOutputType(StatefulSetPatchArrayOutput{}) 283 pulumi.RegisterOutputType(StatefulSetPatchMapOutput{}) 284 }