github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/resource/v1alpha2/resourceClassPatch.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 v1alpha2
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	corev1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/core/v1"
    11  	metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Patch resources are used to modify existing Kubernetes resources by using
    16  // Server-Side Apply updates. The name of the resource must be specified, but all other properties are optional. More than
    17  // one patch may be applied to the same resource, and a random FieldManager name will be used for each Patch resource.
    18  // Conflicts will result in an error by default, but can be forced using the "pulumi.com/patchForce" annotation. See the
    19  // [Server-Side Apply Docs](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/managing-resources-with-server-side-apply/) for
    20  // additional information about using Server-Side Apply to manage Kubernetes resources with Pulumi.
    21  // ResourceClass is used by administrators to influence how resources are allocated.
    22  //
    23  // This is an alpha type and requires enabling the DynamicResourceAllocation feature gate.
    24  type ResourceClassPatch struct {
    25  	pulumi.CustomResourceState
    26  
    27  	// 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
    28  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    29  	// DriverName defines the name of the dynamic resource driver that is used for allocation of a ResourceClaim that uses this class.
    30  	//
    31  	// Resource drivers have a unique name in forward domain order (acme.example.com).
    32  	DriverName pulumi.StringPtrOutput `pulumi:"driverName"`
    33  	// 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
    34  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    35  	// Standard object metadata
    36  	Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"`
    37  	// ParametersRef references an arbitrary separate object that may hold parameters that will be used by the driver when allocating a resource that uses this class. A dynamic resource driver can distinguish between parameters stored here and and those stored in ResourceClaimSpec.
    38  	ParametersRef ResourceClassParametersReferencePatchPtrOutput `pulumi:"parametersRef"`
    39  	// Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a ResourceClaim that has not been allocated yet.
    40  	//
    41  	// Setting this field is optional. If null, all nodes are candidates.
    42  	SuitableNodes corev1.NodeSelectorPatchPtrOutput `pulumi:"suitableNodes"`
    43  }
    44  
    45  // NewResourceClassPatch registers a new resource with the given unique name, arguments, and options.
    46  func NewResourceClassPatch(ctx *pulumi.Context,
    47  	name string, args *ResourceClassPatchArgs, opts ...pulumi.ResourceOption) (*ResourceClassPatch, error) {
    48  	if args == nil {
    49  		args = &ResourceClassPatchArgs{}
    50  	}
    51  
    52  	args.ApiVersion = pulumi.StringPtr("resource.k8s.io/v1alpha2")
    53  	args.Kind = pulumi.StringPtr("ResourceClass")
    54  	aliases := pulumi.Aliases([]pulumi.Alias{
    55  		{
    56  			Type: pulumi.String("kubernetes:resource.k8s.io/v1alpha1:ResourceClassPatch"),
    57  		},
    58  	})
    59  	opts = append(opts, aliases)
    60  	var resource ResourceClassPatch
    61  	err := ctx.RegisterResource("kubernetes:resource.k8s.io/v1alpha2:ResourceClassPatch", name, args, &resource, opts...)
    62  	if err != nil {
    63  		return nil, err
    64  	}
    65  	return &resource, nil
    66  }
    67  
    68  // GetResourceClassPatch gets an existing ResourceClassPatch 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 GetResourceClassPatch(ctx *pulumi.Context,
    71  	name string, id pulumi.IDInput, state *ResourceClassPatchState, opts ...pulumi.ResourceOption) (*ResourceClassPatch, error) {
    72  	var resource ResourceClassPatch
    73  	err := ctx.ReadResource("kubernetes:resource.k8s.io/v1alpha2:ResourceClassPatch", 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 ResourceClassPatch resources.
    81  type resourceClassPatchState struct {
    82  }
    83  
    84  type ResourceClassPatchState struct {
    85  }
    86  
    87  func (ResourceClassPatchState) ElementType() reflect.Type {
    88  	return reflect.TypeOf((*resourceClassPatchState)(nil)).Elem()
    89  }
    90  
    91  type resourceClassPatchArgs 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  	// DriverName defines the name of the dynamic resource driver that is used for allocation of a ResourceClaim that uses this class.
    95  	//
    96  	// Resource drivers have a unique name in forward domain order (acme.example.com).
    97  	DriverName *string `pulumi:"driverName"`
    98  	// 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
    99  	Kind *string `pulumi:"kind"`
   100  	// Standard object metadata
   101  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
   102  	// ParametersRef references an arbitrary separate object that may hold parameters that will be used by the driver when allocating a resource that uses this class. A dynamic resource driver can distinguish between parameters stored here and and those stored in ResourceClaimSpec.
   103  	ParametersRef *ResourceClassParametersReferencePatch `pulumi:"parametersRef"`
   104  	// Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a ResourceClaim that has not been allocated yet.
   105  	//
   106  	// Setting this field is optional. If null, all nodes are candidates.
   107  	SuitableNodes *corev1.NodeSelectorPatch `pulumi:"suitableNodes"`
   108  }
   109  
   110  // The set of arguments for constructing a ResourceClassPatch resource.
   111  type ResourceClassPatchArgs struct {
   112  	// 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
   113  	ApiVersion pulumi.StringPtrInput
   114  	// DriverName defines the name of the dynamic resource driver that is used for allocation of a ResourceClaim that uses this class.
   115  	//
   116  	// Resource drivers have a unique name in forward domain order (acme.example.com).
   117  	DriverName pulumi.StringPtrInput
   118  	// 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
   119  	Kind pulumi.StringPtrInput
   120  	// Standard object metadata
   121  	Metadata metav1.ObjectMetaPatchPtrInput
   122  	// ParametersRef references an arbitrary separate object that may hold parameters that will be used by the driver when allocating a resource that uses this class. A dynamic resource driver can distinguish between parameters stored here and and those stored in ResourceClaimSpec.
   123  	ParametersRef ResourceClassParametersReferencePatchPtrInput
   124  	// Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a ResourceClaim that has not been allocated yet.
   125  	//
   126  	// Setting this field is optional. If null, all nodes are candidates.
   127  	SuitableNodes corev1.NodeSelectorPatchPtrInput
   128  }
   129  
   130  func (ResourceClassPatchArgs) ElementType() reflect.Type {
   131  	return reflect.TypeOf((*resourceClassPatchArgs)(nil)).Elem()
   132  }
   133  
   134  type ResourceClassPatchInput interface {
   135  	pulumi.Input
   136  
   137  	ToResourceClassPatchOutput() ResourceClassPatchOutput
   138  	ToResourceClassPatchOutputWithContext(ctx context.Context) ResourceClassPatchOutput
   139  }
   140  
   141  func (*ResourceClassPatch) ElementType() reflect.Type {
   142  	return reflect.TypeOf((**ResourceClassPatch)(nil)).Elem()
   143  }
   144  
   145  func (i *ResourceClassPatch) ToResourceClassPatchOutput() ResourceClassPatchOutput {
   146  	return i.ToResourceClassPatchOutputWithContext(context.Background())
   147  }
   148  
   149  func (i *ResourceClassPatch) ToResourceClassPatchOutputWithContext(ctx context.Context) ResourceClassPatchOutput {
   150  	return pulumi.ToOutputWithContext(ctx, i).(ResourceClassPatchOutput)
   151  }
   152  
   153  // ResourceClassPatchArrayInput is an input type that accepts ResourceClassPatchArray and ResourceClassPatchArrayOutput values.
   154  // You can construct a concrete instance of `ResourceClassPatchArrayInput` via:
   155  //
   156  //	ResourceClassPatchArray{ ResourceClassPatchArgs{...} }
   157  type ResourceClassPatchArrayInput interface {
   158  	pulumi.Input
   159  
   160  	ToResourceClassPatchArrayOutput() ResourceClassPatchArrayOutput
   161  	ToResourceClassPatchArrayOutputWithContext(context.Context) ResourceClassPatchArrayOutput
   162  }
   163  
   164  type ResourceClassPatchArray []ResourceClassPatchInput
   165  
   166  func (ResourceClassPatchArray) ElementType() reflect.Type {
   167  	return reflect.TypeOf((*[]*ResourceClassPatch)(nil)).Elem()
   168  }
   169  
   170  func (i ResourceClassPatchArray) ToResourceClassPatchArrayOutput() ResourceClassPatchArrayOutput {
   171  	return i.ToResourceClassPatchArrayOutputWithContext(context.Background())
   172  }
   173  
   174  func (i ResourceClassPatchArray) ToResourceClassPatchArrayOutputWithContext(ctx context.Context) ResourceClassPatchArrayOutput {
   175  	return pulumi.ToOutputWithContext(ctx, i).(ResourceClassPatchArrayOutput)
   176  }
   177  
   178  // ResourceClassPatchMapInput is an input type that accepts ResourceClassPatchMap and ResourceClassPatchMapOutput values.
   179  // You can construct a concrete instance of `ResourceClassPatchMapInput` via:
   180  //
   181  //	ResourceClassPatchMap{ "key": ResourceClassPatchArgs{...} }
   182  type ResourceClassPatchMapInput interface {
   183  	pulumi.Input
   184  
   185  	ToResourceClassPatchMapOutput() ResourceClassPatchMapOutput
   186  	ToResourceClassPatchMapOutputWithContext(context.Context) ResourceClassPatchMapOutput
   187  }
   188  
   189  type ResourceClassPatchMap map[string]ResourceClassPatchInput
   190  
   191  func (ResourceClassPatchMap) ElementType() reflect.Type {
   192  	return reflect.TypeOf((*map[string]*ResourceClassPatch)(nil)).Elem()
   193  }
   194  
   195  func (i ResourceClassPatchMap) ToResourceClassPatchMapOutput() ResourceClassPatchMapOutput {
   196  	return i.ToResourceClassPatchMapOutputWithContext(context.Background())
   197  }
   198  
   199  func (i ResourceClassPatchMap) ToResourceClassPatchMapOutputWithContext(ctx context.Context) ResourceClassPatchMapOutput {
   200  	return pulumi.ToOutputWithContext(ctx, i).(ResourceClassPatchMapOutput)
   201  }
   202  
   203  type ResourceClassPatchOutput struct{ *pulumi.OutputState }
   204  
   205  func (ResourceClassPatchOutput) ElementType() reflect.Type {
   206  	return reflect.TypeOf((**ResourceClassPatch)(nil)).Elem()
   207  }
   208  
   209  func (o ResourceClassPatchOutput) ToResourceClassPatchOutput() ResourceClassPatchOutput {
   210  	return o
   211  }
   212  
   213  func (o ResourceClassPatchOutput) ToResourceClassPatchOutputWithContext(ctx context.Context) ResourceClassPatchOutput {
   214  	return o
   215  }
   216  
   217  // 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
   218  func (o ResourceClassPatchOutput) ApiVersion() pulumi.StringPtrOutput {
   219  	return o.ApplyT(func(v *ResourceClassPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   220  }
   221  
   222  // DriverName defines the name of the dynamic resource driver that is used for allocation of a ResourceClaim that uses this class.
   223  //
   224  // Resource drivers have a unique name in forward domain order (acme.example.com).
   225  func (o ResourceClassPatchOutput) DriverName() pulumi.StringPtrOutput {
   226  	return o.ApplyT(func(v *ResourceClassPatch) pulumi.StringPtrOutput { return v.DriverName }).(pulumi.StringPtrOutput)
   227  }
   228  
   229  // 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
   230  func (o ResourceClassPatchOutput) Kind() pulumi.StringPtrOutput {
   231  	return o.ApplyT(func(v *ResourceClassPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   232  }
   233  
   234  // Standard object metadata
   235  func (o ResourceClassPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   236  	return o.ApplyT(func(v *ResourceClassPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   237  }
   238  
   239  // ParametersRef references an arbitrary separate object that may hold parameters that will be used by the driver when allocating a resource that uses this class. A dynamic resource driver can distinguish between parameters stored here and and those stored in ResourceClaimSpec.
   240  func (o ResourceClassPatchOutput) ParametersRef() ResourceClassParametersReferencePatchPtrOutput {
   241  	return o.ApplyT(func(v *ResourceClassPatch) ResourceClassParametersReferencePatchPtrOutput { return v.ParametersRef }).(ResourceClassParametersReferencePatchPtrOutput)
   242  }
   243  
   244  // Only nodes matching the selector will be considered by the scheduler when trying to find a Node that fits a Pod when that Pod uses a ResourceClaim that has not been allocated yet.
   245  //
   246  // Setting this field is optional. If null, all nodes are candidates.
   247  func (o ResourceClassPatchOutput) SuitableNodes() corev1.NodeSelectorPatchPtrOutput {
   248  	return o.ApplyT(func(v *ResourceClassPatch) corev1.NodeSelectorPatchPtrOutput { return v.SuitableNodes }).(corev1.NodeSelectorPatchPtrOutput)
   249  }
   250  
   251  type ResourceClassPatchArrayOutput struct{ *pulumi.OutputState }
   252  
   253  func (ResourceClassPatchArrayOutput) ElementType() reflect.Type {
   254  	return reflect.TypeOf((*[]*ResourceClassPatch)(nil)).Elem()
   255  }
   256  
   257  func (o ResourceClassPatchArrayOutput) ToResourceClassPatchArrayOutput() ResourceClassPatchArrayOutput {
   258  	return o
   259  }
   260  
   261  func (o ResourceClassPatchArrayOutput) ToResourceClassPatchArrayOutputWithContext(ctx context.Context) ResourceClassPatchArrayOutput {
   262  	return o
   263  }
   264  
   265  func (o ResourceClassPatchArrayOutput) Index(i pulumi.IntInput) ResourceClassPatchOutput {
   266  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ResourceClassPatch {
   267  		return vs[0].([]*ResourceClassPatch)[vs[1].(int)]
   268  	}).(ResourceClassPatchOutput)
   269  }
   270  
   271  type ResourceClassPatchMapOutput struct{ *pulumi.OutputState }
   272  
   273  func (ResourceClassPatchMapOutput) ElementType() reflect.Type {
   274  	return reflect.TypeOf((*map[string]*ResourceClassPatch)(nil)).Elem()
   275  }
   276  
   277  func (o ResourceClassPatchMapOutput) ToResourceClassPatchMapOutput() ResourceClassPatchMapOutput {
   278  	return o
   279  }
   280  
   281  func (o ResourceClassPatchMapOutput) ToResourceClassPatchMapOutputWithContext(ctx context.Context) ResourceClassPatchMapOutput {
   282  	return o
   283  }
   284  
   285  func (o ResourceClassPatchMapOutput) MapIndex(k pulumi.StringInput) ResourceClassPatchOutput {
   286  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ResourceClassPatch {
   287  		return vs[0].(map[string]*ResourceClassPatch)[vs[1].(string)]
   288  	}).(ResourceClassPatchOutput)
   289  }
   290  
   291  func init() {
   292  	pulumi.RegisterInputType(reflect.TypeOf((*ResourceClassPatchInput)(nil)).Elem(), &ResourceClassPatch{})
   293  	pulumi.RegisterInputType(reflect.TypeOf((*ResourceClassPatchArrayInput)(nil)).Elem(), ResourceClassPatchArray{})
   294  	pulumi.RegisterInputType(reflect.TypeOf((*ResourceClassPatchMapInput)(nil)).Elem(), ResourceClassPatchMap{})
   295  	pulumi.RegisterOutputType(ResourceClassPatchOutput{})
   296  	pulumi.RegisterOutputType(ResourceClassPatchArrayOutput{})
   297  	pulumi.RegisterOutputType(ResourceClassPatchMapOutput{})
   298  }