github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/core/v1/podPatch.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  // Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts.
    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 Pod is scheduled ("PodScheduled"" '.status.condition' is true).
    28  //  2. The Pod is initialized ("Initialized" '.status.condition' is true).
    29  //  3. The Pod is ready ("Ready" '.status.condition' is true) and the '.status.phase' is
    30  //     set to "Running".
    31  //     Or (for Jobs): The Pod succeeded ('.status.phase' set to "Succeeded").
    32  //
    33  // If the Pod has not reached a Ready state after 10 minutes, it will
    34  // time out and mark the resource update as Failed. You can override the default timeout value
    35  // by setting the 'customTimeouts' option on the resource.
    36  type PodPatch struct {
    37  	pulumi.CustomResourceState
    38  
    39  	// 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
    40  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    41  	// 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
    42  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    43  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    44  	Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"`
    45  	// Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    46  	Spec PodSpecPatchPtrOutput `pulumi:"spec"`
    47  	// Most recently observed status of the pod. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    48  	Status PodStatusPatchPtrOutput `pulumi:"status"`
    49  }
    50  
    51  // NewPodPatch registers a new resource with the given unique name, arguments, and options.
    52  func NewPodPatch(ctx *pulumi.Context,
    53  	name string, args *PodPatchArgs, opts ...pulumi.ResourceOption) (*PodPatch, error) {
    54  	if args == nil {
    55  		args = &PodPatchArgs{}
    56  	}
    57  
    58  	args.ApiVersion = pulumi.StringPtr("v1")
    59  	args.Kind = pulumi.StringPtr("Pod")
    60  	var resource PodPatch
    61  	err := ctx.RegisterResource("kubernetes:core/v1:PodPatch", name, args, &resource, opts...)
    62  	if err != nil {
    63  		return nil, err
    64  	}
    65  	return &resource, nil
    66  }
    67  
    68  // GetPodPatch gets an existing PodPatch resource's state with the given name, ID, and optional
    69  // state properties that are used to uniquely qualify the lookup (nil if not required).
    70  func GetPodPatch(ctx *pulumi.Context,
    71  	name string, id pulumi.IDInput, state *PodPatchState, opts ...pulumi.ResourceOption) (*PodPatch, error) {
    72  	var resource PodPatch
    73  	err := ctx.ReadResource("kubernetes:core/v1:PodPatch", name, id, state, &resource, opts...)
    74  	if err != nil {
    75  		return nil, err
    76  	}
    77  	return &resource, nil
    78  }
    79  
    80  // Input properties used for looking up and filtering PodPatch resources.
    81  type podPatchState struct {
    82  }
    83  
    84  type PodPatchState struct {
    85  }
    86  
    87  func (PodPatchState) ElementType() reflect.Type {
    88  	return reflect.TypeOf((*podPatchState)(nil)).Elem()
    89  }
    90  
    91  type podPatchArgs struct {
    92  	// 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
    93  	ApiVersion *string `pulumi:"apiVersion"`
    94  	// 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
    95  	Kind *string `pulumi:"kind"`
    96  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    97  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
    98  	// Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    99  	Spec *PodSpecPatch `pulumi:"spec"`
   100  }
   101  
   102  // The set of arguments for constructing a PodPatch resource.
   103  type PodPatchArgs struct {
   104  	// 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
   105  	ApiVersion pulumi.StringPtrInput
   106  	// 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
   107  	Kind pulumi.StringPtrInput
   108  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   109  	Metadata metav1.ObjectMetaPatchPtrInput
   110  	// Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   111  	Spec PodSpecPatchPtrInput
   112  }
   113  
   114  func (PodPatchArgs) ElementType() reflect.Type {
   115  	return reflect.TypeOf((*podPatchArgs)(nil)).Elem()
   116  }
   117  
   118  type PodPatchInput interface {
   119  	pulumi.Input
   120  
   121  	ToPodPatchOutput() PodPatchOutput
   122  	ToPodPatchOutputWithContext(ctx context.Context) PodPatchOutput
   123  }
   124  
   125  func (*PodPatch) ElementType() reflect.Type {
   126  	return reflect.TypeOf((**PodPatch)(nil)).Elem()
   127  }
   128  
   129  func (i *PodPatch) ToPodPatchOutput() PodPatchOutput {
   130  	return i.ToPodPatchOutputWithContext(context.Background())
   131  }
   132  
   133  func (i *PodPatch) ToPodPatchOutputWithContext(ctx context.Context) PodPatchOutput {
   134  	return pulumi.ToOutputWithContext(ctx, i).(PodPatchOutput)
   135  }
   136  
   137  // PodPatchArrayInput is an input type that accepts PodPatchArray and PodPatchArrayOutput values.
   138  // You can construct a concrete instance of `PodPatchArrayInput` via:
   139  //
   140  //	PodPatchArray{ PodPatchArgs{...} }
   141  type PodPatchArrayInput interface {
   142  	pulumi.Input
   143  
   144  	ToPodPatchArrayOutput() PodPatchArrayOutput
   145  	ToPodPatchArrayOutputWithContext(context.Context) PodPatchArrayOutput
   146  }
   147  
   148  type PodPatchArray []PodPatchInput
   149  
   150  func (PodPatchArray) ElementType() reflect.Type {
   151  	return reflect.TypeOf((*[]*PodPatch)(nil)).Elem()
   152  }
   153  
   154  func (i PodPatchArray) ToPodPatchArrayOutput() PodPatchArrayOutput {
   155  	return i.ToPodPatchArrayOutputWithContext(context.Background())
   156  }
   157  
   158  func (i PodPatchArray) ToPodPatchArrayOutputWithContext(ctx context.Context) PodPatchArrayOutput {
   159  	return pulumi.ToOutputWithContext(ctx, i).(PodPatchArrayOutput)
   160  }
   161  
   162  // PodPatchMapInput is an input type that accepts PodPatchMap and PodPatchMapOutput values.
   163  // You can construct a concrete instance of `PodPatchMapInput` via:
   164  //
   165  //	PodPatchMap{ "key": PodPatchArgs{...} }
   166  type PodPatchMapInput interface {
   167  	pulumi.Input
   168  
   169  	ToPodPatchMapOutput() PodPatchMapOutput
   170  	ToPodPatchMapOutputWithContext(context.Context) PodPatchMapOutput
   171  }
   172  
   173  type PodPatchMap map[string]PodPatchInput
   174  
   175  func (PodPatchMap) ElementType() reflect.Type {
   176  	return reflect.TypeOf((*map[string]*PodPatch)(nil)).Elem()
   177  }
   178  
   179  func (i PodPatchMap) ToPodPatchMapOutput() PodPatchMapOutput {
   180  	return i.ToPodPatchMapOutputWithContext(context.Background())
   181  }
   182  
   183  func (i PodPatchMap) ToPodPatchMapOutputWithContext(ctx context.Context) PodPatchMapOutput {
   184  	return pulumi.ToOutputWithContext(ctx, i).(PodPatchMapOutput)
   185  }
   186  
   187  type PodPatchOutput struct{ *pulumi.OutputState }
   188  
   189  func (PodPatchOutput) ElementType() reflect.Type {
   190  	return reflect.TypeOf((**PodPatch)(nil)).Elem()
   191  }
   192  
   193  func (o PodPatchOutput) ToPodPatchOutput() PodPatchOutput {
   194  	return o
   195  }
   196  
   197  func (o PodPatchOutput) ToPodPatchOutputWithContext(ctx context.Context) PodPatchOutput {
   198  	return o
   199  }
   200  
   201  // 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
   202  func (o PodPatchOutput) ApiVersion() pulumi.StringPtrOutput {
   203  	return o.ApplyT(func(v *PodPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   204  }
   205  
   206  // 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
   207  func (o PodPatchOutput) Kind() pulumi.StringPtrOutput {
   208  	return o.ApplyT(func(v *PodPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   209  }
   210  
   211  // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   212  func (o PodPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   213  	return o.ApplyT(func(v *PodPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   214  }
   215  
   216  // Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   217  func (o PodPatchOutput) Spec() PodSpecPatchPtrOutput {
   218  	return o.ApplyT(func(v *PodPatch) PodSpecPatchPtrOutput { return v.Spec }).(PodSpecPatchPtrOutput)
   219  }
   220  
   221  // Most recently observed status of the pod. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   222  func (o PodPatchOutput) Status() PodStatusPatchPtrOutput {
   223  	return o.ApplyT(func(v *PodPatch) PodStatusPatchPtrOutput { return v.Status }).(PodStatusPatchPtrOutput)
   224  }
   225  
   226  type PodPatchArrayOutput struct{ *pulumi.OutputState }
   227  
   228  func (PodPatchArrayOutput) ElementType() reflect.Type {
   229  	return reflect.TypeOf((*[]*PodPatch)(nil)).Elem()
   230  }
   231  
   232  func (o PodPatchArrayOutput) ToPodPatchArrayOutput() PodPatchArrayOutput {
   233  	return o
   234  }
   235  
   236  func (o PodPatchArrayOutput) ToPodPatchArrayOutputWithContext(ctx context.Context) PodPatchArrayOutput {
   237  	return o
   238  }
   239  
   240  func (o PodPatchArrayOutput) Index(i pulumi.IntInput) PodPatchOutput {
   241  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PodPatch {
   242  		return vs[0].([]*PodPatch)[vs[1].(int)]
   243  	}).(PodPatchOutput)
   244  }
   245  
   246  type PodPatchMapOutput struct{ *pulumi.OutputState }
   247  
   248  func (PodPatchMapOutput) ElementType() reflect.Type {
   249  	return reflect.TypeOf((*map[string]*PodPatch)(nil)).Elem()
   250  }
   251  
   252  func (o PodPatchMapOutput) ToPodPatchMapOutput() PodPatchMapOutput {
   253  	return o
   254  }
   255  
   256  func (o PodPatchMapOutput) ToPodPatchMapOutputWithContext(ctx context.Context) PodPatchMapOutput {
   257  	return o
   258  }
   259  
   260  func (o PodPatchMapOutput) MapIndex(k pulumi.StringInput) PodPatchOutput {
   261  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PodPatch {
   262  		return vs[0].(map[string]*PodPatch)[vs[1].(string)]
   263  	}).(PodPatchOutput)
   264  }
   265  
   266  func init() {
   267  	pulumi.RegisterInputType(reflect.TypeOf((*PodPatchInput)(nil)).Elem(), &PodPatch{})
   268  	pulumi.RegisterInputType(reflect.TypeOf((*PodPatchArrayInput)(nil)).Elem(), PodPatchArray{})
   269  	pulumi.RegisterInputType(reflect.TypeOf((*PodPatchMapInput)(nil)).Elem(), PodPatchMap{})
   270  	pulumi.RegisterOutputType(PodPatchOutput{})
   271  	pulumi.RegisterOutputType(PodPatchArrayOutput{})
   272  	pulumi.RegisterOutputType(PodPatchMapOutput{})
   273  }