-
Notifications
You must be signed in to change notification settings - Fork 580
/
types.go
139 lines (116 loc) · 6.55 KB
/
types.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
package generation
// Config represents the configuration of a API group version
// and the configuration for each generator within it.
type Config struct {
// Compatibility represents the configuration of the compatiblity generator.
// When omitted, the default configuration will be used.
Compatibility *CompatibilityConfig `json:"compatibility,omitempty"`
// Deepcopy represents the configuration of the deepcopy generator.
// When omitted, the default configuration will be used.
Deepcopy *DeepcopyConfig `json:"deepcopy,omitempty"`
// OpenAPI represents the configuration of the openapi generator.
// When omitted, the default configuration will be used.
OpenAPI *OpenAPIConfig `json:"openapi,omitempty"`
// SchemaCheck represents the configuration for the schemacheck generator.
// When omitted, the default configuration will be used.
// When provided, any equivalent flag provided values are ignored.
SchemaCheck *SchemaCheckConfig `json:"schemacheck,omitempty"`
// SchemaPatch represents the configuration for the schemapatch generator.
// When omitted, the default configuration will be used.
// When provided, any equivalent flag provided values are ignored.
SchemaPatch *SchemaPatchConfig `json:"schemapatch,omitempty"`
// ManifestMerge represents the configuration for the manifest merge generator.
// When omitted, the default configuration will be used.
// When provided, any equivalent flag provided values are ignored.
ManifestMerge *ManifestMerge `json:"manifestMerge,omitempty"`
// EmptyPartialSchema represents the configuration for the manifest merge generator.
// When omitted, the default configuration will be used.
// When provided, any equivalent flag provided values are ignored.
EmptyPartialSchema *EmptyPartialSchema `json:"emptyPartialSchema,omitempty"`
// SwaggerDocs represents the configuration for the swaggerdocs generator.
// When omitted, the default configuration will be used.
// When provided, any equivalent flag provided values are ignored.
SwaggerDocs *SwaggerDocsConfig `json:"swaggerdocs,omitempty"`
}
// CompatibilityConfig is the configuration for the compatibility generator.
type CompatibilityConfig struct {
// Disabled determines whether the compatibility generator should be run or not.
// This generator is enabled by default so this field defaults to false.
Disabled bool `json:"disabled,omitempty"`
}
// DeepcopyConfig is the configuration for the deepcopy generator.
type DeepcopyConfig struct {
// Disabled determines whether the deepcopy generator should be run or not.
// This generator is enabled by default so this field defaults to false.
Disabled bool `json:"disabled,omitempty"`
// HeaderFilePath is the path to the file containing the boilerplate header text.
// When omitted, no header is added to the generated files.
HeaderFilePath string `json:"headerFilePath,omitempty"`
// OutputFileBaseName is the base name of the output file.
// When omitted, DefaultOutputFileBaseName is used.
// The current value of DefaultOutputFileBaseName is "zz_generated.deepcopy".
OutputFileBaseName string `json:"outputFileBaseName,omitempty"`
}
// OpenAPIConfig is the configuration for the openapi generator.
type OpenAPIConfig struct {
// Disabled determines whether the openapi generator should include this
// group or not.
// This generator is enabled by default so this field defaults to false.
Disabled bool `json:"disabled,omitempty"`
}
// SchemaCheckConfig is the configuration for the schemacheck generator.
type SchemaCheckConfig struct {
// Disabled determines whether the schemacheck generator should be run or not.
// This generator is enabled by default so this field defaults to false.
Disabled bool `json:"disabled,omitempty"`
// EnabledValidators is a list of the validators that should be enabled.
// If this is empty, the default validators are enabled.
EnabledValidators []string `json:"enabledValidators,omitempty"`
// DisabledValidators is a list of the validators that should be disabled.
// If this is empty, no default validators are disabled.
DisabledValidators []string `json:"disabledValidators,omitempty"`
}
// SchemaPatchConfig is the configuration for the schemapatch generator.
type SchemaPatchConfig struct {
// Disabled determines whether the schemapatch generator should be run or not.
// This generator is enabled by default so this field defaults to false.
Disabled bool `json:"disabled,omitempty"`
// RequiredFeatureSets is a list of feature sets combinations that should be
// generated for this API group.
// Each entry in this list is a comma separated list of feature set names
// which will be matched with the `release.openshift.io/feature-set` annotation
// on the CRD definition.
// When omitted, any manifest with a feature set annotation will be ignored.
// Example entries are `""` (empty string), `"TechPreviewNoUpgrade"` or `"TechPreviewNoUpgrade,CustomNoUpgrade"`.
RequiredFeatureSets []string `json:"requiredFeatureSets,omitempty"`
}
// ManifestMerge is the configuration for the manifest merge generator.
type ManifestMerge struct {
// Disabled determines whether the schemapatch generator should be run or not.
// This generator is enabled by default so this field defaults to false.
Disabled bool `json:"disabled,omitempty"`
}
// ManifestMerge is the configuration for the manifest merge generator.
type EmptyPartialSchema struct {
// Disabled determines whether the schemapatch generator should be run or not.
// This generator is enabled by default so this field defaults to false.
Disabled bool `json:"disabled,omitempty"`
}
// SwaggerDocsConfig is the configuration for the swaggerdocs generator.
type SwaggerDocsConfig struct {
// Disabled determines whether the swaggerdocs generator should be run or not.
// This generator is enabled by default so this field defaults to false.
Disabled bool `json:"disabled,omitempty"`
// CommentPolicy determines how, when verifying swaggerdocs, the generator
// should handle missing comments.
// Valid values are `Ignore`, `Warn` and `Enforce`.
// This defaults to `Warn`.
// When set to `Ignore`, the generator will ignore any missing comments.
// When set to `Warn`, the generator will emit a warning for any missing comments.
// When set to `Enforce`, the generator will return an error for any missing comments.
CommentPolicy string `json:"commentPolicy,omitempty"`
// OutputFileName is the file name to use for writing the generated swagger
// docs to. This file will be created for each group version.
// Whem omitted, this will default to `zz_generated.swagger_doc_generated.go`.
OutputFileName string `json:"outputFileName,omitempty"`
}