-
Notifications
You must be signed in to change notification settings - Fork 88
/
fabricchaincodespec.go
219 lines (197 loc) · 10.9 KB
/
fabricchaincodespec.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
/*
* Copyright Kungfusoftware.es. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
)
// FabricChaincodeSpecApplyConfiguration represents an declarative configuration of the FabricChaincodeSpec type for use
// with apply.
type FabricChaincodeSpecApplyConfiguration struct {
Annotations map[string]string `json:"annotations,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
PodLabels map[string]string `json:"podLabels,omitempty"`
Image *string `json:"image,omitempty"`
ImagePullPolicy *v1.PullPolicy `json:"imagePullPolicy,omitempty"`
PackageID *string `json:"packageId,omitempty"`
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
Command []string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Affinity *v1.Affinity `json:"affinity,omitempty"`
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
Resources *v1.ResourceRequirements `json:"resources,omitempty"`
Credentials *TLSApplyConfiguration `json:"credentials,omitempty"`
Replicas *int `json:"replicas,omitempty"`
Env []v1.EnvVar `json:"env,omitempty"`
ChaincodeServerPort *int `json:"chaincodeServerPort,omitempty"`
MspID *string `json:"mspID,omitempty"`
}
// FabricChaincodeSpecApplyConfiguration constructs an declarative configuration of the FabricChaincodeSpec type for use with
// apply.
func FabricChaincodeSpec() *FabricChaincodeSpecApplyConfiguration {
return &FabricChaincodeSpecApplyConfiguration{}
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *FabricChaincodeSpecApplyConfiguration) WithAnnotations(entries map[string]string) *FabricChaincodeSpecApplyConfiguration {
if b.Annotations == nil && len(entries) > 0 {
b.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.Annotations[k] = v
}
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *FabricChaincodeSpecApplyConfiguration) WithLabels(entries map[string]string) *FabricChaincodeSpecApplyConfiguration {
if b.Labels == nil && len(entries) > 0 {
b.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.Labels[k] = v
}
return b
}
// WithPodAnnotations puts the entries into the PodAnnotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the PodAnnotations field,
// overwriting an existing map entries in PodAnnotations field with the same key.
func (b *FabricChaincodeSpecApplyConfiguration) WithPodAnnotations(entries map[string]string) *FabricChaincodeSpecApplyConfiguration {
if b.PodAnnotations == nil && len(entries) > 0 {
b.PodAnnotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.PodAnnotations[k] = v
}
return b
}
// WithPodLabels puts the entries into the PodLabels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the PodLabels field,
// overwriting an existing map entries in PodLabels field with the same key.
func (b *FabricChaincodeSpecApplyConfiguration) WithPodLabels(entries map[string]string) *FabricChaincodeSpecApplyConfiguration {
if b.PodLabels == nil && len(entries) > 0 {
b.PodLabels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.PodLabels[k] = v
}
return b
}
// WithImage sets the Image field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Image field is set to the value of the last call.
func (b *FabricChaincodeSpecApplyConfiguration) WithImage(value string) *FabricChaincodeSpecApplyConfiguration {
b.Image = &value
return b
}
// WithImagePullPolicy sets the ImagePullPolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ImagePullPolicy field is set to the value of the last call.
func (b *FabricChaincodeSpecApplyConfiguration) WithImagePullPolicy(value v1.PullPolicy) *FabricChaincodeSpecApplyConfiguration {
b.ImagePullPolicy = &value
return b
}
// WithPackageID sets the PackageID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the PackageID field is set to the value of the last call.
func (b *FabricChaincodeSpecApplyConfiguration) WithPackageID(value string) *FabricChaincodeSpecApplyConfiguration {
b.PackageID = &value
return b
}
// WithImagePullSecrets adds the given value to the ImagePullSecrets field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the ImagePullSecrets field.
func (b *FabricChaincodeSpecApplyConfiguration) WithImagePullSecrets(values ...v1.LocalObjectReference) *FabricChaincodeSpecApplyConfiguration {
for i := range values {
b.ImagePullSecrets = append(b.ImagePullSecrets, values[i])
}
return b
}
// WithCommand adds the given value to the Command field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Command field.
func (b *FabricChaincodeSpecApplyConfiguration) WithCommand(values ...string) *FabricChaincodeSpecApplyConfiguration {
for i := range values {
b.Command = append(b.Command, values[i])
}
return b
}
// WithArgs adds the given value to the Args field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Args field.
func (b *FabricChaincodeSpecApplyConfiguration) WithArgs(values ...string) *FabricChaincodeSpecApplyConfiguration {
for i := range values {
b.Args = append(b.Args, values[i])
}
return b
}
// WithAffinity sets the Affinity field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Affinity field is set to the value of the last call.
func (b *FabricChaincodeSpecApplyConfiguration) WithAffinity(value v1.Affinity) *FabricChaincodeSpecApplyConfiguration {
b.Affinity = &value
return b
}
// WithTolerations adds the given value to the Tolerations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Tolerations field.
func (b *FabricChaincodeSpecApplyConfiguration) WithTolerations(values ...v1.Toleration) *FabricChaincodeSpecApplyConfiguration {
for i := range values {
b.Tolerations = append(b.Tolerations, values[i])
}
return b
}
// WithResources sets the Resources field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Resources field is set to the value of the last call.
func (b *FabricChaincodeSpecApplyConfiguration) WithResources(value v1.ResourceRequirements) *FabricChaincodeSpecApplyConfiguration {
b.Resources = &value
return b
}
// WithCredentials sets the Credentials field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Credentials field is set to the value of the last call.
func (b *FabricChaincodeSpecApplyConfiguration) WithCredentials(value *TLSApplyConfiguration) *FabricChaincodeSpecApplyConfiguration {
b.Credentials = value
return b
}
// WithReplicas sets the Replicas field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Replicas field is set to the value of the last call.
func (b *FabricChaincodeSpecApplyConfiguration) WithReplicas(value int) *FabricChaincodeSpecApplyConfiguration {
b.Replicas = &value
return b
}
// WithEnv adds the given value to the Env field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Env field.
func (b *FabricChaincodeSpecApplyConfiguration) WithEnv(values ...v1.EnvVar) *FabricChaincodeSpecApplyConfiguration {
for i := range values {
b.Env = append(b.Env, values[i])
}
return b
}
// WithChaincodeServerPort sets the ChaincodeServerPort field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ChaincodeServerPort field is set to the value of the last call.
func (b *FabricChaincodeSpecApplyConfiguration) WithChaincodeServerPort(value int) *FabricChaincodeSpecApplyConfiguration {
b.ChaincodeServerPort = &value
return b
}
// WithMspID sets the MspID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the MspID field is set to the value of the last call.
func (b *FabricChaincodeSpecApplyConfiguration) WithMspID(value string) *FabricChaincodeSpecApplyConfiguration {
b.MspID = &value
return b
}