github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/node/v1alpha1/runtimeClass.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  	"errors"
    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  // RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod.  For more details, see https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md
    16  type RuntimeClass struct {
    17  	pulumi.CustomResourceState
    18  
    19  	// 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
    20  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    21  	// 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
    22  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    23  	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    24  	Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
    25  	// Specification of the RuntimeClass More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    26  	Spec RuntimeClassSpecOutput `pulumi:"spec"`
    27  }
    28  
    29  // NewRuntimeClass registers a new resource with the given unique name, arguments, and options.
    30  func NewRuntimeClass(ctx *pulumi.Context,
    31  	name string, args *RuntimeClassArgs, opts ...pulumi.ResourceOption) (*RuntimeClass, error) {
    32  	if args == nil {
    33  		return nil, errors.New("missing one or more required arguments")
    34  	}
    35  
    36  	if args.Spec == nil {
    37  		return nil, errors.New("invalid value for required argument 'Spec'")
    38  	}
    39  	args.ApiVersion = pulumi.StringPtr("node.k8s.io/v1alpha1")
    40  	args.Kind = pulumi.StringPtr("RuntimeClass")
    41  	aliases := pulumi.Aliases([]pulumi.Alias{
    42  		{
    43  			Type: pulumi.String("kubernetes:node.k8s.io/v1:RuntimeClass"),
    44  		},
    45  		{
    46  			Type: pulumi.String("kubernetes:node.k8s.io/v1beta1:RuntimeClass"),
    47  		},
    48  	})
    49  	opts = append(opts, aliases)
    50  	var resource RuntimeClass
    51  	err := ctx.RegisterResource("kubernetes:node.k8s.io/v1alpha1:RuntimeClass", name, args, &resource, opts...)
    52  	if err != nil {
    53  		return nil, err
    54  	}
    55  	return &resource, nil
    56  }
    57  
    58  // GetRuntimeClass gets an existing RuntimeClass resource's state with the given name, ID, and optional
    59  // state properties that are used to uniquely qualify the lookup (nil if not required).
    60  func GetRuntimeClass(ctx *pulumi.Context,
    61  	name string, id pulumi.IDInput, state *RuntimeClassState, opts ...pulumi.ResourceOption) (*RuntimeClass, error) {
    62  	var resource RuntimeClass
    63  	err := ctx.ReadResource("kubernetes:node.k8s.io/v1alpha1:RuntimeClass", name, id, state, &resource, opts...)
    64  	if err != nil {
    65  		return nil, err
    66  	}
    67  	return &resource, nil
    68  }
    69  
    70  // Input properties used for looking up and filtering RuntimeClass resources.
    71  type runtimeClassState struct {
    72  }
    73  
    74  type RuntimeClassState struct {
    75  }
    76  
    77  func (RuntimeClassState) ElementType() reflect.Type {
    78  	return reflect.TypeOf((*runtimeClassState)(nil)).Elem()
    79  }
    80  
    81  type runtimeClassArgs struct {
    82  	// 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
    83  	ApiVersion *string `pulumi:"apiVersion"`
    84  	// 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
    85  	Kind *string `pulumi:"kind"`
    86  	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    87  	Metadata *metav1.ObjectMeta `pulumi:"metadata"`
    88  	// Specification of the RuntimeClass More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    89  	Spec RuntimeClassSpec `pulumi:"spec"`
    90  }
    91  
    92  // The set of arguments for constructing a RuntimeClass resource.
    93  type RuntimeClassArgs struct {
    94  	// 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
    95  	ApiVersion pulumi.StringPtrInput
    96  	// 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
    97  	Kind pulumi.StringPtrInput
    98  	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    99  	Metadata metav1.ObjectMetaPtrInput
   100  	// Specification of the RuntimeClass More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   101  	Spec RuntimeClassSpecInput
   102  }
   103  
   104  func (RuntimeClassArgs) ElementType() reflect.Type {
   105  	return reflect.TypeOf((*runtimeClassArgs)(nil)).Elem()
   106  }
   107  
   108  type RuntimeClassInput interface {
   109  	pulumi.Input
   110  
   111  	ToRuntimeClassOutput() RuntimeClassOutput
   112  	ToRuntimeClassOutputWithContext(ctx context.Context) RuntimeClassOutput
   113  }
   114  
   115  func (*RuntimeClass) ElementType() reflect.Type {
   116  	return reflect.TypeOf((**RuntimeClass)(nil)).Elem()
   117  }
   118  
   119  func (i *RuntimeClass) ToRuntimeClassOutput() RuntimeClassOutput {
   120  	return i.ToRuntimeClassOutputWithContext(context.Background())
   121  }
   122  
   123  func (i *RuntimeClass) ToRuntimeClassOutputWithContext(ctx context.Context) RuntimeClassOutput {
   124  	return pulumi.ToOutputWithContext(ctx, i).(RuntimeClassOutput)
   125  }
   126  
   127  // RuntimeClassArrayInput is an input type that accepts RuntimeClassArray and RuntimeClassArrayOutput values.
   128  // You can construct a concrete instance of `RuntimeClassArrayInput` via:
   129  //
   130  //	RuntimeClassArray{ RuntimeClassArgs{...} }
   131  type RuntimeClassArrayInput interface {
   132  	pulumi.Input
   133  
   134  	ToRuntimeClassArrayOutput() RuntimeClassArrayOutput
   135  	ToRuntimeClassArrayOutputWithContext(context.Context) RuntimeClassArrayOutput
   136  }
   137  
   138  type RuntimeClassArray []RuntimeClassInput
   139  
   140  func (RuntimeClassArray) ElementType() reflect.Type {
   141  	return reflect.TypeOf((*[]*RuntimeClass)(nil)).Elem()
   142  }
   143  
   144  func (i RuntimeClassArray) ToRuntimeClassArrayOutput() RuntimeClassArrayOutput {
   145  	return i.ToRuntimeClassArrayOutputWithContext(context.Background())
   146  }
   147  
   148  func (i RuntimeClassArray) ToRuntimeClassArrayOutputWithContext(ctx context.Context) RuntimeClassArrayOutput {
   149  	return pulumi.ToOutputWithContext(ctx, i).(RuntimeClassArrayOutput)
   150  }
   151  
   152  // RuntimeClassMapInput is an input type that accepts RuntimeClassMap and RuntimeClassMapOutput values.
   153  // You can construct a concrete instance of `RuntimeClassMapInput` via:
   154  //
   155  //	RuntimeClassMap{ "key": RuntimeClassArgs{...} }
   156  type RuntimeClassMapInput interface {
   157  	pulumi.Input
   158  
   159  	ToRuntimeClassMapOutput() RuntimeClassMapOutput
   160  	ToRuntimeClassMapOutputWithContext(context.Context) RuntimeClassMapOutput
   161  }
   162  
   163  type RuntimeClassMap map[string]RuntimeClassInput
   164  
   165  func (RuntimeClassMap) ElementType() reflect.Type {
   166  	return reflect.TypeOf((*map[string]*RuntimeClass)(nil)).Elem()
   167  }
   168  
   169  func (i RuntimeClassMap) ToRuntimeClassMapOutput() RuntimeClassMapOutput {
   170  	return i.ToRuntimeClassMapOutputWithContext(context.Background())
   171  }
   172  
   173  func (i RuntimeClassMap) ToRuntimeClassMapOutputWithContext(ctx context.Context) RuntimeClassMapOutput {
   174  	return pulumi.ToOutputWithContext(ctx, i).(RuntimeClassMapOutput)
   175  }
   176  
   177  type RuntimeClassOutput struct{ *pulumi.OutputState }
   178  
   179  func (RuntimeClassOutput) ElementType() reflect.Type {
   180  	return reflect.TypeOf((**RuntimeClass)(nil)).Elem()
   181  }
   182  
   183  func (o RuntimeClassOutput) ToRuntimeClassOutput() RuntimeClassOutput {
   184  	return o
   185  }
   186  
   187  func (o RuntimeClassOutput) ToRuntimeClassOutputWithContext(ctx context.Context) RuntimeClassOutput {
   188  	return o
   189  }
   190  
   191  // 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
   192  func (o RuntimeClassOutput) ApiVersion() pulumi.StringPtrOutput {
   193  	return o.ApplyT(func(v *RuntimeClass) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   194  }
   195  
   196  // 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
   197  func (o RuntimeClassOutput) Kind() pulumi.StringPtrOutput {
   198  	return o.ApplyT(func(v *RuntimeClass) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   199  }
   200  
   201  // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   202  func (o RuntimeClassOutput) Metadata() metav1.ObjectMetaPtrOutput {
   203  	return o.ApplyT(func(v *RuntimeClass) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput)
   204  }
   205  
   206  // Specification of the RuntimeClass More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   207  func (o RuntimeClassOutput) Spec() RuntimeClassSpecOutput {
   208  	return o.ApplyT(func(v *RuntimeClass) RuntimeClassSpecOutput { return v.Spec }).(RuntimeClassSpecOutput)
   209  }
   210  
   211  type RuntimeClassArrayOutput struct{ *pulumi.OutputState }
   212  
   213  func (RuntimeClassArrayOutput) ElementType() reflect.Type {
   214  	return reflect.TypeOf((*[]*RuntimeClass)(nil)).Elem()
   215  }
   216  
   217  func (o RuntimeClassArrayOutput) ToRuntimeClassArrayOutput() RuntimeClassArrayOutput {
   218  	return o
   219  }
   220  
   221  func (o RuntimeClassArrayOutput) ToRuntimeClassArrayOutputWithContext(ctx context.Context) RuntimeClassArrayOutput {
   222  	return o
   223  }
   224  
   225  func (o RuntimeClassArrayOutput) Index(i pulumi.IntInput) RuntimeClassOutput {
   226  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RuntimeClass {
   227  		return vs[0].([]*RuntimeClass)[vs[1].(int)]
   228  	}).(RuntimeClassOutput)
   229  }
   230  
   231  type RuntimeClassMapOutput struct{ *pulumi.OutputState }
   232  
   233  func (RuntimeClassMapOutput) ElementType() reflect.Type {
   234  	return reflect.TypeOf((*map[string]*RuntimeClass)(nil)).Elem()
   235  }
   236  
   237  func (o RuntimeClassMapOutput) ToRuntimeClassMapOutput() RuntimeClassMapOutput {
   238  	return o
   239  }
   240  
   241  func (o RuntimeClassMapOutput) ToRuntimeClassMapOutputWithContext(ctx context.Context) RuntimeClassMapOutput {
   242  	return o
   243  }
   244  
   245  func (o RuntimeClassMapOutput) MapIndex(k pulumi.StringInput) RuntimeClassOutput {
   246  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RuntimeClass {
   247  		return vs[0].(map[string]*RuntimeClass)[vs[1].(string)]
   248  	}).(RuntimeClassOutput)
   249  }
   250  
   251  func init() {
   252  	pulumi.RegisterInputType(reflect.TypeOf((*RuntimeClassInput)(nil)).Elem(), &RuntimeClass{})
   253  	pulumi.RegisterInputType(reflect.TypeOf((*RuntimeClassArrayInput)(nil)).Elem(), RuntimeClassArray{})
   254  	pulumi.RegisterInputType(reflect.TypeOf((*RuntimeClassMapInput)(nil)).Elem(), RuntimeClassMap{})
   255  	pulumi.RegisterOutputType(RuntimeClassOutput{})
   256  	pulumi.RegisterOutputType(RuntimeClassArrayOutput{})
   257  	pulumi.RegisterOutputType(RuntimeClassMapOutput{})
   258  }