@@ -44,19 +44,19 @@ var TypeMeta = yaml.ResourceMeta{
44
44
type KptFile struct {
45
45
yaml.ResourceMeta `yaml:",inline"`
46
46
47
- Upstream * Upstream `yaml:"upstream,omitempty"`
47
+ Upstream * Upstream `yaml:"upstream,omitempty" json:"upstream,omitempty" `
48
48
49
49
// UpstreamLock is a resolved locator for the last fetch of the package.
50
- UpstreamLock * UpstreamLock `yaml:"upstreamLock,omitempty"`
50
+ UpstreamLock * UpstreamLock `yaml:"upstreamLock,omitempty" json:"upstreamLock,omitempty" `
51
51
52
52
// Info contains metadata such as license, documentation, etc.
53
- Info * PackageInfo `yaml:"info,omitempty"`
53
+ Info * PackageInfo `yaml:"info,omitempty" json:"info,omitempty" `
54
54
55
55
// Pipeline declares the pipeline of functions.
56
- Pipeline * Pipeline `yaml:"pipeline,omitempty"`
56
+ Pipeline * Pipeline `yaml:"pipeline,omitempty" json:"pipeline,omitempty" `
57
57
58
58
// Inventory contains parameters for the inventory object used in apply.
59
- Inventory * Inventory `yaml:"inventory,omitempty"`
59
+ Inventory * Inventory `yaml:"inventory,omitempty" json:"inventory,omitempty" `
60
60
}
61
61
62
62
// OriginType defines the type of origin for a package.
@@ -116,55 +116,55 @@ func UpdateStrategiesAsStrings() []string {
116
116
// Upstream is a user-specified upstream locator for a package.
117
117
type Upstream struct {
118
118
// Type is the type of origin.
119
- Type OriginType `yaml:"type,omitempty"`
119
+ Type OriginType `yaml:"type,omitempty" json:"type,omitempty" `
120
120
121
121
// Git is the locator for a package stored on Git.
122
- Git * Git `yaml:"git,omitempty"`
122
+ Git * Git `yaml:"git,omitempty" json:"git,omitempty" `
123
123
124
124
// UpdateStrategy declares how a package will be updated from upstream.
125
- UpdateStrategy UpdateStrategyType `yaml:"updateStrategy,omitempty"`
125
+ UpdateStrategy UpdateStrategyType `yaml:"updateStrategy,omitempty" json:"updateStrategy,omitempty" `
126
126
}
127
127
128
128
// Git is the user-specified locator for a package on Git.
129
129
type Git struct {
130
130
// Repo is the git repository the package.
131
131
// e.g. 'https://github.com/kubernetes/examples.git'
132
- Repo string `yaml:"repo,omitempty"`
132
+ Repo string `yaml:"repo,omitempty" json:"repo,omitempty" `
133
133
134
134
// Directory is the sub directory of the git repository.
135
135
// e.g. 'staging/cockroachdb'
136
- Directory string `yaml:"directory,omitempty"`
136
+ Directory string `yaml:"directory,omitempty" json:"directory,omitempty" `
137
137
138
138
// Ref can be a Git branch, tag, or a commit SHA-1.
139
- Ref string `yaml:"ref,omitempty"`
139
+ Ref string `yaml:"ref,omitempty" json:"ref,omitempty" `
140
140
}
141
141
142
142
// UpstreamLock is a resolved locator for the last fetch of the package.
143
143
type UpstreamLock struct {
144
144
// Type is the type of origin.
145
- Type OriginType `yaml:"type,omitempty"`
145
+ Type OriginType `yaml:"type,omitempty" json:"type,omitempty" `
146
146
147
147
// Git is the resolved locator for a package on Git.
148
- Git * GitLock `yaml:"git,omitempty"`
148
+ Git * GitLock `yaml:"git,omitempty" json:"git,omitempty" `
149
149
}
150
150
151
151
// GitLock is the resolved locator for a package on Git.
152
152
type GitLock struct {
153
153
// Repo is the git repository that was fetched.
154
154
// e.g. 'https://github.com/kubernetes/examples.git'
155
- Repo string `yaml:"repo,omitempty"`
155
+ Repo string `yaml:"repo,omitempty" json:"repo,omitempty" `
156
156
157
157
// Directory is the sub directory of the git repository that was fetched.
158
158
// e.g. 'staging/cockroachdb'
159
- Directory string `yaml:"directory,omitempty"`
159
+ Directory string `yaml:"directory,omitempty" json:"directory,omitempty" `
160
160
161
161
// Ref can be a Git branch, tag, or a commit SHA-1 that was fetched.
162
162
// e.g. 'master'
163
- Ref string `yaml:"ref,omitempty"`
163
+ Ref string `yaml:"ref,omitempty" json:"ref,omitempty" `
164
164
165
165
// Commit is the SHA-1 for the last fetch of the package.
166
166
// This is set by kpt for bookkeeping purposes.
167
- Commit string `yaml:"commit,omitempty"`
167
+ Commit string `yaml:"commit,omitempty" json:"commit,omitempty" `
168
168
}
169
169
170
170
// PackageInfo contains optional information about the package such as license, documentation, etc.
@@ -173,37 +173,37 @@ type GitLock struct {
173
173
// `metadata.annotations` as the extension mechanism.
174
174
type PackageInfo struct {
175
175
// Site is the URL for package web page.
176
- Site string `yaml:"site,omitempty"`
176
+ Site string `yaml:"site,omitempty" json:"site,omitempty" `
177
177
178
178
// Email is the list of emails for the package authors.
179
- Emails []string `yaml:"emails,omitempty"`
179
+ Emails []string `yaml:"emails,omitempty" json:"emails,omitempty" `
180
180
181
181
// SPDX license identifier (e.g. "Apache-2.0"). See: https://spdx.org/licenses/
182
- License string `yaml:"license,omitempty"`
182
+ License string `yaml:"license,omitempty" json:"license,omitempty" `
183
183
184
184
// Relative slash-delimited path to the license file (e.g. LICENSE.txt)
185
- LicenseFile string `yaml:"licenseFile,omitempty"`
185
+ LicenseFile string `yaml:"licenseFile,omitempty" json:"licenseFile,omitempty" `
186
186
187
187
// Description contains a short description of the package.
188
- Description string `yaml:"description,omitempty"`
188
+ Description string `yaml:"description,omitempty" json:"description,omitempty" `
189
189
190
190
// Keywords is a list of keywords for this package.
191
- Keywords []string `yaml:"keywords,omitempty"`
191
+ Keywords []string `yaml:"keywords,omitempty" json:"keywords,omitempty" `
192
192
193
193
// Man is the path to documentation about the package
194
- Man string `yaml:"man,omitempty"`
194
+ Man string `yaml:"man,omitempty" json:"man,omitempty" `
195
195
}
196
196
197
197
// Subpackages declares a local or remote subpackage.
198
198
type Subpackage struct {
199
199
// Name of the immediate subdirectory relative to this Kptfile where the suppackage
200
200
// either exists (local subpackages) or will be fetched to (remote subpckages).
201
201
// This must be unique across all subpckages of a package.
202
- LocalDir string `yaml:"localDir,omitempty"`
202
+ LocalDir string `yaml:"localDir,omitempty" json:"localDir,omitempty" `
203
203
204
204
// Upstream is a reference to where the subpackage should be fetched from.
205
205
// Whether a subpackage is local or remote is determined by whether Upstream is specified.
206
- Upstream * Upstream `yaml:"upstream,omitempty"`
206
+ Upstream * Upstream `yaml:"upstream,omitempty" json:"upstream,omitempty" `
207
207
}
208
208
209
209
// Pipeline declares a pipeline of functions used to mutate or validate resources.
@@ -228,11 +228,11 @@ type Pipeline struct {
228
228
// Order of operation: mutators, validators
229
229
230
230
// Mutators defines a list of of KRM functions that mutate resources.
231
- Mutators []Function `yaml:"mutators,omitempty"`
231
+ Mutators []Function `yaml:"mutators,omitempty" json:"mutators,omitempty" `
232
232
233
233
// Validators defines a list of KRM functions that validate resources.
234
234
// Validators are not permitted to mutate resources.
235
- Validators []Function `yaml:"validators,omitempty"`
235
+ Validators []Function `yaml:"validators,omitempty" json:"validators,omitempty" `
236
236
}
237
237
238
238
// String returns the string representation of Pipeline struct
@@ -266,33 +266,33 @@ type Function struct {
266
266
// e.g. The following resolves to gcr.io/kpt-fn/set-labels:
267
267
//
268
268
// image: set-labels
269
- Image string `yaml:"image,omitempty"`
269
+ Image string `yaml:"image,omitempty" json:"image,omitempty" `
270
270
271
271
// `ConfigPath` specifies a slash-delimited relative path to a file in the current directory
272
272
// containing a KRM resource used as the function config. This resource is
273
273
// excluded when resolving 'sources', and as a result cannot be operated on
274
274
// by the pipeline.
275
- ConfigPath string `yaml:"configPath,omitempty"`
275
+ ConfigPath string `yaml:"configPath,omitempty" json:"configPath,omitempty" `
276
276
277
277
// `ConfigMap` is a convenient way to specify a function config of kind ConfigMap.
278
- ConfigMap map [string ]string `yaml:"configMap,omitempty"`
278
+ ConfigMap map [string ]string `yaml:"configMap,omitempty" json:"configMap,omitempty" `
279
279
280
280
// `Selectors` are used to specify resources on which the function should be executed
281
281
// if not specified, all resources are selected
282
- Selectors []Selector `yaml:"selectors,omitempty"`
282
+ Selectors []Selector `yaml:"selectors,omitempty" json:"selectors,omitempty" `
283
283
}
284
284
285
285
// Selector specifies the selection criteria
286
286
// please update IsEmpty method if more properties are added
287
287
type Selector struct {
288
288
// APIVersion of the target resources
289
- APIVersion string `yaml:"apiVersion,omitempty"`
289
+ APIVersion string `yaml:"apiVersion,omitempty" json:"apiVersion,omitempty" `
290
290
// Kind of the target resources
291
- Kind string `yaml:"kind,omitempty"`
291
+ Kind string `yaml:"kind,omitempty" json:"kind,omitempty" `
292
292
// Name of the target resources
293
- Name string `yaml:"name,omitempty"`
293
+ Name string `yaml:"name,omitempty" json:"name,omitempty" `
294
294
// Namespace of the target resources
295
- Namespace string `yaml:"namespace,omitempty"`
295
+ Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty" `
296
296
}
297
297
298
298
// IsEmpty returns true of none of the selection criteria is specified
@@ -307,11 +307,11 @@ func (s Selector) IsEmpty() bool {
307
307
// All of the the parameters are required if any are set.
308
308
type Inventory struct {
309
309
// Namespace for the inventory resource.
310
- Namespace string `yaml:"namespace,omitempty"`
310
+ Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty" `
311
311
// Name of the inventory resource.
312
- Name string `yaml:"name,omitempty"`
312
+ Name string `yaml:"name,omitempty" json:"name,omitempty" `
313
313
// Unique label to identify inventory resource in cluster.
314
- InventoryID string `yaml:"inventoryID,omitempty"`
315
- Labels map [string ]string `yaml:"labels,omitempty"`
316
- Annotations map [string ]string `yaml:"annotations,omitempty"`
314
+ InventoryID string `yaml:"inventoryID,omitempty" json:"inventoryID,omitempty" `
315
+ Labels map [string ]string `yaml:"labels,omitempty" json:"labels,omitempty" `
316
+ Annotations map [string ]string `yaml:"annotations,omitempty" json:"annotations,omitempty" `
317
317
}
0 commit comments