/
clusterTrustBundle.go
253 lines (203 loc) · 12.1 KB
/
clusterTrustBundle.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
// Code generated by pulumigen DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1alpha1
import (
"context"
"reflect"
"errors"
metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ClusterTrustBundle is a cluster-scoped container for X.509 trust anchors (root certificates).
//
// ClusterTrustBundle objects are considered to be readable by any authenticated user in the cluster, because they can be mounted by pods using the `clusterTrustBundle` projection. All service accounts have read access to ClusterTrustBundles by default. Users who only have namespace-level access to a cluster can read ClusterTrustBundles by impersonating a serviceaccount that they have access to.
//
// It can be optionally associated with a particular assigner, in which case it contains one valid set of trust anchors for that signer. Signers may have multiple associated ClusterTrustBundles; each is an independent set of trust anchors for that signer. Admission control is used to enforce that only users with permissions on the signer can create or modify the corresponding bundle.
type ClusterTrustBundle struct {
pulumi.CustomResourceState
// 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"`
// 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"`
// metadata contains the object metadata.
Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
// spec contains the signer (if any) and trust anchors.
Spec ClusterTrustBundleSpecOutput `pulumi:"spec"`
}
// NewClusterTrustBundle registers a new resource with the given unique name, arguments, and options.
func NewClusterTrustBundle(ctx *pulumi.Context,
name string, args *ClusterTrustBundleArgs, opts ...pulumi.ResourceOption) (*ClusterTrustBundle, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Spec == nil {
return nil, errors.New("invalid value for required argument 'Spec'")
}
args.ApiVersion = pulumi.StringPtr("certificates.k8s.io/v1alpha1")
args.Kind = pulumi.StringPtr("ClusterTrustBundle")
var resource ClusterTrustBundle
err := ctx.RegisterResource("kubernetes:certificates.k8s.io/v1alpha1:ClusterTrustBundle", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetClusterTrustBundle gets an existing ClusterTrustBundle 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 GetClusterTrustBundle(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ClusterTrustBundleState, opts ...pulumi.ResourceOption) (*ClusterTrustBundle, error) {
var resource ClusterTrustBundle
err := ctx.ReadResource("kubernetes:certificates.k8s.io/v1alpha1:ClusterTrustBundle", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ClusterTrustBundle resources.
type clusterTrustBundleState struct {
}
type ClusterTrustBundleState struct {
}
func (ClusterTrustBundleState) ElementType() reflect.Type {
return reflect.TypeOf((*clusterTrustBundleState)(nil)).Elem()
}
type clusterTrustBundleArgs struct {
// 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"`
// 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"`
// metadata contains the object metadata.
Metadata *metav1.ObjectMeta `pulumi:"metadata"`
// spec contains the signer (if any) and trust anchors.
Spec ClusterTrustBundleSpec `pulumi:"spec"`
}
// The set of arguments for constructing a ClusterTrustBundle resource.
type ClusterTrustBundleArgs struct {
// 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
// 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
// metadata contains the object metadata.
Metadata metav1.ObjectMetaPtrInput
// spec contains the signer (if any) and trust anchors.
Spec ClusterTrustBundleSpecInput
}
func (ClusterTrustBundleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*clusterTrustBundleArgs)(nil)).Elem()
}
type ClusterTrustBundleInput interface {
pulumi.Input
ToClusterTrustBundleOutput() ClusterTrustBundleOutput
ToClusterTrustBundleOutputWithContext(ctx context.Context) ClusterTrustBundleOutput
}
func (*ClusterTrustBundle) ElementType() reflect.Type {
return reflect.TypeOf((**ClusterTrustBundle)(nil)).Elem()
}
func (i *ClusterTrustBundle) ToClusterTrustBundleOutput() ClusterTrustBundleOutput {
return i.ToClusterTrustBundleOutputWithContext(context.Background())
}
func (i *ClusterTrustBundle) ToClusterTrustBundleOutputWithContext(ctx context.Context) ClusterTrustBundleOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterTrustBundleOutput)
}
// ClusterTrustBundleArrayInput is an input type that accepts ClusterTrustBundleArray and ClusterTrustBundleArrayOutput values.
// You can construct a concrete instance of `ClusterTrustBundleArrayInput` via:
//
// ClusterTrustBundleArray{ ClusterTrustBundleArgs{...} }
type ClusterTrustBundleArrayInput interface {
pulumi.Input
ToClusterTrustBundleArrayOutput() ClusterTrustBundleArrayOutput
ToClusterTrustBundleArrayOutputWithContext(context.Context) ClusterTrustBundleArrayOutput
}
type ClusterTrustBundleArray []ClusterTrustBundleInput
func (ClusterTrustBundleArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ClusterTrustBundle)(nil)).Elem()
}
func (i ClusterTrustBundleArray) ToClusterTrustBundleArrayOutput() ClusterTrustBundleArrayOutput {
return i.ToClusterTrustBundleArrayOutputWithContext(context.Background())
}
func (i ClusterTrustBundleArray) ToClusterTrustBundleArrayOutputWithContext(ctx context.Context) ClusterTrustBundleArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterTrustBundleArrayOutput)
}
// ClusterTrustBundleMapInput is an input type that accepts ClusterTrustBundleMap and ClusterTrustBundleMapOutput values.
// You can construct a concrete instance of `ClusterTrustBundleMapInput` via:
//
// ClusterTrustBundleMap{ "key": ClusterTrustBundleArgs{...} }
type ClusterTrustBundleMapInput interface {
pulumi.Input
ToClusterTrustBundleMapOutput() ClusterTrustBundleMapOutput
ToClusterTrustBundleMapOutputWithContext(context.Context) ClusterTrustBundleMapOutput
}
type ClusterTrustBundleMap map[string]ClusterTrustBundleInput
func (ClusterTrustBundleMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ClusterTrustBundle)(nil)).Elem()
}
func (i ClusterTrustBundleMap) ToClusterTrustBundleMapOutput() ClusterTrustBundleMapOutput {
return i.ToClusterTrustBundleMapOutputWithContext(context.Background())
}
func (i ClusterTrustBundleMap) ToClusterTrustBundleMapOutputWithContext(ctx context.Context) ClusterTrustBundleMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterTrustBundleMapOutput)
}
type ClusterTrustBundleOutput struct{ *pulumi.OutputState }
func (ClusterTrustBundleOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ClusterTrustBundle)(nil)).Elem()
}
func (o ClusterTrustBundleOutput) ToClusterTrustBundleOutput() ClusterTrustBundleOutput {
return o
}
func (o ClusterTrustBundleOutput) ToClusterTrustBundleOutputWithContext(ctx context.Context) ClusterTrustBundleOutput {
return o
}
// 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
func (o ClusterTrustBundleOutput) ApiVersion() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ClusterTrustBundle) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
}
// 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
func (o ClusterTrustBundleOutput) Kind() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ClusterTrustBundle) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
}
// metadata contains the object metadata.
func (o ClusterTrustBundleOutput) Metadata() metav1.ObjectMetaPtrOutput {
return o.ApplyT(func(v *ClusterTrustBundle) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput)
}
// spec contains the signer (if any) and trust anchors.
func (o ClusterTrustBundleOutput) Spec() ClusterTrustBundleSpecOutput {
return o.ApplyT(func(v *ClusterTrustBundle) ClusterTrustBundleSpecOutput { return v.Spec }).(ClusterTrustBundleSpecOutput)
}
type ClusterTrustBundleArrayOutput struct{ *pulumi.OutputState }
func (ClusterTrustBundleArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ClusterTrustBundle)(nil)).Elem()
}
func (o ClusterTrustBundleArrayOutput) ToClusterTrustBundleArrayOutput() ClusterTrustBundleArrayOutput {
return o
}
func (o ClusterTrustBundleArrayOutput) ToClusterTrustBundleArrayOutputWithContext(ctx context.Context) ClusterTrustBundleArrayOutput {
return o
}
func (o ClusterTrustBundleArrayOutput) Index(i pulumi.IntInput) ClusterTrustBundleOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ClusterTrustBundle {
return vs[0].([]*ClusterTrustBundle)[vs[1].(int)]
}).(ClusterTrustBundleOutput)
}
type ClusterTrustBundleMapOutput struct{ *pulumi.OutputState }
func (ClusterTrustBundleMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ClusterTrustBundle)(nil)).Elem()
}
func (o ClusterTrustBundleMapOutput) ToClusterTrustBundleMapOutput() ClusterTrustBundleMapOutput {
return o
}
func (o ClusterTrustBundleMapOutput) ToClusterTrustBundleMapOutputWithContext(ctx context.Context) ClusterTrustBundleMapOutput {
return o
}
func (o ClusterTrustBundleMapOutput) MapIndex(k pulumi.StringInput) ClusterTrustBundleOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ClusterTrustBundle {
return vs[0].(map[string]*ClusterTrustBundle)[vs[1].(string)]
}).(ClusterTrustBundleOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ClusterTrustBundleInput)(nil)).Elem(), &ClusterTrustBundle{})
pulumi.RegisterInputType(reflect.TypeOf((*ClusterTrustBundleArrayInput)(nil)).Elem(), ClusterTrustBundleArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ClusterTrustBundleMapInput)(nil)).Elem(), ClusterTrustBundleMap{})
pulumi.RegisterOutputType(ClusterTrustBundleOutput{})
pulumi.RegisterOutputType(ClusterTrustBundleArrayOutput{})
pulumi.RegisterOutputType(ClusterTrustBundleMapOutput{})
}