-
Notifications
You must be signed in to change notification settings - Fork 115
/
endpointSlice.go
134 lines (121 loc) · 10.4 KB
/
endpointSlice.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// *** WARNING: this file was generated by pulumigen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v1beta1
import (
"reflect"
"github.com/pkg/errors"
metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v2/go/kubernetes/meta/v1"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.
type EndpointSlice struct {
pulumi.CustomResourceState
// addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.
AddressType pulumi.StringOutput `pulumi:"addressType"`
// 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
ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
// endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.
Endpoints EndpointArrayOutput `pulumi:"endpoints"`
// 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
Kind pulumi.StringPtrOutput `pulumi:"kind"`
// Standard object's metadata.
Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
// ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates "all ports". Each slice may include a maximum of 100 ports.
Ports EndpointPortArrayOutput `pulumi:"ports"`
}
// NewEndpointSlice registers a new resource with the given unique name, arguments, and options.
func NewEndpointSlice(ctx *pulumi.Context,
name string, args *EndpointSliceArgs, opts ...pulumi.ResourceOption) (*EndpointSlice, error) {
if args == nil || args.AddressType == nil {
return nil, errors.New("missing required argument 'AddressType'")
}
if args == nil || args.Endpoints == nil {
return nil, errors.New("missing required argument 'Endpoints'")
}
if args == nil {
args = &EndpointSliceArgs{}
}
args.ApiVersion = pulumi.StringPtr("discovery.k8s.io/v1beta1")
args.Kind = pulumi.StringPtr("EndpointSlice")
var resource EndpointSlice
err := ctx.RegisterResource("kubernetes:discovery.k8s.io/v1beta1:EndpointSlice", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEndpointSlice gets an existing EndpointSlice resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetEndpointSlice(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EndpointSliceState, opts ...pulumi.ResourceOption) (*EndpointSlice, error) {
var resource EndpointSlice
err := ctx.ReadResource("kubernetes:discovery.k8s.io/v1beta1:EndpointSlice", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EndpointSlice resources.
type endpointSliceState struct {
// addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.
AddressType *string `pulumi:"addressType"`
// 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
ApiVersion *string `pulumi:"apiVersion"`
// endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.
Endpoints []Endpoint `pulumi:"endpoints"`
// 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
Kind *string `pulumi:"kind"`
// Standard object's metadata.
Metadata *metav1.ObjectMeta `pulumi:"metadata"`
// ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates "all ports". Each slice may include a maximum of 100 ports.
Ports []EndpointPort `pulumi:"ports"`
}
type EndpointSliceState struct {
// addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.
AddressType pulumi.StringPtrInput
// 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
ApiVersion pulumi.StringPtrInput
// endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.
Endpoints EndpointArrayInput
// 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
Kind pulumi.StringPtrInput
// Standard object's metadata.
Metadata metav1.ObjectMetaPtrInput
// ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates "all ports". Each slice may include a maximum of 100 ports.
Ports EndpointPortArrayInput
}
func (EndpointSliceState) ElementType() reflect.Type {
return reflect.TypeOf((*endpointSliceState)(nil)).Elem()
}
type endpointSliceArgs struct {
// addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.
AddressType string `pulumi:"addressType"`
// 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
ApiVersion *string `pulumi:"apiVersion"`
// endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.
Endpoints []Endpoint `pulumi:"endpoints"`
// 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
Kind *string `pulumi:"kind"`
// Standard object's metadata.
Metadata *metav1.ObjectMeta `pulumi:"metadata"`
// ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates "all ports". Each slice may include a maximum of 100 ports.
Ports []EndpointPort `pulumi:"ports"`
}
// The set of arguments for constructing a EndpointSlice resource.
type EndpointSliceArgs struct {
// addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.
AddressType pulumi.StringInput
// 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
ApiVersion pulumi.StringPtrInput
// endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.
Endpoints EndpointArrayInput
// 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
Kind pulumi.StringPtrInput
// Standard object's metadata.
Metadata metav1.ObjectMetaPtrInput
// ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates "all ports". Each slice may include a maximum of 100 ports.
Ports EndpointPortArrayInput
}
func (EndpointSliceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*endpointSliceArgs)(nil)).Elem()
}