github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/networking/v1alpha1/clusterCIDRPatch.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 v1alpha1
     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  // ClusterCIDR represents a single configuration for per-Node Pod CIDR allocations when the MultiCIDRRangeAllocator is enabled (see the config for kube-controller-manager).  A cluster may have any number of ClusterCIDR resources, all of which will be considered when allocating a CIDR for a Node.  A ClusterCIDR is eligible to be used for a given Node when the node selector matches the node in question and has free CIDRs to allocate.  In case of multiple matching ClusterCIDR resources, the allocator will attempt to break ties using internal heuristics, but any ClusterCIDR whose node selector matches the Node may be used.
    21  type ClusterCIDRPatch struct {
    22  	pulumi.CustomResourceState
    23  
    24  	// 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
    25  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    26  	// 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
    27  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    28  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    29  	Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"`
    30  	// spec is the desired state of the ClusterCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    31  	Spec ClusterCIDRSpecPatchPtrOutput `pulumi:"spec"`
    32  }
    33  
    34  // NewClusterCIDRPatch registers a new resource with the given unique name, arguments, and options.
    35  func NewClusterCIDRPatch(ctx *pulumi.Context,
    36  	name string, args *ClusterCIDRPatchArgs, opts ...pulumi.ResourceOption) (*ClusterCIDRPatch, error) {
    37  	if args == nil {
    38  		args = &ClusterCIDRPatchArgs{}
    39  	}
    40  
    41  	args.ApiVersion = pulumi.StringPtr("networking.k8s.io/v1alpha1")
    42  	args.Kind = pulumi.StringPtr("ClusterCIDR")
    43  	var resource ClusterCIDRPatch
    44  	err := ctx.RegisterResource("kubernetes:networking.k8s.io/v1alpha1:ClusterCIDRPatch", name, args, &resource, opts...)
    45  	if err != nil {
    46  		return nil, err
    47  	}
    48  	return &resource, nil
    49  }
    50  
    51  // GetClusterCIDRPatch gets an existing ClusterCIDRPatch resource's state with the given name, ID, and optional
    52  // state properties that are used to uniquely qualify the lookup (nil if not required).
    53  func GetClusterCIDRPatch(ctx *pulumi.Context,
    54  	name string, id pulumi.IDInput, state *ClusterCIDRPatchState, opts ...pulumi.ResourceOption) (*ClusterCIDRPatch, error) {
    55  	var resource ClusterCIDRPatch
    56  	err := ctx.ReadResource("kubernetes:networking.k8s.io/v1alpha1:ClusterCIDRPatch", name, id, state, &resource, opts...)
    57  	if err != nil {
    58  		return nil, err
    59  	}
    60  	return &resource, nil
    61  }
    62  
    63  // Input properties used for looking up and filtering ClusterCIDRPatch resources.
    64  type clusterCIDRPatchState struct {
    65  }
    66  
    67  type ClusterCIDRPatchState struct {
    68  }
    69  
    70  func (ClusterCIDRPatchState) ElementType() reflect.Type {
    71  	return reflect.TypeOf((*clusterCIDRPatchState)(nil)).Elem()
    72  }
    73  
    74  type clusterCIDRPatchArgs struct {
    75  	// 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
    76  	ApiVersion *string `pulumi:"apiVersion"`
    77  	// 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
    78  	Kind *string `pulumi:"kind"`
    79  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    80  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
    81  	// spec is the desired state of the ClusterCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    82  	Spec *ClusterCIDRSpecPatch `pulumi:"spec"`
    83  }
    84  
    85  // The set of arguments for constructing a ClusterCIDRPatch resource.
    86  type ClusterCIDRPatchArgs struct {
    87  	// 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
    88  	ApiVersion pulumi.StringPtrInput
    89  	// 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
    90  	Kind pulumi.StringPtrInput
    91  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    92  	Metadata metav1.ObjectMetaPatchPtrInput
    93  	// spec is the desired state of the ClusterCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    94  	Spec ClusterCIDRSpecPatchPtrInput
    95  }
    96  
    97  func (ClusterCIDRPatchArgs) ElementType() reflect.Type {
    98  	return reflect.TypeOf((*clusterCIDRPatchArgs)(nil)).Elem()
    99  }
   100  
   101  type ClusterCIDRPatchInput interface {
   102  	pulumi.Input
   103  
   104  	ToClusterCIDRPatchOutput() ClusterCIDRPatchOutput
   105  	ToClusterCIDRPatchOutputWithContext(ctx context.Context) ClusterCIDRPatchOutput
   106  }
   107  
   108  func (*ClusterCIDRPatch) ElementType() reflect.Type {
   109  	return reflect.TypeOf((**ClusterCIDRPatch)(nil)).Elem()
   110  }
   111  
   112  func (i *ClusterCIDRPatch) ToClusterCIDRPatchOutput() ClusterCIDRPatchOutput {
   113  	return i.ToClusterCIDRPatchOutputWithContext(context.Background())
   114  }
   115  
   116  func (i *ClusterCIDRPatch) ToClusterCIDRPatchOutputWithContext(ctx context.Context) ClusterCIDRPatchOutput {
   117  	return pulumi.ToOutputWithContext(ctx, i).(ClusterCIDRPatchOutput)
   118  }
   119  
   120  // ClusterCIDRPatchArrayInput is an input type that accepts ClusterCIDRPatchArray and ClusterCIDRPatchArrayOutput values.
   121  // You can construct a concrete instance of `ClusterCIDRPatchArrayInput` via:
   122  //
   123  //	ClusterCIDRPatchArray{ ClusterCIDRPatchArgs{...} }
   124  type ClusterCIDRPatchArrayInput interface {
   125  	pulumi.Input
   126  
   127  	ToClusterCIDRPatchArrayOutput() ClusterCIDRPatchArrayOutput
   128  	ToClusterCIDRPatchArrayOutputWithContext(context.Context) ClusterCIDRPatchArrayOutput
   129  }
   130  
   131  type ClusterCIDRPatchArray []ClusterCIDRPatchInput
   132  
   133  func (ClusterCIDRPatchArray) ElementType() reflect.Type {
   134  	return reflect.TypeOf((*[]*ClusterCIDRPatch)(nil)).Elem()
   135  }
   136  
   137  func (i ClusterCIDRPatchArray) ToClusterCIDRPatchArrayOutput() ClusterCIDRPatchArrayOutput {
   138  	return i.ToClusterCIDRPatchArrayOutputWithContext(context.Background())
   139  }
   140  
   141  func (i ClusterCIDRPatchArray) ToClusterCIDRPatchArrayOutputWithContext(ctx context.Context) ClusterCIDRPatchArrayOutput {
   142  	return pulumi.ToOutputWithContext(ctx, i).(ClusterCIDRPatchArrayOutput)
   143  }
   144  
   145  // ClusterCIDRPatchMapInput is an input type that accepts ClusterCIDRPatchMap and ClusterCIDRPatchMapOutput values.
   146  // You can construct a concrete instance of `ClusterCIDRPatchMapInput` via:
   147  //
   148  //	ClusterCIDRPatchMap{ "key": ClusterCIDRPatchArgs{...} }
   149  type ClusterCIDRPatchMapInput interface {
   150  	pulumi.Input
   151  
   152  	ToClusterCIDRPatchMapOutput() ClusterCIDRPatchMapOutput
   153  	ToClusterCIDRPatchMapOutputWithContext(context.Context) ClusterCIDRPatchMapOutput
   154  }
   155  
   156  type ClusterCIDRPatchMap map[string]ClusterCIDRPatchInput
   157  
   158  func (ClusterCIDRPatchMap) ElementType() reflect.Type {
   159  	return reflect.TypeOf((*map[string]*ClusterCIDRPatch)(nil)).Elem()
   160  }
   161  
   162  func (i ClusterCIDRPatchMap) ToClusterCIDRPatchMapOutput() ClusterCIDRPatchMapOutput {
   163  	return i.ToClusterCIDRPatchMapOutputWithContext(context.Background())
   164  }
   165  
   166  func (i ClusterCIDRPatchMap) ToClusterCIDRPatchMapOutputWithContext(ctx context.Context) ClusterCIDRPatchMapOutput {
   167  	return pulumi.ToOutputWithContext(ctx, i).(ClusterCIDRPatchMapOutput)
   168  }
   169  
   170  type ClusterCIDRPatchOutput struct{ *pulumi.OutputState }
   171  
   172  func (ClusterCIDRPatchOutput) ElementType() reflect.Type {
   173  	return reflect.TypeOf((**ClusterCIDRPatch)(nil)).Elem()
   174  }
   175  
   176  func (o ClusterCIDRPatchOutput) ToClusterCIDRPatchOutput() ClusterCIDRPatchOutput {
   177  	return o
   178  }
   179  
   180  func (o ClusterCIDRPatchOutput) ToClusterCIDRPatchOutputWithContext(ctx context.Context) ClusterCIDRPatchOutput {
   181  	return o
   182  }
   183  
   184  // 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
   185  func (o ClusterCIDRPatchOutput) ApiVersion() pulumi.StringPtrOutput {
   186  	return o.ApplyT(func(v *ClusterCIDRPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   187  }
   188  
   189  // 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
   190  func (o ClusterCIDRPatchOutput) Kind() pulumi.StringPtrOutput {
   191  	return o.ApplyT(func(v *ClusterCIDRPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   192  }
   193  
   194  // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   195  func (o ClusterCIDRPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   196  	return o.ApplyT(func(v *ClusterCIDRPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   197  }
   198  
   199  // spec is the desired state of the ClusterCIDR. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   200  func (o ClusterCIDRPatchOutput) Spec() ClusterCIDRSpecPatchPtrOutput {
   201  	return o.ApplyT(func(v *ClusterCIDRPatch) ClusterCIDRSpecPatchPtrOutput { return v.Spec }).(ClusterCIDRSpecPatchPtrOutput)
   202  }
   203  
   204  type ClusterCIDRPatchArrayOutput struct{ *pulumi.OutputState }
   205  
   206  func (ClusterCIDRPatchArrayOutput) ElementType() reflect.Type {
   207  	return reflect.TypeOf((*[]*ClusterCIDRPatch)(nil)).Elem()
   208  }
   209  
   210  func (o ClusterCIDRPatchArrayOutput) ToClusterCIDRPatchArrayOutput() ClusterCIDRPatchArrayOutput {
   211  	return o
   212  }
   213  
   214  func (o ClusterCIDRPatchArrayOutput) ToClusterCIDRPatchArrayOutputWithContext(ctx context.Context) ClusterCIDRPatchArrayOutput {
   215  	return o
   216  }
   217  
   218  func (o ClusterCIDRPatchArrayOutput) Index(i pulumi.IntInput) ClusterCIDRPatchOutput {
   219  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ClusterCIDRPatch {
   220  		return vs[0].([]*ClusterCIDRPatch)[vs[1].(int)]
   221  	}).(ClusterCIDRPatchOutput)
   222  }
   223  
   224  type ClusterCIDRPatchMapOutput struct{ *pulumi.OutputState }
   225  
   226  func (ClusterCIDRPatchMapOutput) ElementType() reflect.Type {
   227  	return reflect.TypeOf((*map[string]*ClusterCIDRPatch)(nil)).Elem()
   228  }
   229  
   230  func (o ClusterCIDRPatchMapOutput) ToClusterCIDRPatchMapOutput() ClusterCIDRPatchMapOutput {
   231  	return o
   232  }
   233  
   234  func (o ClusterCIDRPatchMapOutput) ToClusterCIDRPatchMapOutputWithContext(ctx context.Context) ClusterCIDRPatchMapOutput {
   235  	return o
   236  }
   237  
   238  func (o ClusterCIDRPatchMapOutput) MapIndex(k pulumi.StringInput) ClusterCIDRPatchOutput {
   239  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ClusterCIDRPatch {
   240  		return vs[0].(map[string]*ClusterCIDRPatch)[vs[1].(string)]
   241  	}).(ClusterCIDRPatchOutput)
   242  }
   243  
   244  func init() {
   245  	pulumi.RegisterInputType(reflect.TypeOf((*ClusterCIDRPatchInput)(nil)).Elem(), &ClusterCIDRPatch{})
   246  	pulumi.RegisterInputType(reflect.TypeOf((*ClusterCIDRPatchArrayInput)(nil)).Elem(), ClusterCIDRPatchArray{})
   247  	pulumi.RegisterInputType(reflect.TypeOf((*ClusterCIDRPatchMapInput)(nil)).Elem(), ClusterCIDRPatchMap{})
   248  	pulumi.RegisterOutputType(ClusterCIDRPatchOutput{})
   249  	pulumi.RegisterOutputType(ClusterCIDRPatchArrayOutput{})
   250  	pulumi.RegisterOutputType(ClusterCIDRPatchMapOutput{})
   251  }