mirror of
https://github.com/kubernetes/client-go.git
synced 2026-06-09 18:55:26 +00:00
Compare commits
186 Commits
kubernetes
...
v0.31.0-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef61656b8a | ||
|
|
d2f5fba1f8 | ||
|
|
6e4469285c | ||
|
|
cea15394b3 | ||
|
|
e4e31fd32c | ||
|
|
5f43af464b | ||
|
|
cc198ea39d | ||
|
|
39cc8deb07 | ||
|
|
f29a36dfab | ||
|
|
48d8fc7e2e | ||
|
|
fb1003a7e4 | ||
|
|
5347b09f1d | ||
|
|
9a760efea1 | ||
|
|
03443e7ede | ||
|
|
b681e77bec | ||
|
|
14559c0fec | ||
|
|
911684686f | ||
|
|
4d57b6a340 | ||
|
|
c415c7650f | ||
|
|
8fc5a64651 | ||
|
|
503a0905c0 | ||
|
|
2d885a2ed5 | ||
|
|
e8224736d3 | ||
|
|
94cabc85d9 | ||
|
|
1fc4f8ad34 | ||
|
|
20d0a8ee82 | ||
|
|
1c075dc88c | ||
|
|
098e7c5a9b | ||
|
|
82627741cb | ||
|
|
bbe85a4a80 | ||
|
|
b03e5b8438 | ||
|
|
c7d706847a | ||
|
|
5d84e91dbf | ||
|
|
7c6e307a72 | ||
|
|
7c5e9038dd | ||
|
|
8c9cb8838f | ||
|
|
52e5651101 | ||
|
|
d81b8f6492 | ||
|
|
7adab2f2f6 | ||
|
|
e8b54718d0 | ||
|
|
9c87eb0815 | ||
|
|
b4e1cfcfab | ||
|
|
5d650114a5 | ||
|
|
3f130bd830 | ||
|
|
5f741a5d35 | ||
|
|
b92b563c44 | ||
|
|
785fca481f | ||
|
|
f53839a9ad | ||
|
|
9f33e96b6a | ||
|
|
c559583d36 | ||
|
|
b7ea49a199 | ||
|
|
538b7809aa | ||
|
|
e6e45e172b | ||
|
|
92f0985ce1 | ||
|
|
e428fc295c | ||
|
|
fd6b8e6551 | ||
|
|
00036b79c4 | ||
|
|
0123e78ef6 | ||
|
|
e89e40c187 | ||
|
|
e8eae94e45 | ||
|
|
98df4f79ac | ||
|
|
2f2b800097 | ||
|
|
3aa51ce508 | ||
|
|
ebbf7d7dc3 | ||
|
|
b444e6c32e | ||
|
|
6bdde7723e | ||
|
|
c7396197f3 | ||
|
|
4a34196022 | ||
|
|
86f83bc818 | ||
|
|
0280901a4d | ||
|
|
62f959700d | ||
|
|
8a8d0731de | ||
|
|
988ddc2b6c | ||
|
|
4ebe42d8c9 | ||
|
|
d3682da14f | ||
|
|
35cab326ad | ||
|
|
64ff14beda | ||
|
|
049f231649 | ||
|
|
9aa3aae99d | ||
|
|
f9eba8e8c3 | ||
|
|
ea434dfecf | ||
|
|
6b47d7dcbe | ||
|
|
178bcf2846 | ||
|
|
f3332a08cc | ||
|
|
9433226579 | ||
|
|
4a5f039360 | ||
|
|
e4f9b83713 | ||
|
|
47f558294c | ||
|
|
66b378aea8 | ||
|
|
02e371e437 | ||
|
|
d071c08540 | ||
|
|
5b2b83af72 | ||
|
|
841e997e33 | ||
|
|
5db05eb767 | ||
|
|
b1c1c0345d | ||
|
|
506bc538e6 | ||
|
|
3407442ff2 | ||
|
|
9990b0b122 | ||
|
|
a82df61b84 | ||
|
|
79491afc36 | ||
|
|
2fe05741c1 | ||
|
|
4cd6b756be | ||
|
|
b17c363481 | ||
|
|
34d780971c | ||
|
|
d67dddfe90 | ||
|
|
b9e952f4d7 | ||
|
|
7da319745b | ||
|
|
aa7909e7d7 | ||
|
|
a2cc490854 | ||
|
|
a457c5ed68 | ||
|
|
1518fca9f0 | ||
|
|
fa185a21db | ||
|
|
eea636f8f4 | ||
|
|
4467b1e437 | ||
|
|
650f39267a | ||
|
|
00e4609774 | ||
|
|
45e17fede0 | ||
|
|
7ebe0ea60e | ||
|
|
3be09aa8db | ||
|
|
110b75b14e | ||
|
|
9c3db8681d | ||
|
|
16552d4656 | ||
|
|
ffda3468aa | ||
|
|
af62623c06 | ||
|
|
3d4f98db0e | ||
|
|
a1be94abc3 | ||
|
|
02f21344ac | ||
|
|
9d701d3504 | ||
|
|
05ff4bb2fd | ||
|
|
b0efa42e52 | ||
|
|
84dfaee610 | ||
|
|
d2c6177154 | ||
|
|
fee411cff2 | ||
|
|
4c32855540 | ||
|
|
95cf817801 | ||
|
|
49bc97e518 | ||
|
|
47abbe0251 | ||
|
|
0cdc0ce850 | ||
|
|
8b11b2fa6b | ||
|
|
e34b66436f | ||
|
|
8c60342479 | ||
|
|
82506389a2 | ||
|
|
d1672351e4 | ||
|
|
62aace94ab | ||
|
|
64334495a6 | ||
|
|
6810f4fa0d | ||
|
|
f323801a34 | ||
|
|
ae38726e6e | ||
|
|
4b03fda005 | ||
|
|
79f21dcaa8 | ||
|
|
64b46766f1 | ||
|
|
271d034e86 | ||
|
|
08128e0dfa | ||
|
|
1002c2f9bd | ||
|
|
f759d2e976 | ||
|
|
d48adf87e6 | ||
|
|
0b7086f721 | ||
|
|
db79dcf23b | ||
|
|
c3231901f2 | ||
|
|
4ceeb096c4 | ||
|
|
61be9f118e | ||
|
|
4bf7f9496e | ||
|
|
1bed3f14c1 | ||
|
|
1047f6396b | ||
|
|
27b1407865 | ||
|
|
36a771f98c | ||
|
|
b40bb27cf2 | ||
|
|
d99a76c51e | ||
|
|
2f00261364 | ||
|
|
e8b5ff9ea3 | ||
|
|
2c68d64279 | ||
|
|
7eae79e001 | ||
|
|
8c4efe8d07 | ||
|
|
e88f4481f2 | ||
|
|
7087b65a74 | ||
|
|
bb04dc47e3 | ||
|
|
306b201a2d | ||
|
|
d23a110967 | ||
|
|
dc532e7975 | ||
|
|
3d92ad924f | ||
|
|
6458380755 | ||
|
|
b0062217a2 | ||
|
|
f1ec2cd017 | ||
|
|
94320f8765 | ||
|
|
79c893df5a | ||
|
|
9445f86b9d |
10
INSTALL.md
10
INSTALL.md
@@ -79,14 +79,8 @@ go get k8s.io/client-go@v0.20.4
|
||||
### Go modules disabled
|
||||
|
||||
If you get a message like `cannot use path@version syntax in GOPATH mode`,
|
||||
you likely do not have go modules enabled.
|
||||
|
||||
Dependency management tools are built into go 1.11+ in the form of
|
||||
[go modules](https://github.com/golang/go/wiki/Modules).
|
||||
These are used by the main Kubernetes repo (>= `v1.15.0`) and
|
||||
`client-go` (>= `kubernetes-1.15.0`) to manage dependencies.
|
||||
If you are using go 1.11 or 1.12 and are working with a project located within `$GOPATH`,
|
||||
you must opt into using go modules:
|
||||
you likely do not have go modules enabled. This should be on by default in all
|
||||
supported versions of Go.
|
||||
|
||||
```sh
|
||||
export GO111MODULE=on
|
||||
|
||||
50
README.md
50
README.md
@@ -75,14 +75,14 @@ We will backport bugfixes--but not new features--into older versions of
|
||||
|
||||
#### Compatibility matrix
|
||||
|
||||
| | Kubernetes 1.15 | Kubernetes 1.16 | Kubernetes 1.17 | Kubernetes 1.18 | Kubernetes 1.19 | Kubernetes 1.20 |
|
||||
|-------------------------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|
|
||||
| `kubernetes-1.15.0` | ✓ | +- | +- | +- | +- | +- |
|
||||
| `kubernetes-1.16.0` | +- | ✓ | +- | +- | +- | +- |
|
||||
| `kubernetes-1.17.0`/`v0.17.0` | +- | +- | ✓ | +- | +- | +- |
|
||||
| `kubernetes-1.18.0`/`v0.18.0` | +- | +- | +- | ✓ | +- | +- |
|
||||
| `kubernetes-1.19.0`/`v0.19.0` | +- | +- | +- | +- | ✓ | +- |
|
||||
| `kubernetes-1.20.0`/`v0.20.0` | +- | +- | +- | +- | +- | ✓ |
|
||||
| | Kubernetes 1.23 | Kubernetes 1.24 | Kubernetes 1.25 | Kubernetes 1.26 | Kubernetes 1.27 | Kubernetes 1.28 |
|
||||
| ----------------------------- | --------------- | --------------- | --------------- | --------------- | --------------- | --------------- |
|
||||
| `kubernetes-1.23.0`/`v0.23.0` | ✓ | +- | +- | +- | +- | +- |
|
||||
| `kubernetes-1.24.0`/`v0.24.0` | +- | ✓ | +- | +- | +- | +- |
|
||||
| `kubernetes-1.25.0`/`v0.25.0` | +- | +- | ✓ | +- | +- | +- |
|
||||
| `kubernetes-1.26.0`/`v0.26.0` | +- | +- | +- | ✓ | +- | +- |
|
||||
| `kubernetes-1.27.0`/`v0.27.0` | +- | +- | +- | +- | ✓ | +- |
|
||||
| `kubernetes-1.28.0`/`v0.28.0` | +- | +- | +- | +- | +- | ✓ |
|
||||
| `HEAD` | +- | +- | +- | +- | +- | +- |
|
||||
|
||||
Key:
|
||||
@@ -102,27 +102,19 @@ Key:
|
||||
See the [CHANGELOG](./CHANGELOG.md) for a detailed description of changes
|
||||
between client-go versions.
|
||||
|
||||
| Branch | Canonical source code location | Maintenance status |
|
||||
|----------------|--------------------------------------|-------------------------------|
|
||||
| `release-1.4` | Kubernetes main repo, 1.4 branch | = - |
|
||||
| `release-1.5` | Kubernetes main repo, 1.5 branch | = - |
|
||||
| `release-2.0` | Kubernetes main repo, 1.5 branch | = - |
|
||||
| `release-3.0` | Kubernetes main repo, 1.6 branch | = - |
|
||||
| `release-4.0` | Kubernetes main repo, 1.7 branch | = - |
|
||||
| `release-5.0` | Kubernetes main repo, 1.8 branch | = - |
|
||||
| `release-6.0` | Kubernetes main repo, 1.9 branch | = - |
|
||||
| `release-7.0` | Kubernetes main repo, 1.10 branch | = - |
|
||||
| `release-8.0` | Kubernetes main repo, 1.11 branch | =- |
|
||||
| `release-9.0` | Kubernetes main repo, 1.12 branch | =- |
|
||||
| `release-10.0` | Kubernetes main repo, 1.13 branch | =- |
|
||||
| `release-11.0` | Kubernetes main repo, 1.14 branch | =- |
|
||||
| `release-12.0` | Kubernetes main repo, 1.15 branch | =- |
|
||||
| `release-13.0` | Kubernetes main repo, 1.16 branch | =- |
|
||||
| `release-14.0` | Kubernetes main repo, 1.17 branch | ✓ |
|
||||
| `release-1.18` | Kubernetes main repo, 1.18 branch | ✓ |
|
||||
| `release-1.19` | Kubernetes main repo, 1.19 branch | ✓ |
|
||||
| `release-1.20` | Kubernetes main repo, 1.20 branch | ✓ |
|
||||
| client-go HEAD | Kubernetes main repo, master branch | ✓ |
|
||||
| Branch | Canonical source code location | Maintenance status |
|
||||
| -------------- | ----------------------------------- | ------------------ |
|
||||
| `release-1.19` | Kubernetes main repo, 1.19 branch | =- |
|
||||
| `release-1.20` | Kubernetes main repo, 1.20 branch | =- |
|
||||
| `release-1.21` | Kubernetes main repo, 1.21 branch | =- |
|
||||
| `release-1.22` | Kubernetes main repo, 1.22 branch | =- |
|
||||
| `release-1.23` | Kubernetes main repo, 1.23 branch | =- |
|
||||
| `release-1.24` | Kubernetes main repo, 1.24 branch | =- |
|
||||
| `release-1.25` | Kubernetes main repo, 1.25 branch | ✓ |
|
||||
| `release-1.26` | Kubernetes main repo, 1.26 branch | ✓ |
|
||||
| `release-1.27` | Kubernetes main repo, 1.27 branch | ✓ |
|
||||
| `release-1.28` | Kubernetes main repo, 1.28 branch | ✓ |
|
||||
| client-go HEAD | Kubernetes main repo, master branch | ✓ |
|
||||
|
||||
Key:
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// AuditAnnotationApplyConfiguration represents an declarative configuration of the AuditAnnotation type for use
|
||||
// with apply.
|
||||
type AuditAnnotationApplyConfiguration struct {
|
||||
Key *string `json:"key,omitempty"`
|
||||
ValueExpression *string `json:"valueExpression,omitempty"`
|
||||
}
|
||||
|
||||
// AuditAnnotationApplyConfiguration constructs an declarative configuration of the AuditAnnotation type for use with
|
||||
// apply.
|
||||
func AuditAnnotation() *AuditAnnotationApplyConfiguration {
|
||||
return &AuditAnnotationApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithKey sets the Key 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 Key field is set to the value of the last call.
|
||||
func (b *AuditAnnotationApplyConfiguration) WithKey(value string) *AuditAnnotationApplyConfiguration {
|
||||
b.Key = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithValueExpression sets the ValueExpression 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 ValueExpression field is set to the value of the last call.
|
||||
func (b *AuditAnnotationApplyConfiguration) WithValueExpression(value string) *AuditAnnotationApplyConfiguration {
|
||||
b.ValueExpression = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// ExpressionWarningApplyConfiguration represents an declarative configuration of the ExpressionWarning type for use
|
||||
// with apply.
|
||||
type ExpressionWarningApplyConfiguration struct {
|
||||
FieldRef *string `json:"fieldRef,omitempty"`
|
||||
Warning *string `json:"warning,omitempty"`
|
||||
}
|
||||
|
||||
// ExpressionWarningApplyConfiguration constructs an declarative configuration of the ExpressionWarning type for use with
|
||||
// apply.
|
||||
func ExpressionWarning() *ExpressionWarningApplyConfiguration {
|
||||
return &ExpressionWarningApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithFieldRef sets the FieldRef 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 FieldRef field is set to the value of the last call.
|
||||
func (b *ExpressionWarningApplyConfiguration) WithFieldRef(value string) *ExpressionWarningApplyConfiguration {
|
||||
b.FieldRef = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithWarning sets the Warning 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 Warning field is set to the value of the last call.
|
||||
func (b *ExpressionWarningApplyConfiguration) WithWarning(value string) *ExpressionWarningApplyConfiguration {
|
||||
b.Warning = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
apiadmissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// MatchResourcesApplyConfiguration represents an declarative configuration of the MatchResources type for use
|
||||
// with apply.
|
||||
type MatchResourcesApplyConfiguration struct {
|
||||
NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"`
|
||||
ObjectSelector *v1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"`
|
||||
ResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"resourceRules,omitempty"`
|
||||
ExcludeResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"excludeResourceRules,omitempty"`
|
||||
MatchPolicy *apiadmissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty"`
|
||||
}
|
||||
|
||||
// MatchResourcesApplyConfiguration constructs an declarative configuration of the MatchResources type for use with
|
||||
// apply.
|
||||
func MatchResources() *MatchResourcesApplyConfiguration {
|
||||
return &MatchResourcesApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithNamespaceSelector sets the NamespaceSelector 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 NamespaceSelector field is set to the value of the last call.
|
||||
func (b *MatchResourcesApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration {
|
||||
b.NamespaceSelector = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithObjectSelector sets the ObjectSelector 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 ObjectSelector field is set to the value of the last call.
|
||||
func (b *MatchResourcesApplyConfiguration) WithObjectSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration {
|
||||
b.ObjectSelector = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceRules adds the given value to the ResourceRules 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 ResourceRules field.
|
||||
func (b *MatchResourcesApplyConfiguration) WithResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithResourceRules")
|
||||
}
|
||||
b.ResourceRules = append(b.ResourceRules, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithExcludeResourceRules adds the given value to the ExcludeResourceRules 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 ExcludeResourceRules field.
|
||||
func (b *MatchResourcesApplyConfiguration) WithExcludeResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithExcludeResourceRules")
|
||||
}
|
||||
b.ExcludeResourceRules = append(b.ExcludeResourceRules, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMatchPolicy sets the MatchPolicy 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 MatchPolicy field is set to the value of the last call.
|
||||
func (b *MatchResourcesApplyConfiguration) WithMatchPolicy(value apiadmissionregistrationv1.MatchPolicyType) *MatchResourcesApplyConfiguration {
|
||||
b.MatchPolicy = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||
)
|
||||
|
||||
// NamedRuleWithOperationsApplyConfiguration represents an declarative configuration of the NamedRuleWithOperations type for use
|
||||
// with apply.
|
||||
type NamedRuleWithOperationsApplyConfiguration struct {
|
||||
ResourceNames []string `json:"resourceNames,omitempty"`
|
||||
RuleWithOperationsApplyConfiguration `json:",inline"`
|
||||
}
|
||||
|
||||
// NamedRuleWithOperationsApplyConfiguration constructs an declarative configuration of the NamedRuleWithOperations type for use with
|
||||
// apply.
|
||||
func NamedRuleWithOperations() *NamedRuleWithOperationsApplyConfiguration {
|
||||
return &NamedRuleWithOperationsApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithResourceNames adds the given value to the ResourceNames 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 ResourceNames field.
|
||||
func (b *NamedRuleWithOperationsApplyConfiguration) WithResourceNames(values ...string) *NamedRuleWithOperationsApplyConfiguration {
|
||||
for i := range values {
|
||||
b.ResourceNames = append(b.ResourceNames, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithOperations adds the given value to the Operations 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 Operations field.
|
||||
func (b *NamedRuleWithOperationsApplyConfiguration) WithOperations(values ...admissionregistrationv1.OperationType) *NamedRuleWithOperationsApplyConfiguration {
|
||||
for i := range values {
|
||||
b.Operations = append(b.Operations, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAPIGroups adds the given value to the APIGroups 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 APIGroups field.
|
||||
func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIGroups(values ...string) *NamedRuleWithOperationsApplyConfiguration {
|
||||
for i := range values {
|
||||
b.APIGroups = append(b.APIGroups, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAPIVersions adds the given value to the APIVersions 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 APIVersions field.
|
||||
func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIVersions(values ...string) *NamedRuleWithOperationsApplyConfiguration {
|
||||
for i := range values {
|
||||
b.APIVersions = append(b.APIVersions, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResources adds the given value to the Resources 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 Resources field.
|
||||
func (b *NamedRuleWithOperationsApplyConfiguration) WithResources(values ...string) *NamedRuleWithOperationsApplyConfiguration {
|
||||
for i := range values {
|
||||
b.Resources = append(b.Resources, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithScope sets the Scope 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 Scope field is set to the value of the last call.
|
||||
func (b *NamedRuleWithOperationsApplyConfiguration) WithScope(value admissionregistrationv1.ScopeType) *NamedRuleWithOperationsApplyConfiguration {
|
||||
b.Scope = &value
|
||||
return b
|
||||
}
|
||||
48
applyconfigurations/admissionregistration/v1/paramkind.go
Normal file
48
applyconfigurations/admissionregistration/v1/paramkind.go
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// ParamKindApplyConfiguration represents an declarative configuration of the ParamKind type for use
|
||||
// with apply.
|
||||
type ParamKindApplyConfiguration struct {
|
||||
APIVersion *string `json:"apiVersion,omitempty"`
|
||||
Kind *string `json:"kind,omitempty"`
|
||||
}
|
||||
|
||||
// ParamKindApplyConfiguration constructs an declarative configuration of the ParamKind type for use with
|
||||
// apply.
|
||||
func ParamKind() *ParamKindApplyConfiguration {
|
||||
return &ParamKindApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
|
||||
func (b *ParamKindApplyConfiguration) WithAPIVersion(value string) *ParamKindApplyConfiguration {
|
||||
b.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
|
||||
func (b *ParamKindApplyConfiguration) WithKind(value string) *ParamKindApplyConfiguration {
|
||||
b.Kind = &value
|
||||
return b
|
||||
}
|
||||
71
applyconfigurations/admissionregistration/v1/paramref.go
Normal file
71
applyconfigurations/admissionregistration/v1/paramref.go
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// ParamRefApplyConfiguration represents an declarative configuration of the ParamRef type for use
|
||||
// with apply.
|
||||
type ParamRefApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Namespace *string `json:"namespace,omitempty"`
|
||||
Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"`
|
||||
ParameterNotFoundAction *admissionregistrationv1.ParameterNotFoundActionType `json:"parameterNotFoundAction,omitempty"`
|
||||
}
|
||||
|
||||
// ParamRefApplyConfiguration constructs an declarative configuration of the ParamRef type for use with
|
||||
// apply.
|
||||
func ParamRef() *ParamRefApplyConfiguration {
|
||||
return &ParamRefApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithName sets the Name 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 Name field is set to the value of the last call.
|
||||
func (b *ParamRefApplyConfiguration) WithName(value string) *ParamRefApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
|
||||
func (b *ParamRefApplyConfiguration) WithNamespace(value string) *ParamRefApplyConfiguration {
|
||||
b.Namespace = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithSelector sets the Selector 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 Selector field is set to the value of the last call.
|
||||
func (b *ParamRefApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ParamRefApplyConfiguration {
|
||||
b.Selector = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithParameterNotFoundAction sets the ParameterNotFoundAction 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 ParameterNotFoundAction field is set to the value of the last call.
|
||||
func (b *ParamRefApplyConfiguration) WithParameterNotFoundAction(value admissionregistrationv1.ParameterNotFoundActionType) *ParamRefApplyConfiguration {
|
||||
b.ParameterNotFoundAction = &value
|
||||
return b
|
||||
}
|
||||
44
applyconfigurations/admissionregistration/v1/typechecking.go
Normal file
44
applyconfigurations/admissionregistration/v1/typechecking.go
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// TypeCheckingApplyConfiguration represents an declarative configuration of the TypeChecking type for use
|
||||
// with apply.
|
||||
type TypeCheckingApplyConfiguration struct {
|
||||
ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"`
|
||||
}
|
||||
|
||||
// TypeCheckingApplyConfiguration constructs an declarative configuration of the TypeChecking type for use with
|
||||
// apply.
|
||||
func TypeChecking() *TypeCheckingApplyConfiguration {
|
||||
return &TypeCheckingApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithExpressionWarnings adds the given value to the ExpressionWarnings 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 ExpressionWarnings field.
|
||||
func (b *TypeCheckingApplyConfiguration) WithExpressionWarnings(values ...*ExpressionWarningApplyConfiguration) *TypeCheckingApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithExpressionWarnings")
|
||||
}
|
||||
b.ExpressionWarnings = append(b.ExpressionWarnings, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
apiadmissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
internal "k8s.io/client-go/applyconfigurations/internal"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// ValidatingAdmissionPolicyApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicy type for use
|
||||
// with apply.
|
||||
type ValidatingAdmissionPolicyApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"`
|
||||
Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// ValidatingAdmissionPolicy constructs an declarative configuration of the ValidatingAdmissionPolicy type for use with
|
||||
// apply.
|
||||
func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b := &ValidatingAdmissionPolicyApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("ValidatingAdmissionPolicy")
|
||||
b.WithAPIVersion("admissionregistration.k8s.io/v1")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractValidatingAdmissionPolicy extracts the applied configuration owned by fieldManager from
|
||||
// validatingAdmissionPolicy. If no managedFields are found in validatingAdmissionPolicy for fieldManager, a
|
||||
// ValidatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable),
|
||||
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
|
||||
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
|
||||
// the fieldManager never owned fields any fields.
|
||||
// validatingAdmissionPolicy must be a unmodified ValidatingAdmissionPolicy API object that was retrieved from the Kubernetes API.
|
||||
// ExtractValidatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
// Experimental!
|
||||
func ExtractValidatingAdmissionPolicy(validatingAdmissionPolicy *apiadmissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
|
||||
return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractValidatingAdmissionPolicyStatus is the same as ExtractValidatingAdmissionPolicy except
|
||||
// that it extracts the status subresource applied configuration.
|
||||
// Experimental!
|
||||
func ExtractValidatingAdmissionPolicyStatus(validatingAdmissionPolicy *apiadmissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
|
||||
return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "status")
|
||||
}
|
||||
|
||||
func extractValidatingAdmissionPolicy(validatingAdmissionPolicy *apiadmissionregistrationv1.ValidatingAdmissionPolicy, fieldManager string, subresource string) (*ValidatingAdmissionPolicyApplyConfiguration, error) {
|
||||
b := &ValidatingAdmissionPolicyApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(validatingAdmissionPolicy, internal.Parser().Type("io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicy"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(validatingAdmissionPolicy.Name)
|
||||
|
||||
b.WithKind("ValidatingAdmissionPolicy")
|
||||
b.WithAPIVersion("admissionregistration.k8s.io/v1")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.Kind = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithName sets the Name 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 Name field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.GenerateName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Namespace = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUID sets the UID 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 UID field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.UID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ResourceVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.CreationTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionGracePeriodSeconds = &value
|
||||
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 *ValidatingAdmissionPolicyApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
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
|
||||
}
|
||||
|
||||
// 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 *ValidatingAdmissionPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
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
|
||||
}
|
||||
|
||||
// WithOwnerReferences adds the given value to the OwnerReferences 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 OwnerReferences field.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithOwnerReferences")
|
||||
}
|
||||
b.OwnerReferences = append(b.OwnerReferences, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFinalizers adds the given value to the Finalizers 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 Finalizers field.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.Finalizers = append(b.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
if b.ObjectMetaApplyConfiguration == nil {
|
||||
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
// WithSpec sets the Spec 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 Spec field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicySpecApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStatus sets the Status 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 Status field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyApplyConfiguration) WithStatus(value *ValidatingAdmissionPolicyStatusApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration {
|
||||
b.Status = value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
apiadmissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
internal "k8s.io/client-go/applyconfigurations/internal"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// ValidatingAdmissionPolicyBindingApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyBinding type for use
|
||||
// with apply.
|
||||
type ValidatingAdmissionPolicyBindingApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// ValidatingAdmissionPolicyBinding constructs an declarative configuration of the ValidatingAdmissionPolicyBinding type for use with
|
||||
// apply.
|
||||
func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b := &ValidatingAdmissionPolicyBindingApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("ValidatingAdmissionPolicyBinding")
|
||||
b.WithAPIVersion("admissionregistration.k8s.io/v1")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractValidatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from
|
||||
// validatingAdmissionPolicyBinding. If no managedFields are found in validatingAdmissionPolicyBinding for fieldManager, a
|
||||
// ValidatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable),
|
||||
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
|
||||
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
|
||||
// the fieldManager never owned fields any fields.
|
||||
// validatingAdmissionPolicyBinding must be a unmodified ValidatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API.
|
||||
// ExtractValidatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
// Experimental!
|
||||
func ExtractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
|
||||
return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractValidatingAdmissionPolicyBindingStatus is the same as ExtractValidatingAdmissionPolicyBinding except
|
||||
// that it extracts the status subresource applied configuration.
|
||||
// Experimental!
|
||||
func ExtractValidatingAdmissionPolicyBindingStatus(validatingAdmissionPolicyBinding *apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
|
||||
return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "status")
|
||||
}
|
||||
|
||||
func extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *apiadmissionregistrationv1.ValidatingAdmissionPolicyBinding, fieldManager string, subresource string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) {
|
||||
b := &ValidatingAdmissionPolicyBindingApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(validatingAdmissionPolicyBinding, internal.Parser().Type("io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyBinding"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(validatingAdmissionPolicyBinding.Name)
|
||||
|
||||
b.WithKind("ValidatingAdmissionPolicyBinding")
|
||||
b.WithAPIVersion("admissionregistration.k8s.io/v1")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.Kind = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithName sets the Name 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 Name field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.GenerateName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Namespace = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUID sets the UID 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 UID field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.UID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ResourceVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.CreationTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionGracePeriodSeconds = &value
|
||||
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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
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
|
||||
}
|
||||
|
||||
// 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 *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
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
|
||||
}
|
||||
|
||||
// WithOwnerReferences adds the given value to the OwnerReferences 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 OwnerReferences field.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithOwnerReferences")
|
||||
}
|
||||
b.OwnerReferences = append(b.OwnerReferences, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFinalizers adds the given value to the Finalizers 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 Finalizers field.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.Finalizers = append(b.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
if b.ObjectMetaApplyConfiguration == nil {
|
||||
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
// WithSpec sets the Spec 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 Spec field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||
)
|
||||
|
||||
// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use
|
||||
// with apply.
|
||||
type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct {
|
||||
PolicyName *string `json:"policyName,omitempty"`
|
||||
ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"`
|
||||
MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"`
|
||||
ValidationActions []admissionregistrationv1.ValidationAction `json:"validationActions,omitempty"`
|
||||
}
|
||||
|
||||
// ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with
|
||||
// apply.
|
||||
func ValidatingAdmissionPolicyBindingSpec() *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
|
||||
return &ValidatingAdmissionPolicyBindingSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithPolicyName sets the PolicyName 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 PolicyName field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithPolicyName(value string) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
|
||||
b.PolicyName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithParamRef sets the ParamRef 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 ParamRef field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithParamRef(value *ParamRefApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
|
||||
b.ParamRef = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMatchResources sets the MatchResources 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 MatchResources field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithMatchResources(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
|
||||
b.MatchResources = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithValidationActions adds the given value to the ValidationActions 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 ValidationActions field.
|
||||
func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithValidationActions(values ...admissionregistrationv1.ValidationAction) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration {
|
||||
for i := range values {
|
||||
b.ValidationActions = append(b.ValidationActions, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||
)
|
||||
|
||||
// ValidatingAdmissionPolicySpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicySpec type for use
|
||||
// with apply.
|
||||
type ValidatingAdmissionPolicySpecApplyConfiguration struct {
|
||||
ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"`
|
||||
MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"`
|
||||
Validations []ValidationApplyConfiguration `json:"validations,omitempty"`
|
||||
FailurePolicy *admissionregistrationv1.FailurePolicyType `json:"failurePolicy,omitempty"`
|
||||
AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"`
|
||||
MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"`
|
||||
Variables []VariableApplyConfiguration `json:"variables,omitempty"`
|
||||
}
|
||||
|
||||
// ValidatingAdmissionPolicySpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicySpec type for use with
|
||||
// apply.
|
||||
func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration {
|
||||
return &ValidatingAdmissionPolicySpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithParamKind sets the ParamKind 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 ParamKind field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithParamKind(value *ParamKindApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
|
||||
b.ParamKind = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMatchConstraints sets the MatchConstraints 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 MatchConstraints field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConstraints(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
|
||||
b.MatchConstraints = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithValidations adds the given value to the Validations 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 Validations field.
|
||||
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithValidations(values ...*ValidationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithValidations")
|
||||
}
|
||||
b.Validations = append(b.Validations, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFailurePolicy sets the FailurePolicy 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 FailurePolicy field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(value admissionregistrationv1.FailurePolicyType) *ValidatingAdmissionPolicySpecApplyConfiguration {
|
||||
b.FailurePolicy = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAuditAnnotations adds the given value to the AuditAnnotations 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 AuditAnnotations field.
|
||||
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithAuditAnnotations(values ...*AuditAnnotationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithAuditAnnotations")
|
||||
}
|
||||
b.AuditAnnotations = append(b.AuditAnnotations, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMatchConditions adds the given value to the MatchConditions 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 MatchConditions field.
|
||||
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithMatchConditions")
|
||||
}
|
||||
b.MatchConditions = append(b.MatchConditions, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVariables adds the given value to the Variables 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 Variables field.
|
||||
func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithVariables(values ...*VariableApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithVariables")
|
||||
}
|
||||
b.Variables = append(b.Variables, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// ValidatingAdmissionPolicyStatusApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyStatus type for use
|
||||
// with apply.
|
||||
type ValidatingAdmissionPolicyStatusApplyConfiguration struct {
|
||||
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
|
||||
TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"`
|
||||
Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
// ValidatingAdmissionPolicyStatusApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicyStatus type for use with
|
||||
// apply.
|
||||
func ValidatingAdmissionPolicyStatus() *ValidatingAdmissionPolicyStatusApplyConfiguration {
|
||||
return &ValidatingAdmissionPolicyStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithObservedGeneration sets the ObservedGeneration 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 ObservedGeneration field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithObservedGeneration(value int64) *ValidatingAdmissionPolicyStatusApplyConfiguration {
|
||||
b.ObservedGeneration = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithTypeChecking sets the TypeChecking 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 TypeChecking field is set to the value of the last call.
|
||||
func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithTypeChecking(value *TypeCheckingApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration {
|
||||
b.TypeChecking = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithConditions adds the given value to the Conditions 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 Conditions field.
|
||||
func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConditions")
|
||||
}
|
||||
b.Conditions = append(b.Conditions, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
70
applyconfigurations/admissionregistration/v1/validation.go
Normal file
70
applyconfigurations/admissionregistration/v1/validation.go
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// ValidationApplyConfiguration represents an declarative configuration of the Validation type for use
|
||||
// with apply.
|
||||
type ValidationApplyConfiguration struct {
|
||||
Expression *string `json:"expression,omitempty"`
|
||||
Message *string `json:"message,omitempty"`
|
||||
Reason *v1.StatusReason `json:"reason,omitempty"`
|
||||
MessageExpression *string `json:"messageExpression,omitempty"`
|
||||
}
|
||||
|
||||
// ValidationApplyConfiguration constructs an declarative configuration of the Validation type for use with
|
||||
// apply.
|
||||
func Validation() *ValidationApplyConfiguration {
|
||||
return &ValidationApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithExpression sets the Expression 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 Expression field is set to the value of the last call.
|
||||
func (b *ValidationApplyConfiguration) WithExpression(value string) *ValidationApplyConfiguration {
|
||||
b.Expression = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMessage sets the Message 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 Message field is set to the value of the last call.
|
||||
func (b *ValidationApplyConfiguration) WithMessage(value string) *ValidationApplyConfiguration {
|
||||
b.Message = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithReason sets the Reason 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 Reason field is set to the value of the last call.
|
||||
func (b *ValidationApplyConfiguration) WithReason(value v1.StatusReason) *ValidationApplyConfiguration {
|
||||
b.Reason = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMessageExpression sets the MessageExpression 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 MessageExpression field is set to the value of the last call.
|
||||
func (b *ValidationApplyConfiguration) WithMessageExpression(value string) *ValidationApplyConfiguration {
|
||||
b.MessageExpression = &value
|
||||
return b
|
||||
}
|
||||
48
applyconfigurations/admissionregistration/v1/variable.go
Normal file
48
applyconfigurations/admissionregistration/v1/variable.go
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// VariableApplyConfiguration represents an declarative configuration of the Variable type for use
|
||||
// with apply.
|
||||
type VariableApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Expression *string `json:"expression,omitempty"`
|
||||
}
|
||||
|
||||
// VariableApplyConfiguration constructs an declarative configuration of the Variable type for use with
|
||||
// apply.
|
||||
func Variable() *VariableApplyConfiguration {
|
||||
return &VariableApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithName sets the Name 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 Name field is set to the value of the last call.
|
||||
func (b *VariableApplyConfiguration) WithName(value string) *VariableApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithExpression sets the Expression 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 Expression field is set to the value of the last call.
|
||||
func (b *VariableApplyConfiguration) WithExpression(value string) *VariableApplyConfiguration {
|
||||
b.Expression = &value
|
||||
return b
|
||||
}
|
||||
@@ -31,6 +31,7 @@ type JobSpecApplyConfiguration struct {
|
||||
Completions *int32 `json:"completions,omitempty"`
|
||||
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
|
||||
PodFailurePolicy *PodFailurePolicyApplyConfiguration `json:"podFailurePolicy,omitempty"`
|
||||
SuccessPolicy *SuccessPolicyApplyConfiguration `json:"successPolicy,omitempty"`
|
||||
BackoffLimit *int32 `json:"backoffLimit,omitempty"`
|
||||
BackoffLimitPerIndex *int32 `json:"backoffLimitPerIndex,omitempty"`
|
||||
MaxFailedIndexes *int32 `json:"maxFailedIndexes,omitempty"`
|
||||
@@ -41,6 +42,7 @@ type JobSpecApplyConfiguration struct {
|
||||
CompletionMode *batchv1.CompletionMode `json:"completionMode,omitempty"`
|
||||
Suspend *bool `json:"suspend,omitempty"`
|
||||
PodReplacementPolicy *batchv1.PodReplacementPolicy `json:"podReplacementPolicy,omitempty"`
|
||||
ManagedBy *string `json:"managedBy,omitempty"`
|
||||
}
|
||||
|
||||
// JobSpecApplyConfiguration constructs an declarative configuration of the JobSpec type for use with
|
||||
@@ -81,6 +83,14 @@ func (b *JobSpecApplyConfiguration) WithPodFailurePolicy(value *PodFailurePolicy
|
||||
return b
|
||||
}
|
||||
|
||||
// WithSuccessPolicy sets the SuccessPolicy 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 SuccessPolicy field is set to the value of the last call.
|
||||
func (b *JobSpecApplyConfiguration) WithSuccessPolicy(value *SuccessPolicyApplyConfiguration) *JobSpecApplyConfiguration {
|
||||
b.SuccessPolicy = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithBackoffLimit sets the BackoffLimit 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 BackoffLimit field is set to the value of the last call.
|
||||
@@ -160,3 +170,11 @@ func (b *JobSpecApplyConfiguration) WithPodReplacementPolicy(value batchv1.PodRe
|
||||
b.PodReplacementPolicy = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithManagedBy sets the ManagedBy 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 ManagedBy field is set to the value of the last call.
|
||||
func (b *JobSpecApplyConfiguration) WithManagedBy(value string) *JobSpecApplyConfiguration {
|
||||
b.ManagedBy = &value
|
||||
return b
|
||||
}
|
||||
|
||||
44
applyconfigurations/batch/v1/successpolicy.go
Normal file
44
applyconfigurations/batch/v1/successpolicy.go
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// SuccessPolicyApplyConfiguration represents an declarative configuration of the SuccessPolicy type for use
|
||||
// with apply.
|
||||
type SuccessPolicyApplyConfiguration struct {
|
||||
Rules []SuccessPolicyRuleApplyConfiguration `json:"rules,omitempty"`
|
||||
}
|
||||
|
||||
// SuccessPolicyApplyConfiguration constructs an declarative configuration of the SuccessPolicy type for use with
|
||||
// apply.
|
||||
func SuccessPolicy() *SuccessPolicyApplyConfiguration {
|
||||
return &SuccessPolicyApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithRules adds the given value to the Rules 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 Rules field.
|
||||
func (b *SuccessPolicyApplyConfiguration) WithRules(values ...*SuccessPolicyRuleApplyConfiguration) *SuccessPolicyApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithRules")
|
||||
}
|
||||
b.Rules = append(b.Rules, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
48
applyconfigurations/batch/v1/successpolicyrule.go
Normal file
48
applyconfigurations/batch/v1/successpolicyrule.go
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// SuccessPolicyRuleApplyConfiguration represents an declarative configuration of the SuccessPolicyRule type for use
|
||||
// with apply.
|
||||
type SuccessPolicyRuleApplyConfiguration struct {
|
||||
SucceededIndexes *string `json:"succeededIndexes,omitempty"`
|
||||
SucceededCount *int32 `json:"succeededCount,omitempty"`
|
||||
}
|
||||
|
||||
// SuccessPolicyRuleApplyConfiguration constructs an declarative configuration of the SuccessPolicyRule type for use with
|
||||
// apply.
|
||||
func SuccessPolicyRule() *SuccessPolicyRuleApplyConfiguration {
|
||||
return &SuccessPolicyRuleApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithSucceededIndexes sets the SucceededIndexes 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 SucceededIndexes field is set to the value of the last call.
|
||||
func (b *SuccessPolicyRuleApplyConfiguration) WithSucceededIndexes(value string) *SuccessPolicyRuleApplyConfiguration {
|
||||
b.SucceededIndexes = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithSucceededCount sets the SucceededCount 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 SucceededCount field is set to the value of the last call.
|
||||
func (b *SuccessPolicyRuleApplyConfiguration) WithSucceededCount(value int32) *SuccessPolicyRuleApplyConfiguration {
|
||||
b.SucceededCount = &value
|
||||
return b
|
||||
}
|
||||
52
applyconfigurations/core/v1/apparmorprofile.go
Normal file
52
applyconfigurations/core/v1/apparmorprofile.go
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
// AppArmorProfileApplyConfiguration represents an declarative configuration of the AppArmorProfile type for use
|
||||
// with apply.
|
||||
type AppArmorProfileApplyConfiguration struct {
|
||||
Type *v1.AppArmorProfileType `json:"type,omitempty"`
|
||||
LocalhostProfile *string `json:"localhostProfile,omitempty"`
|
||||
}
|
||||
|
||||
// AppArmorProfileApplyConfiguration constructs an declarative configuration of the AppArmorProfile type for use with
|
||||
// apply.
|
||||
func AppArmorProfile() *AppArmorProfileApplyConfiguration {
|
||||
return &AppArmorProfileApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithType sets the Type 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 Type field is set to the value of the last call.
|
||||
func (b *AppArmorProfileApplyConfiguration) WithType(value v1.AppArmorProfileType) *AppArmorProfileApplyConfiguration {
|
||||
b.Type = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithLocalhostProfile sets the LocalhostProfile 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 LocalhostProfile field is set to the value of the last call.
|
||||
func (b *AppArmorProfileApplyConfiguration) WithLocalhostProfile(value string) *AppArmorProfileApplyConfiguration {
|
||||
b.LocalhostProfile = &value
|
||||
return b
|
||||
}
|
||||
@@ -36,6 +36,8 @@ type ContainerStatusApplyConfiguration struct {
|
||||
Started *bool `json:"started,omitempty"`
|
||||
AllocatedResources *corev1.ResourceList `json:"allocatedResources,omitempty"`
|
||||
Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"`
|
||||
VolumeMounts []VolumeMountStatusApplyConfiguration `json:"volumeMounts,omitempty"`
|
||||
User *ContainerUserApplyConfiguration `json:"user,omitempty"`
|
||||
}
|
||||
|
||||
// ContainerStatusApplyConfiguration constructs an declarative configuration of the ContainerStatus type for use with
|
||||
@@ -131,3 +133,24 @@ func (b *ContainerStatusApplyConfiguration) WithResources(value *ResourceRequire
|
||||
b.Resources = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVolumeMounts adds the given value to the VolumeMounts 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 VolumeMounts field.
|
||||
func (b *ContainerStatusApplyConfiguration) WithVolumeMounts(values ...*VolumeMountStatusApplyConfiguration) *ContainerStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithVolumeMounts")
|
||||
}
|
||||
b.VolumeMounts = append(b.VolumeMounts, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUser sets the User 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 User field is set to the value of the last call.
|
||||
func (b *ContainerStatusApplyConfiguration) WithUser(value *ContainerUserApplyConfiguration) *ContainerStatusApplyConfiguration {
|
||||
b.User = value
|
||||
return b
|
||||
}
|
||||
|
||||
39
applyconfigurations/core/v1/containeruser.go
Normal file
39
applyconfigurations/core/v1/containeruser.go
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// ContainerUserApplyConfiguration represents an declarative configuration of the ContainerUser type for use
|
||||
// with apply.
|
||||
type ContainerUserApplyConfiguration struct {
|
||||
Linux *LinuxContainerUserApplyConfiguration `json:"linux,omitempty"`
|
||||
}
|
||||
|
||||
// ContainerUserApplyConfiguration constructs an declarative configuration of the ContainerUser type for use with
|
||||
// apply.
|
||||
func ContainerUser() *ContainerUserApplyConfiguration {
|
||||
return &ContainerUserApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithLinux sets the Linux 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 Linux field is set to the value of the last call.
|
||||
func (b *ContainerUserApplyConfiguration) WithLinux(value *LinuxContainerUserApplyConfiguration) *ContainerUserApplyConfiguration {
|
||||
b.Linux = value
|
||||
return b
|
||||
}
|
||||
59
applyconfigurations/core/v1/linuxcontaineruser.go
Normal file
59
applyconfigurations/core/v1/linuxcontaineruser.go
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// LinuxContainerUserApplyConfiguration represents an declarative configuration of the LinuxContainerUser type for use
|
||||
// with apply.
|
||||
type LinuxContainerUserApplyConfiguration struct {
|
||||
UID *int64 `json:"uid,omitempty"`
|
||||
GID *int64 `json:"gid,omitempty"`
|
||||
SupplementalGroups []int64 `json:"supplementalGroups,omitempty"`
|
||||
}
|
||||
|
||||
// LinuxContainerUserApplyConfiguration constructs an declarative configuration of the LinuxContainerUser type for use with
|
||||
// apply.
|
||||
func LinuxContainerUser() *LinuxContainerUserApplyConfiguration {
|
||||
return &LinuxContainerUserApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithUID sets the UID 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 UID field is set to the value of the last call.
|
||||
func (b *LinuxContainerUserApplyConfiguration) WithUID(value int64) *LinuxContainerUserApplyConfiguration {
|
||||
b.UID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGID sets the GID 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 GID field is set to the value of the last call.
|
||||
func (b *LinuxContainerUserApplyConfiguration) WithGID(value int64) *LinuxContainerUserApplyConfiguration {
|
||||
b.GID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithSupplementalGroups adds the given value to the SupplementalGroups 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 SupplementalGroups field.
|
||||
func (b *LinuxContainerUserApplyConfiguration) WithSupplementalGroups(values ...int64) *LinuxContainerUserApplyConfiguration {
|
||||
for i := range values {
|
||||
b.SupplementalGroups = append(b.SupplementalGroups, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
48
applyconfigurations/core/v1/noderuntimehandler.go
Normal file
48
applyconfigurations/core/v1/noderuntimehandler.go
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// NodeRuntimeHandlerApplyConfiguration represents an declarative configuration of the NodeRuntimeHandler type for use
|
||||
// with apply.
|
||||
type NodeRuntimeHandlerApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Features *NodeRuntimeHandlerFeaturesApplyConfiguration `json:"features,omitempty"`
|
||||
}
|
||||
|
||||
// NodeRuntimeHandlerApplyConfiguration constructs an declarative configuration of the NodeRuntimeHandler type for use with
|
||||
// apply.
|
||||
func NodeRuntimeHandler() *NodeRuntimeHandlerApplyConfiguration {
|
||||
return &NodeRuntimeHandlerApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithName sets the Name 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 Name field is set to the value of the last call.
|
||||
func (b *NodeRuntimeHandlerApplyConfiguration) WithName(value string) *NodeRuntimeHandlerApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFeatures sets the Features 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 Features field is set to the value of the last call.
|
||||
func (b *NodeRuntimeHandlerApplyConfiguration) WithFeatures(value *NodeRuntimeHandlerFeaturesApplyConfiguration) *NodeRuntimeHandlerApplyConfiguration {
|
||||
b.Features = value
|
||||
return b
|
||||
}
|
||||
39
applyconfigurations/core/v1/noderuntimehandlerfeatures.go
Normal file
39
applyconfigurations/core/v1/noderuntimehandlerfeatures.go
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// NodeRuntimeHandlerFeaturesApplyConfiguration represents an declarative configuration of the NodeRuntimeHandlerFeatures type for use
|
||||
// with apply.
|
||||
type NodeRuntimeHandlerFeaturesApplyConfiguration struct {
|
||||
RecursiveReadOnlyMounts *bool `json:"recursiveReadOnlyMounts,omitempty"`
|
||||
}
|
||||
|
||||
// NodeRuntimeHandlerFeaturesApplyConfiguration constructs an declarative configuration of the NodeRuntimeHandlerFeatures type for use with
|
||||
// apply.
|
||||
func NodeRuntimeHandlerFeatures() *NodeRuntimeHandlerFeaturesApplyConfiguration {
|
||||
return &NodeRuntimeHandlerFeaturesApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithRecursiveReadOnlyMounts sets the RecursiveReadOnlyMounts 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 RecursiveReadOnlyMounts field is set to the value of the last call.
|
||||
func (b *NodeRuntimeHandlerFeaturesApplyConfiguration) WithRecursiveReadOnlyMounts(value bool) *NodeRuntimeHandlerFeaturesApplyConfiguration {
|
||||
b.RecursiveReadOnlyMounts = &value
|
||||
return b
|
||||
}
|
||||
@@ -36,6 +36,7 @@ type NodeStatusApplyConfiguration struct {
|
||||
VolumesInUse []v1.UniqueVolumeName `json:"volumesInUse,omitempty"`
|
||||
VolumesAttached []AttachedVolumeApplyConfiguration `json:"volumesAttached,omitempty"`
|
||||
Config *NodeConfigStatusApplyConfiguration `json:"config,omitempty"`
|
||||
RuntimeHandlers []NodeRuntimeHandlerApplyConfiguration `json:"runtimeHandlers,omitempty"`
|
||||
}
|
||||
|
||||
// NodeStatusApplyConfiguration constructs an declarative configuration of the NodeStatus type for use with
|
||||
@@ -153,3 +154,16 @@ func (b *NodeStatusApplyConfiguration) WithConfig(value *NodeConfigStatusApplyCo
|
||||
b.Config = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithRuntimeHandlers adds the given value to the RuntimeHandlers 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 RuntimeHandlers field.
|
||||
func (b *NodeStatusApplyConfiguration) WithRuntimeHandlers(values ...*NodeRuntimeHandlerApplyConfiguration) *NodeStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithRuntimeHandlers")
|
||||
}
|
||||
b.RuntimeHandlers = append(b.RuntimeHandlers, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -25,16 +25,18 @@ import (
|
||||
// PodSecurityContextApplyConfiguration represents an declarative configuration of the PodSecurityContext type for use
|
||||
// with apply.
|
||||
type PodSecurityContextApplyConfiguration struct {
|
||||
SELinuxOptions *SELinuxOptionsApplyConfiguration `json:"seLinuxOptions,omitempty"`
|
||||
WindowsOptions *WindowsSecurityContextOptionsApplyConfiguration `json:"windowsOptions,omitempty"`
|
||||
RunAsUser *int64 `json:"runAsUser,omitempty"`
|
||||
RunAsGroup *int64 `json:"runAsGroup,omitempty"`
|
||||
RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"`
|
||||
SupplementalGroups []int64 `json:"supplementalGroups,omitempty"`
|
||||
FSGroup *int64 `json:"fsGroup,omitempty"`
|
||||
Sysctls []SysctlApplyConfiguration `json:"sysctls,omitempty"`
|
||||
FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"`
|
||||
SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"`
|
||||
SELinuxOptions *SELinuxOptionsApplyConfiguration `json:"seLinuxOptions,omitempty"`
|
||||
WindowsOptions *WindowsSecurityContextOptionsApplyConfiguration `json:"windowsOptions,omitempty"`
|
||||
RunAsUser *int64 `json:"runAsUser,omitempty"`
|
||||
RunAsGroup *int64 `json:"runAsGroup,omitempty"`
|
||||
RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"`
|
||||
SupplementalGroups []int64 `json:"supplementalGroups,omitempty"`
|
||||
SupplementalGroupsPolicy *corev1.SupplementalGroupsPolicy `json:"supplementalGroupsPolicy,omitempty"`
|
||||
FSGroup *int64 `json:"fsGroup,omitempty"`
|
||||
Sysctls []SysctlApplyConfiguration `json:"sysctls,omitempty"`
|
||||
FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"`
|
||||
SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"`
|
||||
AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"`
|
||||
}
|
||||
|
||||
// PodSecurityContextApplyConfiguration constructs an declarative configuration of the PodSecurityContext type for use with
|
||||
@@ -93,6 +95,14 @@ func (b *PodSecurityContextApplyConfiguration) WithSupplementalGroups(values ...
|
||||
return b
|
||||
}
|
||||
|
||||
// WithSupplementalGroupsPolicy sets the SupplementalGroupsPolicy 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 SupplementalGroupsPolicy field is set to the value of the last call.
|
||||
func (b *PodSecurityContextApplyConfiguration) WithSupplementalGroupsPolicy(value corev1.SupplementalGroupsPolicy) *PodSecurityContextApplyConfiguration {
|
||||
b.SupplementalGroupsPolicy = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFSGroup sets the FSGroup 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 FSGroup field is set to the value of the last call.
|
||||
@@ -129,3 +139,11 @@ func (b *PodSecurityContextApplyConfiguration) WithSeccompProfile(value *Seccomp
|
||||
b.SeccompProfile = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAppArmorProfile sets the AppArmorProfile 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 AppArmorProfile field is set to the value of the last call.
|
||||
func (b *PodSecurityContextApplyConfiguration) WithAppArmorProfile(value *AppArmorProfileApplyConfiguration) *PodSecurityContextApplyConfiguration {
|
||||
b.AppArmorProfile = value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ type SecurityContextApplyConfiguration struct {
|
||||
AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"`
|
||||
ProcMount *corev1.ProcMountType `json:"procMount,omitempty"`
|
||||
SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"`
|
||||
AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"`
|
||||
}
|
||||
|
||||
// SecurityContextApplyConfiguration constructs an declarative configuration of the SecurityContext type for use with
|
||||
@@ -131,3 +132,11 @@ func (b *SecurityContextApplyConfiguration) WithSeccompProfile(value *SeccompPro
|
||||
b.SeccompProfile = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAppArmorProfile sets the AppArmorProfile 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 AppArmorProfile field is set to the value of the last call.
|
||||
func (b *SecurityContextApplyConfiguration) WithAppArmorProfile(value *AppArmorProfileApplyConfiguration) *SecurityContextApplyConfiguration {
|
||||
b.AppArmorProfile = value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ type ServiceSpecApplyConfiguration struct {
|
||||
AllocateLoadBalancerNodePorts *bool `json:"allocateLoadBalancerNodePorts,omitempty"`
|
||||
LoadBalancerClass *string `json:"loadBalancerClass,omitempty"`
|
||||
InternalTrafficPolicy *corev1.ServiceInternalTrafficPolicy `json:"internalTrafficPolicy,omitempty"`
|
||||
TrafficDistribution *string `json:"trafficDistribution,omitempty"`
|
||||
}
|
||||
|
||||
// ServiceSpecApplyConfiguration constructs an declarative configuration of the ServiceSpec type for use with
|
||||
@@ -222,3 +223,11 @@ func (b *ServiceSpecApplyConfiguration) WithInternalTrafficPolicy(value corev1.S
|
||||
b.InternalTrafficPolicy = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithTrafficDistribution sets the TrafficDistribution 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 TrafficDistribution field is set to the value of the last call.
|
||||
func (b *ServiceSpecApplyConfiguration) WithTrafficDistribution(value string) *ServiceSpecApplyConfiguration {
|
||||
b.TrafficDistribution = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -25,12 +25,13 @@ import (
|
||||
// VolumeMountApplyConfiguration represents an declarative configuration of the VolumeMount type for use
|
||||
// with apply.
|
||||
type VolumeMountApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
MountPath *string `json:"mountPath,omitempty"`
|
||||
SubPath *string `json:"subPath,omitempty"`
|
||||
MountPropagation *v1.MountPropagationMode `json:"mountPropagation,omitempty"`
|
||||
SubPathExpr *string `json:"subPathExpr,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
RecursiveReadOnly *v1.RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty"`
|
||||
MountPath *string `json:"mountPath,omitempty"`
|
||||
SubPath *string `json:"subPath,omitempty"`
|
||||
MountPropagation *v1.MountPropagationMode `json:"mountPropagation,omitempty"`
|
||||
SubPathExpr *string `json:"subPathExpr,omitempty"`
|
||||
}
|
||||
|
||||
// VolumeMountApplyConfiguration constructs an declarative configuration of the VolumeMount type for use with
|
||||
@@ -55,6 +56,14 @@ func (b *VolumeMountApplyConfiguration) WithReadOnly(value bool) *VolumeMountApp
|
||||
return b
|
||||
}
|
||||
|
||||
// WithRecursiveReadOnly sets the RecursiveReadOnly 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 RecursiveReadOnly field is set to the value of the last call.
|
||||
func (b *VolumeMountApplyConfiguration) WithRecursiveReadOnly(value v1.RecursiveReadOnlyMode) *VolumeMountApplyConfiguration {
|
||||
b.RecursiveReadOnly = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMountPath sets the MountPath 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 MountPath field is set to the value of the last call.
|
||||
|
||||
70
applyconfigurations/core/v1/volumemountstatus.go
Normal file
70
applyconfigurations/core/v1/volumemountstatus.go
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
// VolumeMountStatusApplyConfiguration represents an declarative configuration of the VolumeMountStatus type for use
|
||||
// with apply.
|
||||
type VolumeMountStatusApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
MountPath *string `json:"mountPath,omitempty"`
|
||||
ReadOnly *bool `json:"readOnly,omitempty"`
|
||||
RecursiveReadOnly *v1.RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty"`
|
||||
}
|
||||
|
||||
// VolumeMountStatusApplyConfiguration constructs an declarative configuration of the VolumeMountStatus type for use with
|
||||
// apply.
|
||||
func VolumeMountStatus() *VolumeMountStatusApplyConfiguration {
|
||||
return &VolumeMountStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithName sets the Name 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 Name field is set to the value of the last call.
|
||||
func (b *VolumeMountStatusApplyConfiguration) WithName(value string) *VolumeMountStatusApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMountPath sets the MountPath 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 MountPath field is set to the value of the last call.
|
||||
func (b *VolumeMountStatusApplyConfiguration) WithMountPath(value string) *VolumeMountStatusApplyConfiguration {
|
||||
b.MountPath = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithReadOnly sets the ReadOnly 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 ReadOnly field is set to the value of the last call.
|
||||
func (b *VolumeMountStatusApplyConfiguration) WithReadOnly(value bool) *VolumeMountStatusApplyConfiguration {
|
||||
b.ReadOnly = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithRecursiveReadOnly sets the RecursiveReadOnly 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 RecursiveReadOnly field is set to the value of the last call.
|
||||
func (b *VolumeMountStatusApplyConfiguration) WithRecursiveReadOnly(value v1.RecursiveReadOnlyMode) *VolumeMountStatusApplyConfiguration {
|
||||
b.RecursiveReadOnly = &value
|
||||
return b
|
||||
}
|
||||
@@ -39,6 +39,28 @@ func Parser() *typed.Parser {
|
||||
var parserOnce sync.Once
|
||||
var parser *typed.Parser
|
||||
var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: io.k8s.api.admissionregistration.v1.AuditAnnotation
|
||||
map:
|
||||
fields:
|
||||
- name: key
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: valueExpression
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.admissionregistration.v1.ExpressionWarning
|
||||
map:
|
||||
fields:
|
||||
- name: fieldRef
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: warning
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.admissionregistration.v1.MatchCondition
|
||||
map:
|
||||
fields:
|
||||
@@ -50,6 +72,31 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.admissionregistration.v1.MatchResources
|
||||
map:
|
||||
fields:
|
||||
- name: excludeResourceRules
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.admissionregistration.v1.NamedRuleWithOperations
|
||||
elementRelationship: atomic
|
||||
- name: matchPolicy
|
||||
type:
|
||||
scalar: string
|
||||
- name: namespaceSelector
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
|
||||
- name: objectSelector
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
|
||||
- name: resourceRules
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.admissionregistration.v1.NamedRuleWithOperations
|
||||
elementRelationship: atomic
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.admissionregistration.v1.MutatingWebhook
|
||||
map:
|
||||
fields:
|
||||
@@ -123,6 +170,69 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: io.k8s.api.admissionregistration.v1.NamedRuleWithOperations
|
||||
map:
|
||||
fields:
|
||||
- name: apiGroups
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: apiVersions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: operations
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: resourceNames
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: resources
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: scope
|
||||
type:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.admissionregistration.v1.ParamKind
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.admissionregistration.v1.ParamRef
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
- name: namespace
|
||||
type:
|
||||
scalar: string
|
||||
- name: parameterNotFoundAction
|
||||
type:
|
||||
scalar: string
|
||||
- name: selector
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.admissionregistration.v1.RuleWithOperations
|
||||
map:
|
||||
fields:
|
||||
@@ -170,6 +280,128 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: port
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: io.k8s.api.admissionregistration.v1.TypeChecking
|
||||
map:
|
||||
fields:
|
||||
- name: expressionWarnings
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.admissionregistration.v1.ExpressionWarning
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicy
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
- name: metadata
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
|
||||
default: {}
|
||||
- name: spec
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicySpec
|
||||
default: {}
|
||||
- name: status
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyStatus
|
||||
default: {}
|
||||
- name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyBinding
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
- name: metadata
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
|
||||
default: {}
|
||||
- name: spec
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyBindingSpec
|
||||
default: {}
|
||||
- name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyBindingSpec
|
||||
map:
|
||||
fields:
|
||||
- name: matchResources
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.MatchResources
|
||||
- name: paramRef
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.ParamRef
|
||||
- name: policyName
|
||||
type:
|
||||
scalar: string
|
||||
- name: validationActions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: associative
|
||||
- name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicySpec
|
||||
map:
|
||||
fields:
|
||||
- name: auditAnnotations
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.admissionregistration.v1.AuditAnnotation
|
||||
elementRelationship: atomic
|
||||
- name: failurePolicy
|
||||
type:
|
||||
scalar: string
|
||||
- name: matchConditions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.admissionregistration.v1.MatchCondition
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: matchConstraints
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.MatchResources
|
||||
- name: paramKind
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.ParamKind
|
||||
- name: validations
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.admissionregistration.v1.Validation
|
||||
elementRelationship: atomic
|
||||
- name: variables
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.admissionregistration.v1.Variable
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: io.k8s.api.admissionregistration.v1.ValidatingAdmissionPolicyStatus
|
||||
map:
|
||||
fields:
|
||||
- name: conditions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- type
|
||||
- name: observedGeneration
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: typeChecking
|
||||
type:
|
||||
namedType: io.k8s.api.admissionregistration.v1.TypeChecking
|
||||
- name: io.k8s.api.admissionregistration.v1.ValidatingWebhook
|
||||
map:
|
||||
fields:
|
||||
@@ -240,6 +472,34 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: io.k8s.api.admissionregistration.v1.Validation
|
||||
map:
|
||||
fields:
|
||||
- name: expression
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: message
|
||||
type:
|
||||
scalar: string
|
||||
- name: messageExpression
|
||||
type:
|
||||
scalar: string
|
||||
- name: reason
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.admissionregistration.v1.Variable
|
||||
map:
|
||||
fields:
|
||||
- name: expression
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.admissionregistration.v1.WebhookClientConfig
|
||||
map:
|
||||
fields:
|
||||
@@ -3599,6 +3859,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: completions
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: managedBy
|
||||
type:
|
||||
scalar: string
|
||||
- name: manualSelector
|
||||
type:
|
||||
scalar: boolean
|
||||
@@ -3617,6 +3880,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: selector
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector
|
||||
- name: successPolicy
|
||||
type:
|
||||
namedType: io.k8s.api.batch.v1.SuccessPolicy
|
||||
- name: suspend
|
||||
type:
|
||||
scalar: boolean
|
||||
@@ -3729,6 +3995,24 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementType:
|
||||
namedType: io.k8s.api.batch.v1.PodFailurePolicyOnPodConditionsPattern
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.batch.v1.SuccessPolicy
|
||||
map:
|
||||
fields:
|
||||
- name: rules
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.batch.v1.SuccessPolicyRule
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.batch.v1.SuccessPolicyRule
|
||||
map:
|
||||
fields:
|
||||
- name: succeededCount
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: succeededIndexes
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.batch.v1.UncountedTerminatedPods
|
||||
map:
|
||||
fields:
|
||||
@@ -4138,6 +4422,21 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: podAntiAffinity
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.PodAntiAffinity
|
||||
- name: io.k8s.api.core.v1.AppArmorProfile
|
||||
map:
|
||||
fields:
|
||||
- name: localhostProfile
|
||||
type:
|
||||
scalar: string
|
||||
- name: type
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
unions:
|
||||
- discriminator: type
|
||||
fields:
|
||||
- fieldName: localhostProfile
|
||||
discriminatorValue: LocalhostProfile
|
||||
- name: io.k8s.api.core.v1.AttachedVolume
|
||||
map:
|
||||
fields:
|
||||
@@ -4460,6 +4759,7 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: optional
|
||||
type:
|
||||
scalar: boolean
|
||||
@@ -4473,6 +4773,7 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: optional
|
||||
type:
|
||||
scalar: boolean
|
||||
@@ -4510,6 +4811,7 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: optional
|
||||
type:
|
||||
scalar: boolean
|
||||
@@ -4528,6 +4830,7 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: optional
|
||||
type:
|
||||
scalar: boolean
|
||||
@@ -4781,6 +5084,23 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.ContainerState
|
||||
default: {}
|
||||
- name: user
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.ContainerUser
|
||||
- name: volumeMounts
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.core.v1.VolumeMountStatus
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- mountPath
|
||||
- name: io.k8s.api.core.v1.ContainerUser
|
||||
map:
|
||||
fields:
|
||||
- name: linux
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.LinuxContainerUser
|
||||
- name: io.k8s.api.core.v1.DaemonEndpoint
|
||||
map:
|
||||
fields:
|
||||
@@ -5343,6 +5663,7 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: ip
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.core.v1.HostIP
|
||||
map:
|
||||
fields:
|
||||
@@ -5539,6 +5860,23 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementType:
|
||||
namedType: io.k8s.api.core.v1.LimitRangeItem
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.core.v1.LinuxContainerUser
|
||||
map:
|
||||
fields:
|
||||
- name: gid
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: supplementalGroups
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: numeric
|
||||
elementRelationship: atomic
|
||||
- name: uid
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: io.k8s.api.core.v1.LoadBalancerIngress
|
||||
map:
|
||||
fields:
|
||||
@@ -5572,6 +5910,7 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.core.v1.LocalVolumeSource
|
||||
map:
|
||||
@@ -5766,6 +6105,22 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.DaemonEndpoint
|
||||
default: {}
|
||||
- name: io.k8s.api.core.v1.NodeRuntimeHandler
|
||||
map:
|
||||
fields:
|
||||
- name: features
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.NodeRuntimeHandlerFeatures
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.core.v1.NodeRuntimeHandlerFeatures
|
||||
map:
|
||||
fields:
|
||||
- name: recursiveReadOnlyMounts
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: io.k8s.api.core.v1.NodeSelector
|
||||
map:
|
||||
fields:
|
||||
@@ -5888,6 +6243,12 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: phase
|
||||
type:
|
||||
scalar: string
|
||||
- name: runtimeHandlers
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.core.v1.NodeRuntimeHandler
|
||||
elementRelationship: atomic
|
||||
- name: volumesAttached
|
||||
type:
|
||||
list:
|
||||
@@ -6457,6 +6818,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: io.k8s.api.core.v1.PodSecurityContext
|
||||
map:
|
||||
fields:
|
||||
- name: appArmorProfile
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.AppArmorProfile
|
||||
- name: fsGroup
|
||||
type:
|
||||
scalar: numeric
|
||||
@@ -6484,6 +6848,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementType:
|
||||
scalar: numeric
|
||||
elementRelationship: atomic
|
||||
- name: supplementalGroupsPolicy
|
||||
type:
|
||||
scalar: string
|
||||
- name: sysctls
|
||||
type:
|
||||
list:
|
||||
@@ -7285,6 +7652,7 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: optional
|
||||
type:
|
||||
scalar: boolean
|
||||
@@ -7298,6 +7666,7 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: optional
|
||||
type:
|
||||
scalar: boolean
|
||||
@@ -7314,6 +7683,7 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: optional
|
||||
type:
|
||||
scalar: boolean
|
||||
@@ -7351,6 +7721,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: allowPrivilegeEscalation
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: appArmorProfile
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.AppArmorProfile
|
||||
- name: capabilities
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.Capabilities
|
||||
@@ -7546,6 +7919,9 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: sessionAffinityConfig
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.SessionAffinityConfig
|
||||
- name: trafficDistribution
|
||||
type:
|
||||
scalar: string
|
||||
- name: type
|
||||
type:
|
||||
scalar: string
|
||||
@@ -7878,12 +8254,32 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: readOnly
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: recursiveReadOnly
|
||||
type:
|
||||
scalar: string
|
||||
- name: subPath
|
||||
type:
|
||||
scalar: string
|
||||
- name: subPathExpr
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.core.v1.VolumeMountStatus
|
||||
map:
|
||||
fields:
|
||||
- name: mountPath
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: readOnly
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: recursiveReadOnly
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.core.v1.VolumeNodeAffinity
|
||||
map:
|
||||
fields:
|
||||
@@ -11658,6 +12054,119 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: shareable
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: io.k8s.api.resource.v1alpha2.DriverAllocationResult
|
||||
map:
|
||||
fields:
|
||||
- name: namedResources
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha2.NamedResourcesAllocationResult
|
||||
- name: vendorRequestParameters
|
||||
type:
|
||||
namedType: __untyped_atomic_
|
||||
- name: io.k8s.api.resource.v1alpha2.DriverRequests
|
||||
map:
|
||||
fields:
|
||||
- name: driverName
|
||||
type:
|
||||
scalar: string
|
||||
- name: requests
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1alpha2.ResourceRequest
|
||||
elementRelationship: atomic
|
||||
- name: vendorParameters
|
||||
type:
|
||||
namedType: __untyped_atomic_
|
||||
- name: io.k8s.api.resource.v1alpha2.NamedResourcesAllocationResult
|
||||
map:
|
||||
fields:
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.resource.v1alpha2.NamedResourcesAttribute
|
||||
map:
|
||||
fields:
|
||||
- name: bool
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: int
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: intSlice
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha2.NamedResourcesIntSlice
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: quantity
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
|
||||
- name: string
|
||||
type:
|
||||
scalar: string
|
||||
- name: stringSlice
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha2.NamedResourcesStringSlice
|
||||
- name: version
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1alpha2.NamedResourcesFilter
|
||||
map:
|
||||
fields:
|
||||
- name: selector
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.resource.v1alpha2.NamedResourcesInstance
|
||||
map:
|
||||
fields:
|
||||
- name: attributes
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1alpha2.NamedResourcesAttribute
|
||||
elementRelationship: atomic
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.resource.v1alpha2.NamedResourcesIntSlice
|
||||
map:
|
||||
fields:
|
||||
- name: ints
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: numeric
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1alpha2.NamedResourcesRequest
|
||||
map:
|
||||
fields:
|
||||
- name: selector
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.resource.v1alpha2.NamedResourcesResources
|
||||
map:
|
||||
fields:
|
||||
- name: instances
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1alpha2.NamedResourcesInstance
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1alpha2.NamedResourcesStringSlice
|
||||
map:
|
||||
fields:
|
||||
- name: strings
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1alpha2.PodSchedulingContext
|
||||
map:
|
||||
fields:
|
||||
@@ -11741,6 +12250,31 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.resource.v1alpha2.ResourceClaimParameters
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: driverRequests
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1alpha2.DriverRequests
|
||||
elementRelationship: atomic
|
||||
- name: generatedFrom
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
- name: metadata
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
|
||||
default: {}
|
||||
- name: shareable
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference
|
||||
map:
|
||||
fields:
|
||||
@@ -11848,9 +12382,40 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: parametersRef
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha2.ResourceClassParametersReference
|
||||
- name: structuredParameters
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: suitableNodes
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.NodeSelector
|
||||
- name: io.k8s.api.resource.v1alpha2.ResourceClassParameters
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: filters
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1alpha2.ResourceFilter
|
||||
elementRelationship: atomic
|
||||
- name: generatedFrom
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha2.ResourceClassParametersReference
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
- name: metadata
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
|
||||
default: {}
|
||||
- name: vendorParameters
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1alpha2.VendorParameters
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1alpha2.ResourceClassParametersReference
|
||||
map:
|
||||
fields:
|
||||
@@ -11868,6 +12433,15 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: namespace
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1alpha2.ResourceFilter
|
||||
map:
|
||||
fields:
|
||||
- name: driverName
|
||||
type:
|
||||
scalar: string
|
||||
- name: namedResources
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha2.NamedResourcesFilter
|
||||
- name: io.k8s.api.resource.v1alpha2.ResourceHandle
|
||||
map:
|
||||
fields:
|
||||
@@ -11877,6 +12451,69 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: driverName
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: structuredData
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha2.StructuredResourceHandle
|
||||
- name: io.k8s.api.resource.v1alpha2.ResourceRequest
|
||||
map:
|
||||
fields:
|
||||
- name: namedResources
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha2.NamedResourcesRequest
|
||||
- name: vendorParameters
|
||||
type:
|
||||
namedType: __untyped_atomic_
|
||||
- name: io.k8s.api.resource.v1alpha2.ResourceSlice
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: driverName
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
- name: metadata
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
|
||||
default: {}
|
||||
- name: namedResources
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha2.NamedResourcesResources
|
||||
- name: nodeName
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1alpha2.StructuredResourceHandle
|
||||
map:
|
||||
fields:
|
||||
- name: nodeName
|
||||
type:
|
||||
scalar: string
|
||||
- name: results
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1alpha2.DriverAllocationResult
|
||||
elementRelationship: atomic
|
||||
- name: vendorClaimParameters
|
||||
type:
|
||||
namedType: __untyped_atomic_
|
||||
- name: vendorClassParameters
|
||||
type:
|
||||
namedType: __untyped_atomic_
|
||||
- name: io.k8s.api.resource.v1alpha2.VendorParameters
|
||||
map:
|
||||
fields:
|
||||
- name: driverName
|
||||
type:
|
||||
scalar: string
|
||||
- name: parameters
|
||||
type:
|
||||
namedType: __untyped_atomic_
|
||||
- name: io.k8s.api.scheduling.v1.PriorityClass
|
||||
map:
|
||||
fields:
|
||||
@@ -12585,6 +13222,83 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: count
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: io.k8s.api.storagemigration.v1alpha1.GroupVersionResource
|
||||
map:
|
||||
fields:
|
||||
- name: group
|
||||
type:
|
||||
scalar: string
|
||||
- name: resource
|
||||
type:
|
||||
scalar: string
|
||||
- name: version
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.storagemigration.v1alpha1.MigrationCondition
|
||||
map:
|
||||
fields:
|
||||
- name: lastUpdateTime
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time
|
||||
- name: message
|
||||
type:
|
||||
scalar: string
|
||||
- name: reason
|
||||
type:
|
||||
scalar: string
|
||||
- name: status
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: type
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigration
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
- name: metadata
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
|
||||
default: {}
|
||||
- name: spec
|
||||
type:
|
||||
namedType: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigrationSpec
|
||||
default: {}
|
||||
- name: status
|
||||
type:
|
||||
namedType: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigrationStatus
|
||||
default: {}
|
||||
- name: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigrationSpec
|
||||
map:
|
||||
fields:
|
||||
- name: continueToken
|
||||
type:
|
||||
scalar: string
|
||||
- name: resource
|
||||
type:
|
||||
namedType: io.k8s.api.storagemigration.v1alpha1.GroupVersionResource
|
||||
default: {}
|
||||
- name: io.k8s.api.storagemigration.v1alpha1.StorageVersionMigrationStatus
|
||||
map:
|
||||
fields:
|
||||
- name: conditions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.storagemigration.v1alpha1.MigrationCondition
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- type
|
||||
- name: resourceVersion
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.apimachinery.pkg.api.resource.Quantity
|
||||
scalar: untyped
|
||||
- name: io.k8s.apimachinery.pkg.apis.meta.v1.Condition
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
// AllocationResultModelApplyConfiguration represents an declarative configuration of the AllocationResultModel type for use
|
||||
// with apply.
|
||||
type AllocationResultModelApplyConfiguration struct {
|
||||
NamedResources *NamedResourcesAllocationResultApplyConfiguration `json:"namedResources,omitempty"`
|
||||
}
|
||||
|
||||
// AllocationResultModelApplyConfiguration constructs an declarative configuration of the AllocationResultModel type for use with
|
||||
// apply.
|
||||
func AllocationResultModel() *AllocationResultModelApplyConfiguration {
|
||||
return &AllocationResultModelApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call.
|
||||
func (b *AllocationResultModelApplyConfiguration) WithNamedResources(value *NamedResourcesAllocationResultApplyConfiguration) *AllocationResultModelApplyConfiguration {
|
||||
b.NamedResources = value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DriverAllocationResultApplyConfiguration represents an declarative configuration of the DriverAllocationResult type for use
|
||||
// with apply.
|
||||
type DriverAllocationResultApplyConfiguration struct {
|
||||
VendorRequestParameters *runtime.RawExtension `json:"vendorRequestParameters,omitempty"`
|
||||
AllocationResultModelApplyConfiguration `json:",inline"`
|
||||
}
|
||||
|
||||
// DriverAllocationResultApplyConfiguration constructs an declarative configuration of the DriverAllocationResult type for use with
|
||||
// apply.
|
||||
func DriverAllocationResult() *DriverAllocationResultApplyConfiguration {
|
||||
return &DriverAllocationResultApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithVendorRequestParameters sets the VendorRequestParameters 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 VendorRequestParameters field is set to the value of the last call.
|
||||
func (b *DriverAllocationResultApplyConfiguration) WithVendorRequestParameters(value runtime.RawExtension) *DriverAllocationResultApplyConfiguration {
|
||||
b.VendorRequestParameters = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call.
|
||||
func (b *DriverAllocationResultApplyConfiguration) WithNamedResources(value *NamedResourcesAllocationResultApplyConfiguration) *DriverAllocationResultApplyConfiguration {
|
||||
b.NamedResources = value
|
||||
return b
|
||||
}
|
||||
66
applyconfigurations/resource/v1alpha2/driverrequests.go
Normal file
66
applyconfigurations/resource/v1alpha2/driverrequests.go
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DriverRequestsApplyConfiguration represents an declarative configuration of the DriverRequests type for use
|
||||
// with apply.
|
||||
type DriverRequestsApplyConfiguration struct {
|
||||
DriverName *string `json:"driverName,omitempty"`
|
||||
VendorParameters *runtime.RawExtension `json:"vendorParameters,omitempty"`
|
||||
Requests []ResourceRequestApplyConfiguration `json:"requests,omitempty"`
|
||||
}
|
||||
|
||||
// DriverRequestsApplyConfiguration constructs an declarative configuration of the DriverRequests type for use with
|
||||
// apply.
|
||||
func DriverRequests() *DriverRequestsApplyConfiguration {
|
||||
return &DriverRequestsApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithDriverName sets the DriverName 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 DriverName field is set to the value of the last call.
|
||||
func (b *DriverRequestsApplyConfiguration) WithDriverName(value string) *DriverRequestsApplyConfiguration {
|
||||
b.DriverName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVendorParameters sets the VendorParameters 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 VendorParameters field is set to the value of the last call.
|
||||
func (b *DriverRequestsApplyConfiguration) WithVendorParameters(value runtime.RawExtension) *DriverRequestsApplyConfiguration {
|
||||
b.VendorParameters = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithRequests adds the given value to the Requests 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 Requests field.
|
||||
func (b *DriverRequestsApplyConfiguration) WithRequests(values ...*ResourceRequestApplyConfiguration) *DriverRequestsApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithRequests")
|
||||
}
|
||||
b.Requests = append(b.Requests, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
// NamedResourcesAllocationResultApplyConfiguration represents an declarative configuration of the NamedResourcesAllocationResult type for use
|
||||
// with apply.
|
||||
type NamedResourcesAllocationResultApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// NamedResourcesAllocationResultApplyConfiguration constructs an declarative configuration of the NamedResourcesAllocationResult type for use with
|
||||
// apply.
|
||||
func NamedResourcesAllocationResult() *NamedResourcesAllocationResultApplyConfiguration {
|
||||
return &NamedResourcesAllocationResultApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithName sets the Name 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 Name field is set to the value of the last call.
|
||||
func (b *NamedResourcesAllocationResultApplyConfiguration) WithName(value string) *NamedResourcesAllocationResultApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
100
applyconfigurations/resource/v1alpha2/namedresourcesattribute.go
Normal file
100
applyconfigurations/resource/v1alpha2/namedresourcesattribute.go
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
)
|
||||
|
||||
// NamedResourcesAttributeApplyConfiguration represents an declarative configuration of the NamedResourcesAttribute type for use
|
||||
// with apply.
|
||||
type NamedResourcesAttributeApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
NamedResourcesAttributeValueApplyConfiguration `json:",inline"`
|
||||
}
|
||||
|
||||
// NamedResourcesAttributeApplyConfiguration constructs an declarative configuration of the NamedResourcesAttribute type for use with
|
||||
// apply.
|
||||
func NamedResourcesAttribute() *NamedResourcesAttributeApplyConfiguration {
|
||||
return &NamedResourcesAttributeApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithName sets the Name 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 Name field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeApplyConfiguration) WithName(value string) *NamedResourcesAttributeApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithQuantityValue sets the QuantityValue 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 QuantityValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeApplyConfiguration) WithQuantityValue(value resource.Quantity) *NamedResourcesAttributeApplyConfiguration {
|
||||
b.QuantityValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithBoolValue sets the BoolValue 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 BoolValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeApplyConfiguration) WithBoolValue(value bool) *NamedResourcesAttributeApplyConfiguration {
|
||||
b.BoolValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithIntValue sets the IntValue 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 IntValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeApplyConfiguration) WithIntValue(value int64) *NamedResourcesAttributeApplyConfiguration {
|
||||
b.IntValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithIntSliceValue sets the IntSliceValue 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 IntSliceValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeApplyConfiguration) WithIntSliceValue(value *NamedResourcesIntSliceApplyConfiguration) *NamedResourcesAttributeApplyConfiguration {
|
||||
b.IntSliceValue = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStringValue sets the StringValue 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 StringValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeApplyConfiguration) WithStringValue(value string) *NamedResourcesAttributeApplyConfiguration {
|
||||
b.StringValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStringSliceValue sets the StringSliceValue 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 StringSliceValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeApplyConfiguration) WithStringSliceValue(value *NamedResourcesStringSliceApplyConfiguration) *NamedResourcesAttributeApplyConfiguration {
|
||||
b.StringSliceValue = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVersionValue sets the VersionValue 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 VersionValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeApplyConfiguration) WithVersionValue(value string) *NamedResourcesAttributeApplyConfiguration {
|
||||
b.VersionValue = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
)
|
||||
|
||||
// NamedResourcesAttributeValueApplyConfiguration represents an declarative configuration of the NamedResourcesAttributeValue type for use
|
||||
// with apply.
|
||||
type NamedResourcesAttributeValueApplyConfiguration struct {
|
||||
QuantityValue *resource.Quantity `json:"quantity,omitempty"`
|
||||
BoolValue *bool `json:"bool,omitempty"`
|
||||
IntValue *int64 `json:"int,omitempty"`
|
||||
IntSliceValue *NamedResourcesIntSliceApplyConfiguration `json:"intSlice,omitempty"`
|
||||
StringValue *string `json:"string,omitempty"`
|
||||
StringSliceValue *NamedResourcesStringSliceApplyConfiguration `json:"stringSlice,omitempty"`
|
||||
VersionValue *string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// NamedResourcesAttributeValueApplyConfiguration constructs an declarative configuration of the NamedResourcesAttributeValue type for use with
|
||||
// apply.
|
||||
func NamedResourcesAttributeValue() *NamedResourcesAttributeValueApplyConfiguration {
|
||||
return &NamedResourcesAttributeValueApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithQuantityValue sets the QuantityValue 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 QuantityValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeValueApplyConfiguration) WithQuantityValue(value resource.Quantity) *NamedResourcesAttributeValueApplyConfiguration {
|
||||
b.QuantityValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithBoolValue sets the BoolValue 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 BoolValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeValueApplyConfiguration) WithBoolValue(value bool) *NamedResourcesAttributeValueApplyConfiguration {
|
||||
b.BoolValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithIntValue sets the IntValue 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 IntValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeValueApplyConfiguration) WithIntValue(value int64) *NamedResourcesAttributeValueApplyConfiguration {
|
||||
b.IntValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithIntSliceValue sets the IntSliceValue 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 IntSliceValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeValueApplyConfiguration) WithIntSliceValue(value *NamedResourcesIntSliceApplyConfiguration) *NamedResourcesAttributeValueApplyConfiguration {
|
||||
b.IntSliceValue = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStringValue sets the StringValue 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 StringValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeValueApplyConfiguration) WithStringValue(value string) *NamedResourcesAttributeValueApplyConfiguration {
|
||||
b.StringValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStringSliceValue sets the StringSliceValue 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 StringSliceValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeValueApplyConfiguration) WithStringSliceValue(value *NamedResourcesStringSliceApplyConfiguration) *NamedResourcesAttributeValueApplyConfiguration {
|
||||
b.StringSliceValue = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVersionValue sets the VersionValue 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 VersionValue field is set to the value of the last call.
|
||||
func (b *NamedResourcesAttributeValueApplyConfiguration) WithVersionValue(value string) *NamedResourcesAttributeValueApplyConfiguration {
|
||||
b.VersionValue = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
// NamedResourcesFilterApplyConfiguration represents an declarative configuration of the NamedResourcesFilter type for use
|
||||
// with apply.
|
||||
type NamedResourcesFilterApplyConfiguration struct {
|
||||
Selector *string `json:"selector,omitempty"`
|
||||
}
|
||||
|
||||
// NamedResourcesFilterApplyConfiguration constructs an declarative configuration of the NamedResourcesFilter type for use with
|
||||
// apply.
|
||||
func NamedResourcesFilter() *NamedResourcesFilterApplyConfiguration {
|
||||
return &NamedResourcesFilterApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithSelector sets the Selector 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 Selector field is set to the value of the last call.
|
||||
func (b *NamedResourcesFilterApplyConfiguration) WithSelector(value string) *NamedResourcesFilterApplyConfiguration {
|
||||
b.Selector = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
// NamedResourcesInstanceApplyConfiguration represents an declarative configuration of the NamedResourcesInstance type for use
|
||||
// with apply.
|
||||
type NamedResourcesInstanceApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Attributes []NamedResourcesAttributeApplyConfiguration `json:"attributes,omitempty"`
|
||||
}
|
||||
|
||||
// NamedResourcesInstanceApplyConfiguration constructs an declarative configuration of the NamedResourcesInstance type for use with
|
||||
// apply.
|
||||
func NamedResourcesInstance() *NamedResourcesInstanceApplyConfiguration {
|
||||
return &NamedResourcesInstanceApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithName sets the Name 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 Name field is set to the value of the last call.
|
||||
func (b *NamedResourcesInstanceApplyConfiguration) WithName(value string) *NamedResourcesInstanceApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAttributes adds the given value to the Attributes 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 Attributes field.
|
||||
func (b *NamedResourcesInstanceApplyConfiguration) WithAttributes(values ...*NamedResourcesAttributeApplyConfiguration) *NamedResourcesInstanceApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithAttributes")
|
||||
}
|
||||
b.Attributes = append(b.Attributes, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
// NamedResourcesIntSliceApplyConfiguration represents an declarative configuration of the NamedResourcesIntSlice type for use
|
||||
// with apply.
|
||||
type NamedResourcesIntSliceApplyConfiguration struct {
|
||||
Ints []int64 `json:"ints,omitempty"`
|
||||
}
|
||||
|
||||
// NamedResourcesIntSliceApplyConfiguration constructs an declarative configuration of the NamedResourcesIntSlice type for use with
|
||||
// apply.
|
||||
func NamedResourcesIntSlice() *NamedResourcesIntSliceApplyConfiguration {
|
||||
return &NamedResourcesIntSliceApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithInts adds the given value to the Ints 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 Ints field.
|
||||
func (b *NamedResourcesIntSliceApplyConfiguration) WithInts(values ...int64) *NamedResourcesIntSliceApplyConfiguration {
|
||||
for i := range values {
|
||||
b.Ints = append(b.Ints, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
// NamedResourcesRequestApplyConfiguration represents an declarative configuration of the NamedResourcesRequest type for use
|
||||
// with apply.
|
||||
type NamedResourcesRequestApplyConfiguration struct {
|
||||
Selector *string `json:"selector,omitempty"`
|
||||
}
|
||||
|
||||
// NamedResourcesRequestApplyConfiguration constructs an declarative configuration of the NamedResourcesRequest type for use with
|
||||
// apply.
|
||||
func NamedResourcesRequest() *NamedResourcesRequestApplyConfiguration {
|
||||
return &NamedResourcesRequestApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithSelector sets the Selector 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 Selector field is set to the value of the last call.
|
||||
func (b *NamedResourcesRequestApplyConfiguration) WithSelector(value string) *NamedResourcesRequestApplyConfiguration {
|
||||
b.Selector = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
// NamedResourcesResourcesApplyConfiguration represents an declarative configuration of the NamedResourcesResources type for use
|
||||
// with apply.
|
||||
type NamedResourcesResourcesApplyConfiguration struct {
|
||||
Instances []NamedResourcesInstanceApplyConfiguration `json:"instances,omitempty"`
|
||||
}
|
||||
|
||||
// NamedResourcesResourcesApplyConfiguration constructs an declarative configuration of the NamedResourcesResources type for use with
|
||||
// apply.
|
||||
func NamedResourcesResources() *NamedResourcesResourcesApplyConfiguration {
|
||||
return &NamedResourcesResourcesApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithInstances adds the given value to the Instances 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 Instances field.
|
||||
func (b *NamedResourcesResourcesApplyConfiguration) WithInstances(values ...*NamedResourcesInstanceApplyConfiguration) *NamedResourcesResourcesApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithInstances")
|
||||
}
|
||||
b.Instances = append(b.Instances, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
// NamedResourcesStringSliceApplyConfiguration represents an declarative configuration of the NamedResourcesStringSlice type for use
|
||||
// with apply.
|
||||
type NamedResourcesStringSliceApplyConfiguration struct {
|
||||
Strings []string `json:"strings,omitempty"`
|
||||
}
|
||||
|
||||
// NamedResourcesStringSliceApplyConfiguration constructs an declarative configuration of the NamedResourcesStringSlice type for use with
|
||||
// apply.
|
||||
func NamedResourcesStringSlice() *NamedResourcesStringSliceApplyConfiguration {
|
||||
return &NamedResourcesStringSliceApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithStrings adds the given value to the Strings 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 Strings field.
|
||||
func (b *NamedResourcesStringSliceApplyConfiguration) WithStrings(values ...string) *NamedResourcesStringSliceApplyConfiguration {
|
||||
for i := range values {
|
||||
b.Strings = append(b.Strings, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
272
applyconfigurations/resource/v1alpha2/resourceclaimparameters.go
Normal file
272
applyconfigurations/resource/v1alpha2/resourceclaimparameters.go
Normal file
@@ -0,0 +1,272 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
resourcev1alpha2 "k8s.io/api/resource/v1alpha2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
internal "k8s.io/client-go/applyconfigurations/internal"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// ResourceClaimParametersApplyConfiguration represents an declarative configuration of the ResourceClaimParameters type for use
|
||||
// with apply.
|
||||
type ResourceClaimParametersApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
GeneratedFrom *ResourceClaimParametersReferenceApplyConfiguration `json:"generatedFrom,omitempty"`
|
||||
Shareable *bool `json:"shareable,omitempty"`
|
||||
DriverRequests []DriverRequestsApplyConfiguration `json:"driverRequests,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceClaimParameters constructs an declarative configuration of the ResourceClaimParameters type for use with
|
||||
// apply.
|
||||
func ResourceClaimParameters(name, namespace string) *ResourceClaimParametersApplyConfiguration {
|
||||
b := &ResourceClaimParametersApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithNamespace(namespace)
|
||||
b.WithKind("ResourceClaimParameters")
|
||||
b.WithAPIVersion("resource.k8s.io/v1alpha2")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractResourceClaimParameters extracts the applied configuration owned by fieldManager from
|
||||
// resourceClaimParameters. If no managedFields are found in resourceClaimParameters for fieldManager, a
|
||||
// ResourceClaimParametersApplyConfiguration is returned with only the Name, Namespace (if applicable),
|
||||
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
|
||||
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
|
||||
// the fieldManager never owned fields any fields.
|
||||
// resourceClaimParameters must be a unmodified ResourceClaimParameters API object that was retrieved from the Kubernetes API.
|
||||
// ExtractResourceClaimParameters provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
// Experimental!
|
||||
func ExtractResourceClaimParameters(resourceClaimParameters *resourcev1alpha2.ResourceClaimParameters, fieldManager string) (*ResourceClaimParametersApplyConfiguration, error) {
|
||||
return extractResourceClaimParameters(resourceClaimParameters, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractResourceClaimParametersStatus is the same as ExtractResourceClaimParameters except
|
||||
// that it extracts the status subresource applied configuration.
|
||||
// Experimental!
|
||||
func ExtractResourceClaimParametersStatus(resourceClaimParameters *resourcev1alpha2.ResourceClaimParameters, fieldManager string) (*ResourceClaimParametersApplyConfiguration, error) {
|
||||
return extractResourceClaimParameters(resourceClaimParameters, fieldManager, "status")
|
||||
}
|
||||
|
||||
func extractResourceClaimParameters(resourceClaimParameters *resourcev1alpha2.ResourceClaimParameters, fieldManager string, subresource string) (*ResourceClaimParametersApplyConfiguration, error) {
|
||||
b := &ResourceClaimParametersApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(resourceClaimParameters, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceClaimParameters"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(resourceClaimParameters.Name)
|
||||
b.WithNamespace(resourceClaimParameters.Namespace)
|
||||
|
||||
b.WithKind("ResourceClaimParameters")
|
||||
b.WithAPIVersion("resource.k8s.io/v1alpha2")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithKind(value string) *ResourceClaimParametersApplyConfiguration {
|
||||
b.Kind = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithAPIVersion(value string) *ResourceClaimParametersApplyConfiguration {
|
||||
b.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithName sets the Name 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 Name field is set to the value of the last call.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithName(value string) *ResourceClaimParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithGenerateName(value string) *ResourceClaimParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.GenerateName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithNamespace(value string) *ResourceClaimParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Namespace = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUID sets the UID 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 UID field is set to the value of the last call.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithUID(value types.UID) *ResourceClaimParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.UID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithResourceVersion(value string) *ResourceClaimParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ResourceVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithGeneration(value int64) *ResourceClaimParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClaimParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.CreationTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClaimParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClaimParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionGracePeriodSeconds = &value
|
||||
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 *ResourceClaimParametersApplyConfiguration) WithLabels(entries map[string]string) *ResourceClaimParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
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
|
||||
}
|
||||
|
||||
// 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 *ResourceClaimParametersApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClaimParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
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
|
||||
}
|
||||
|
||||
// WithOwnerReferences adds the given value to the OwnerReferences 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 OwnerReferences field.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClaimParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithOwnerReferences")
|
||||
}
|
||||
b.OwnerReferences = append(b.OwnerReferences, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFinalizers adds the given value to the Finalizers 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 Finalizers field.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithFinalizers(values ...string) *ResourceClaimParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.Finalizers = append(b.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ResourceClaimParametersApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
if b.ObjectMetaApplyConfiguration == nil {
|
||||
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
// WithGeneratedFrom sets the GeneratedFrom 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 GeneratedFrom field is set to the value of the last call.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithGeneratedFrom(value *ResourceClaimParametersReferenceApplyConfiguration) *ResourceClaimParametersApplyConfiguration {
|
||||
b.GeneratedFrom = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithShareable sets the Shareable 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 Shareable field is set to the value of the last call.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithShareable(value bool) *ResourceClaimParametersApplyConfiguration {
|
||||
b.Shareable = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDriverRequests adds the given value to the DriverRequests 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 DriverRequests field.
|
||||
func (b *ResourceClaimParametersApplyConfiguration) WithDriverRequests(values ...*DriverRequestsApplyConfiguration) *ResourceClaimParametersApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithDriverRequests")
|
||||
}
|
||||
b.DriverRequests = append(b.DriverRequests, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -36,6 +36,7 @@ type ResourceClassApplyConfiguration struct {
|
||||
DriverName *string `json:"driverName,omitempty"`
|
||||
ParametersRef *ResourceClassParametersReferenceApplyConfiguration `json:"parametersRef,omitempty"`
|
||||
SuitableNodes *corev1.NodeSelectorApplyConfiguration `json:"suitableNodes,omitempty"`
|
||||
StructuredParameters *bool `json:"structuredParameters,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceClass constructs an declarative configuration of the ResourceClass type for use with
|
||||
@@ -264,3 +265,11 @@ func (b *ResourceClassApplyConfiguration) WithSuitableNodes(value *corev1.NodeSe
|
||||
b.SuitableNodes = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStructuredParameters sets the StructuredParameters 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 StructuredParameters field is set to the value of the last call.
|
||||
func (b *ResourceClassApplyConfiguration) WithStructuredParameters(value bool) *ResourceClassApplyConfiguration {
|
||||
b.StructuredParameters = &value
|
||||
return b
|
||||
}
|
||||
|
||||
277
applyconfigurations/resource/v1alpha2/resourceclassparameters.go
Normal file
277
applyconfigurations/resource/v1alpha2/resourceclassparameters.go
Normal file
@@ -0,0 +1,277 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
resourcev1alpha2 "k8s.io/api/resource/v1alpha2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
internal "k8s.io/client-go/applyconfigurations/internal"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// ResourceClassParametersApplyConfiguration represents an declarative configuration of the ResourceClassParameters type for use
|
||||
// with apply.
|
||||
type ResourceClassParametersApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
GeneratedFrom *ResourceClassParametersReferenceApplyConfiguration `json:"generatedFrom,omitempty"`
|
||||
VendorParameters []VendorParametersApplyConfiguration `json:"vendorParameters,omitempty"`
|
||||
Filters []ResourceFilterApplyConfiguration `json:"filters,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceClassParameters constructs an declarative configuration of the ResourceClassParameters type for use with
|
||||
// apply.
|
||||
func ResourceClassParameters(name, namespace string) *ResourceClassParametersApplyConfiguration {
|
||||
b := &ResourceClassParametersApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithNamespace(namespace)
|
||||
b.WithKind("ResourceClassParameters")
|
||||
b.WithAPIVersion("resource.k8s.io/v1alpha2")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractResourceClassParameters extracts the applied configuration owned by fieldManager from
|
||||
// resourceClassParameters. If no managedFields are found in resourceClassParameters for fieldManager, a
|
||||
// ResourceClassParametersApplyConfiguration is returned with only the Name, Namespace (if applicable),
|
||||
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
|
||||
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
|
||||
// the fieldManager never owned fields any fields.
|
||||
// resourceClassParameters must be a unmodified ResourceClassParameters API object that was retrieved from the Kubernetes API.
|
||||
// ExtractResourceClassParameters provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
// Experimental!
|
||||
func ExtractResourceClassParameters(resourceClassParameters *resourcev1alpha2.ResourceClassParameters, fieldManager string) (*ResourceClassParametersApplyConfiguration, error) {
|
||||
return extractResourceClassParameters(resourceClassParameters, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractResourceClassParametersStatus is the same as ExtractResourceClassParameters except
|
||||
// that it extracts the status subresource applied configuration.
|
||||
// Experimental!
|
||||
func ExtractResourceClassParametersStatus(resourceClassParameters *resourcev1alpha2.ResourceClassParameters, fieldManager string) (*ResourceClassParametersApplyConfiguration, error) {
|
||||
return extractResourceClassParameters(resourceClassParameters, fieldManager, "status")
|
||||
}
|
||||
|
||||
func extractResourceClassParameters(resourceClassParameters *resourcev1alpha2.ResourceClassParameters, fieldManager string, subresource string) (*ResourceClassParametersApplyConfiguration, error) {
|
||||
b := &ResourceClassParametersApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(resourceClassParameters, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceClassParameters"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(resourceClassParameters.Name)
|
||||
b.WithNamespace(resourceClassParameters.Namespace)
|
||||
|
||||
b.WithKind("ResourceClassParameters")
|
||||
b.WithAPIVersion("resource.k8s.io/v1alpha2")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithKind(value string) *ResourceClassParametersApplyConfiguration {
|
||||
b.Kind = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithAPIVersion(value string) *ResourceClassParametersApplyConfiguration {
|
||||
b.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithName sets the Name 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 Name field is set to the value of the last call.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithName(value string) *ResourceClassParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithGenerateName(value string) *ResourceClassParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.GenerateName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithNamespace(value string) *ResourceClassParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Namespace = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUID sets the UID 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 UID field is set to the value of the last call.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithUID(value types.UID) *ResourceClassParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.UID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithResourceVersion(value string) *ResourceClassParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ResourceVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithGeneration(value int64) *ResourceClassParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClassParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.CreationTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClassParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClassParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionGracePeriodSeconds = &value
|
||||
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 *ResourceClassParametersApplyConfiguration) WithLabels(entries map[string]string) *ResourceClassParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
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
|
||||
}
|
||||
|
||||
// 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 *ResourceClassParametersApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClassParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
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
|
||||
}
|
||||
|
||||
// WithOwnerReferences adds the given value to the OwnerReferences 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 OwnerReferences field.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClassParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithOwnerReferences")
|
||||
}
|
||||
b.OwnerReferences = append(b.OwnerReferences, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFinalizers adds the given value to the Finalizers 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 Finalizers field.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithFinalizers(values ...string) *ResourceClassParametersApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.Finalizers = append(b.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ResourceClassParametersApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
if b.ObjectMetaApplyConfiguration == nil {
|
||||
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
// WithGeneratedFrom sets the GeneratedFrom 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 GeneratedFrom field is set to the value of the last call.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithGeneratedFrom(value *ResourceClassParametersReferenceApplyConfiguration) *ResourceClassParametersApplyConfiguration {
|
||||
b.GeneratedFrom = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVendorParameters adds the given value to the VendorParameters 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 VendorParameters field.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithVendorParameters(values ...*VendorParametersApplyConfiguration) *ResourceClassParametersApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithVendorParameters")
|
||||
}
|
||||
b.VendorParameters = append(b.VendorParameters, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFilters adds the given value to the Filters 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 Filters field.
|
||||
func (b *ResourceClassParametersApplyConfiguration) WithFilters(values ...*ResourceFilterApplyConfiguration) *ResourceClassParametersApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithFilters")
|
||||
}
|
||||
b.Filters = append(b.Filters, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
48
applyconfigurations/resource/v1alpha2/resourcefilter.go
Normal file
48
applyconfigurations/resource/v1alpha2/resourcefilter.go
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
// ResourceFilterApplyConfiguration represents an declarative configuration of the ResourceFilter type for use
|
||||
// with apply.
|
||||
type ResourceFilterApplyConfiguration struct {
|
||||
DriverName *string `json:"driverName,omitempty"`
|
||||
ResourceFilterModelApplyConfiguration `json:",inline"`
|
||||
}
|
||||
|
||||
// ResourceFilterApplyConfiguration constructs an declarative configuration of the ResourceFilter type for use with
|
||||
// apply.
|
||||
func ResourceFilter() *ResourceFilterApplyConfiguration {
|
||||
return &ResourceFilterApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithDriverName sets the DriverName 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 DriverName field is set to the value of the last call.
|
||||
func (b *ResourceFilterApplyConfiguration) WithDriverName(value string) *ResourceFilterApplyConfiguration {
|
||||
b.DriverName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call.
|
||||
func (b *ResourceFilterApplyConfiguration) WithNamedResources(value *NamedResourcesFilterApplyConfiguration) *ResourceFilterApplyConfiguration {
|
||||
b.NamedResources = value
|
||||
return b
|
||||
}
|
||||
39
applyconfigurations/resource/v1alpha2/resourcefiltermodel.go
Normal file
39
applyconfigurations/resource/v1alpha2/resourcefiltermodel.go
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
// ResourceFilterModelApplyConfiguration represents an declarative configuration of the ResourceFilterModel type for use
|
||||
// with apply.
|
||||
type ResourceFilterModelApplyConfiguration struct {
|
||||
NamedResources *NamedResourcesFilterApplyConfiguration `json:"namedResources,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceFilterModelApplyConfiguration constructs an declarative configuration of the ResourceFilterModel type for use with
|
||||
// apply.
|
||||
func ResourceFilterModel() *ResourceFilterModelApplyConfiguration {
|
||||
return &ResourceFilterModelApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call.
|
||||
func (b *ResourceFilterModelApplyConfiguration) WithNamedResources(value *NamedResourcesFilterApplyConfiguration) *ResourceFilterModelApplyConfiguration {
|
||||
b.NamedResources = value
|
||||
return b
|
||||
}
|
||||
@@ -21,8 +21,9 @@ package v1alpha2
|
||||
// ResourceHandleApplyConfiguration represents an declarative configuration of the ResourceHandle type for use
|
||||
// with apply.
|
||||
type ResourceHandleApplyConfiguration struct {
|
||||
DriverName *string `json:"driverName,omitempty"`
|
||||
Data *string `json:"data,omitempty"`
|
||||
DriverName *string `json:"driverName,omitempty"`
|
||||
Data *string `json:"data,omitempty"`
|
||||
StructuredData *StructuredResourceHandleApplyConfiguration `json:"structuredData,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceHandleApplyConfiguration constructs an declarative configuration of the ResourceHandle type for use with
|
||||
@@ -46,3 +47,11 @@ func (b *ResourceHandleApplyConfiguration) WithData(value string) *ResourceHandl
|
||||
b.Data = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStructuredData sets the StructuredData 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 StructuredData field is set to the value of the last call.
|
||||
func (b *ResourceHandleApplyConfiguration) WithStructuredData(value *StructuredResourceHandleApplyConfiguration) *ResourceHandleApplyConfiguration {
|
||||
b.StructuredData = value
|
||||
return b
|
||||
}
|
||||
|
||||
39
applyconfigurations/resource/v1alpha2/resourcemodel.go
Normal file
39
applyconfigurations/resource/v1alpha2/resourcemodel.go
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
// ResourceModelApplyConfiguration represents an declarative configuration of the ResourceModel type for use
|
||||
// with apply.
|
||||
type ResourceModelApplyConfiguration struct {
|
||||
NamedResources *NamedResourcesResourcesApplyConfiguration `json:"namedResources,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceModelApplyConfiguration constructs an declarative configuration of the ResourceModel type for use with
|
||||
// apply.
|
||||
func ResourceModel() *ResourceModelApplyConfiguration {
|
||||
return &ResourceModelApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call.
|
||||
func (b *ResourceModelApplyConfiguration) WithNamedResources(value *NamedResourcesResourcesApplyConfiguration) *ResourceModelApplyConfiguration {
|
||||
b.NamedResources = value
|
||||
return b
|
||||
}
|
||||
52
applyconfigurations/resource/v1alpha2/resourcerequest.go
Normal file
52
applyconfigurations/resource/v1alpha2/resourcerequest.go
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// ResourceRequestApplyConfiguration represents an declarative configuration of the ResourceRequest type for use
|
||||
// with apply.
|
||||
type ResourceRequestApplyConfiguration struct {
|
||||
VendorParameters *runtime.RawExtension `json:"vendorParameters,omitempty"`
|
||||
ResourceRequestModelApplyConfiguration `json:",inline"`
|
||||
}
|
||||
|
||||
// ResourceRequestApplyConfiguration constructs an declarative configuration of the ResourceRequest type for use with
|
||||
// apply.
|
||||
func ResourceRequest() *ResourceRequestApplyConfiguration {
|
||||
return &ResourceRequestApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithVendorParameters sets the VendorParameters 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 VendorParameters field is set to the value of the last call.
|
||||
func (b *ResourceRequestApplyConfiguration) WithVendorParameters(value runtime.RawExtension) *ResourceRequestApplyConfiguration {
|
||||
b.VendorParameters = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call.
|
||||
func (b *ResourceRequestApplyConfiguration) WithNamedResources(value *NamedResourcesRequestApplyConfiguration) *ResourceRequestApplyConfiguration {
|
||||
b.NamedResources = value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
// ResourceRequestModelApplyConfiguration represents an declarative configuration of the ResourceRequestModel type for use
|
||||
// with apply.
|
||||
type ResourceRequestModelApplyConfiguration struct {
|
||||
NamedResources *NamedResourcesRequestApplyConfiguration `json:"namedResources,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceRequestModelApplyConfiguration constructs an declarative configuration of the ResourceRequestModel type for use with
|
||||
// apply.
|
||||
func ResourceRequestModel() *ResourceRequestModelApplyConfiguration {
|
||||
return &ResourceRequestModelApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call.
|
||||
func (b *ResourceRequestModelApplyConfiguration) WithNamedResources(value *NamedResourcesRequestApplyConfiguration) *ResourceRequestModelApplyConfiguration {
|
||||
b.NamedResources = value
|
||||
return b
|
||||
}
|
||||
265
applyconfigurations/resource/v1alpha2/resourceslice.go
Normal file
265
applyconfigurations/resource/v1alpha2/resourceslice.go
Normal file
@@ -0,0 +1,265 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
resourcev1alpha2 "k8s.io/api/resource/v1alpha2"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
internal "k8s.io/client-go/applyconfigurations/internal"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// ResourceSliceApplyConfiguration represents an declarative configuration of the ResourceSlice type for use
|
||||
// with apply.
|
||||
type ResourceSliceApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
NodeName *string `json:"nodeName,omitempty"`
|
||||
DriverName *string `json:"driverName,omitempty"`
|
||||
ResourceModelApplyConfiguration `json:",inline"`
|
||||
}
|
||||
|
||||
// ResourceSlice constructs an declarative configuration of the ResourceSlice type for use with
|
||||
// apply.
|
||||
func ResourceSlice(name string) *ResourceSliceApplyConfiguration {
|
||||
b := &ResourceSliceApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("ResourceSlice")
|
||||
b.WithAPIVersion("resource.k8s.io/v1alpha2")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractResourceSlice extracts the applied configuration owned by fieldManager from
|
||||
// resourceSlice. If no managedFields are found in resourceSlice for fieldManager, a
|
||||
// ResourceSliceApplyConfiguration is returned with only the Name, Namespace (if applicable),
|
||||
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
|
||||
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
|
||||
// the fieldManager never owned fields any fields.
|
||||
// resourceSlice must be a unmodified ResourceSlice API object that was retrieved from the Kubernetes API.
|
||||
// ExtractResourceSlice provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
// Experimental!
|
||||
func ExtractResourceSlice(resourceSlice *resourcev1alpha2.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) {
|
||||
return extractResourceSlice(resourceSlice, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractResourceSliceStatus is the same as ExtractResourceSlice except
|
||||
// that it extracts the status subresource applied configuration.
|
||||
// Experimental!
|
||||
func ExtractResourceSliceStatus(resourceSlice *resourcev1alpha2.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) {
|
||||
return extractResourceSlice(resourceSlice, fieldManager, "status")
|
||||
}
|
||||
|
||||
func extractResourceSlice(resourceSlice *resourcev1alpha2.ResourceSlice, fieldManager string, subresource string) (*ResourceSliceApplyConfiguration, error) {
|
||||
b := &ResourceSliceApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(resourceSlice, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceSlice"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(resourceSlice.Name)
|
||||
|
||||
b.WithKind("ResourceSlice")
|
||||
b.WithAPIVersion("resource.k8s.io/v1alpha2")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithKind(value string) *ResourceSliceApplyConfiguration {
|
||||
b.Kind = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithAPIVersion(value string) *ResourceSliceApplyConfiguration {
|
||||
b.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithName sets the Name 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 Name field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithName(value string) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithGenerateName(value string) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.GenerateName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithNamespace(value string) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Namespace = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUID sets the UID 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 UID field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithUID(value types.UID) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.UID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithResourceVersion(value string) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ResourceVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithGeneration(value int64) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.CreationTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionGracePeriodSeconds = &value
|
||||
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 *ResourceSliceApplyConfiguration) WithLabels(entries map[string]string) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
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
|
||||
}
|
||||
|
||||
// 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 *ResourceSliceApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
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
|
||||
}
|
||||
|
||||
// WithOwnerReferences adds the given value to the OwnerReferences 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 OwnerReferences field.
|
||||
func (b *ResourceSliceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithOwnerReferences")
|
||||
}
|
||||
b.OwnerReferences = append(b.OwnerReferences, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFinalizers adds the given value to the Finalizers 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 Finalizers field.
|
||||
func (b *ResourceSliceApplyConfiguration) WithFinalizers(values ...string) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.Finalizers = append(b.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ResourceSliceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
if b.ObjectMetaApplyConfiguration == nil {
|
||||
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
// WithNodeName sets the NodeName 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 NodeName field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithNodeName(value string) *ResourceSliceApplyConfiguration {
|
||||
b.NodeName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDriverName sets the DriverName 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 DriverName field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithDriverName(value string) *ResourceSliceApplyConfiguration {
|
||||
b.DriverName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamedResources sets the NamedResources 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 NamedResources field is set to the value of the last call.
|
||||
func (b *ResourceSliceApplyConfiguration) WithNamedResources(value *NamedResourcesResourcesApplyConfiguration) *ResourceSliceApplyConfiguration {
|
||||
b.NamedResources = value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// StructuredResourceHandleApplyConfiguration represents an declarative configuration of the StructuredResourceHandle type for use
|
||||
// with apply.
|
||||
type StructuredResourceHandleApplyConfiguration struct {
|
||||
VendorClassParameters *runtime.RawExtension `json:"vendorClassParameters,omitempty"`
|
||||
VendorClaimParameters *runtime.RawExtension `json:"vendorClaimParameters,omitempty"`
|
||||
NodeName *string `json:"nodeName,omitempty"`
|
||||
Results []DriverAllocationResultApplyConfiguration `json:"results,omitempty"`
|
||||
}
|
||||
|
||||
// StructuredResourceHandleApplyConfiguration constructs an declarative configuration of the StructuredResourceHandle type for use with
|
||||
// apply.
|
||||
func StructuredResourceHandle() *StructuredResourceHandleApplyConfiguration {
|
||||
return &StructuredResourceHandleApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithVendorClassParameters sets the VendorClassParameters 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 VendorClassParameters field is set to the value of the last call.
|
||||
func (b *StructuredResourceHandleApplyConfiguration) WithVendorClassParameters(value runtime.RawExtension) *StructuredResourceHandleApplyConfiguration {
|
||||
b.VendorClassParameters = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVendorClaimParameters sets the VendorClaimParameters 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 VendorClaimParameters field is set to the value of the last call.
|
||||
func (b *StructuredResourceHandleApplyConfiguration) WithVendorClaimParameters(value runtime.RawExtension) *StructuredResourceHandleApplyConfiguration {
|
||||
b.VendorClaimParameters = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNodeName sets the NodeName 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 NodeName field is set to the value of the last call.
|
||||
func (b *StructuredResourceHandleApplyConfiguration) WithNodeName(value string) *StructuredResourceHandleApplyConfiguration {
|
||||
b.NodeName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResults adds the given value to the Results 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 Results field.
|
||||
func (b *StructuredResourceHandleApplyConfiguration) WithResults(values ...*DriverAllocationResultApplyConfiguration) *StructuredResourceHandleApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithResults")
|
||||
}
|
||||
b.Results = append(b.Results, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
52
applyconfigurations/resource/v1alpha2/vendorparameters.go
Normal file
52
applyconfigurations/resource/v1alpha2/vendorparameters.go
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// VendorParametersApplyConfiguration represents an declarative configuration of the VendorParameters type for use
|
||||
// with apply.
|
||||
type VendorParametersApplyConfiguration struct {
|
||||
DriverName *string `json:"driverName,omitempty"`
|
||||
Parameters *runtime.RawExtension `json:"parameters,omitempty"`
|
||||
}
|
||||
|
||||
// VendorParametersApplyConfiguration constructs an declarative configuration of the VendorParameters type for use with
|
||||
// apply.
|
||||
func VendorParameters() *VendorParametersApplyConfiguration {
|
||||
return &VendorParametersApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithDriverName sets the DriverName 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 DriverName field is set to the value of the last call.
|
||||
func (b *VendorParametersApplyConfiguration) WithDriverName(value string) *VendorParametersApplyConfiguration {
|
||||
b.DriverName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithParameters sets the Parameters 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 Parameters field is set to the value of the last call.
|
||||
func (b *VendorParametersApplyConfiguration) WithParameters(value runtime.RawExtension) *VendorParametersApplyConfiguration {
|
||||
b.Parameters = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// GroupVersionResourceApplyConfiguration represents an declarative configuration of the GroupVersionResource type for use
|
||||
// with apply.
|
||||
type GroupVersionResourceApplyConfiguration struct {
|
||||
Group *string `json:"group,omitempty"`
|
||||
Version *string `json:"version,omitempty"`
|
||||
Resource *string `json:"resource,omitempty"`
|
||||
}
|
||||
|
||||
// GroupVersionResourceApplyConfiguration constructs an declarative configuration of the GroupVersionResource type for use with
|
||||
// apply.
|
||||
func GroupVersionResource() *GroupVersionResourceApplyConfiguration {
|
||||
return &GroupVersionResourceApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithGroup sets the Group 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 Group field is set to the value of the last call.
|
||||
func (b *GroupVersionResourceApplyConfiguration) WithGroup(value string) *GroupVersionResourceApplyConfiguration {
|
||||
b.Group = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVersion sets the Version 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 Version field is set to the value of the last call.
|
||||
func (b *GroupVersionResourceApplyConfiguration) WithVersion(value string) *GroupVersionResourceApplyConfiguration {
|
||||
b.Version = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResource sets the Resource 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 Resource field is set to the value of the last call.
|
||||
func (b *GroupVersionResourceApplyConfiguration) WithResource(value string) *GroupVersionResourceApplyConfiguration {
|
||||
b.Resource = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
v1alpha1 "k8s.io/api/storagemigration/v1alpha1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// MigrationConditionApplyConfiguration represents an declarative configuration of the MigrationCondition type for use
|
||||
// with apply.
|
||||
type MigrationConditionApplyConfiguration struct {
|
||||
Type *v1alpha1.MigrationConditionType `json:"type,omitempty"`
|
||||
Status *v1.ConditionStatus `json:"status,omitempty"`
|
||||
LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`
|
||||
Reason *string `json:"reason,omitempty"`
|
||||
Message *string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// MigrationConditionApplyConfiguration constructs an declarative configuration of the MigrationCondition type for use with
|
||||
// apply.
|
||||
func MigrationCondition() *MigrationConditionApplyConfiguration {
|
||||
return &MigrationConditionApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithType sets the Type 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 Type field is set to the value of the last call.
|
||||
func (b *MigrationConditionApplyConfiguration) WithType(value v1alpha1.MigrationConditionType) *MigrationConditionApplyConfiguration {
|
||||
b.Type = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStatus sets the Status 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 Status field is set to the value of the last call.
|
||||
func (b *MigrationConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *MigrationConditionApplyConfiguration {
|
||||
b.Status = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithLastUpdateTime sets the LastUpdateTime 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 LastUpdateTime field is set to the value of the last call.
|
||||
func (b *MigrationConditionApplyConfiguration) WithLastUpdateTime(value metav1.Time) *MigrationConditionApplyConfiguration {
|
||||
b.LastUpdateTime = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithReason sets the Reason 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 Reason field is set to the value of the last call.
|
||||
func (b *MigrationConditionApplyConfiguration) WithReason(value string) *MigrationConditionApplyConfiguration {
|
||||
b.Reason = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMessage sets the Message 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 Message field is set to the value of the last call.
|
||||
func (b *MigrationConditionApplyConfiguration) WithMessage(value string) *MigrationConditionApplyConfiguration {
|
||||
b.Message = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
internal "k8s.io/client-go/applyconfigurations/internal"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// StorageVersionMigrationApplyConfiguration represents an declarative configuration of the StorageVersionMigration type for use
|
||||
// with apply.
|
||||
type StorageVersionMigrationApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
Spec *StorageVersionMigrationSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
Status *StorageVersionMigrationStatusApplyConfiguration `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// StorageVersionMigration constructs an declarative configuration of the StorageVersionMigration type for use with
|
||||
// apply.
|
||||
func StorageVersionMigration(name string) *StorageVersionMigrationApplyConfiguration {
|
||||
b := &StorageVersionMigrationApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("StorageVersionMigration")
|
||||
b.WithAPIVersion("storagemigration.k8s.io/v1alpha1")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractStorageVersionMigration extracts the applied configuration owned by fieldManager from
|
||||
// storageVersionMigration. If no managedFields are found in storageVersionMigration for fieldManager, a
|
||||
// StorageVersionMigrationApplyConfiguration is returned with only the Name, Namespace (if applicable),
|
||||
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
|
||||
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
|
||||
// the fieldManager never owned fields any fields.
|
||||
// storageVersionMigration must be a unmodified StorageVersionMigration API object that was retrieved from the Kubernetes API.
|
||||
// ExtractStorageVersionMigration provides a way to perform a extract/modify-in-place/apply workflow.
|
||||
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
|
||||
// applied if another fieldManager has updated or force applied any of the previously applied fields.
|
||||
// Experimental!
|
||||
func ExtractStorageVersionMigration(storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigration, fieldManager string) (*StorageVersionMigrationApplyConfiguration, error) {
|
||||
return extractStorageVersionMigration(storageVersionMigration, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractStorageVersionMigrationStatus is the same as ExtractStorageVersionMigration except
|
||||
// that it extracts the status subresource applied configuration.
|
||||
// Experimental!
|
||||
func ExtractStorageVersionMigrationStatus(storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigration, fieldManager string) (*StorageVersionMigrationApplyConfiguration, error) {
|
||||
return extractStorageVersionMigration(storageVersionMigration, fieldManager, "status")
|
||||
}
|
||||
|
||||
func extractStorageVersionMigration(storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigration, fieldManager string, subresource string) (*StorageVersionMigrationApplyConfiguration, error) {
|
||||
b := &StorageVersionMigrationApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(storageVersionMigration, internal.Parser().Type("io.k8s.api.storagemigration.v1alpha1.StorageVersionMigration"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(storageVersionMigration.Name)
|
||||
|
||||
b.WithKind("StorageVersionMigration")
|
||||
b.WithAPIVersion("storagemigration.k8s.io/v1alpha1")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// WithKind sets the Kind 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 Kind field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithKind(value string) *StorageVersionMigrationApplyConfiguration {
|
||||
b.Kind = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAPIVersion sets the APIVersion 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 APIVersion field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithAPIVersion(value string) *StorageVersionMigrationApplyConfiguration {
|
||||
b.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithName sets the Name 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 Name field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithName(value string) *StorageVersionMigrationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGenerateName sets the GenerateName 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 GenerateName field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithGenerateName(value string) *StorageVersionMigrationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.GenerateName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNamespace sets the Namespace 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 Namespace field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithNamespace(value string) *StorageVersionMigrationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Namespace = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithUID sets the UID 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 UID field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithUID(value types.UID) *StorageVersionMigrationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.UID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithResourceVersion(value string) *StorageVersionMigrationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ResourceVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithGeneration sets the Generation 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 Generation field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithGeneration(value int64) *StorageVersionMigrationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithCreationTimestamp sets the CreationTimestamp 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 CreationTimestamp field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *StorageVersionMigrationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.CreationTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionTimestamp sets the DeletionTimestamp 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 DeletionTimestamp field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *StorageVersionMigrationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds 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 DeletionGracePeriodSeconds field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *StorageVersionMigrationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionGracePeriodSeconds = &value
|
||||
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 *StorageVersionMigrationApplyConfiguration) WithLabels(entries map[string]string) *StorageVersionMigrationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
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
|
||||
}
|
||||
|
||||
// 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 *StorageVersionMigrationApplyConfiguration) WithAnnotations(entries map[string]string) *StorageVersionMigrationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
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
|
||||
}
|
||||
|
||||
// WithOwnerReferences adds the given value to the OwnerReferences 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 OwnerReferences field.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *StorageVersionMigrationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithOwnerReferences")
|
||||
}
|
||||
b.OwnerReferences = append(b.OwnerReferences, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithFinalizers adds the given value to the Finalizers 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 Finalizers field.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithFinalizers(values ...string) *StorageVersionMigrationApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.Finalizers = append(b.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *StorageVersionMigrationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
|
||||
if b.ObjectMetaApplyConfiguration == nil {
|
||||
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
|
||||
}
|
||||
}
|
||||
|
||||
// WithSpec sets the Spec 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 Spec field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithSpec(value *StorageVersionMigrationSpecApplyConfiguration) *StorageVersionMigrationApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStatus sets the Status 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 Status field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationApplyConfiguration) WithStatus(value *StorageVersionMigrationStatusApplyConfiguration) *StorageVersionMigrationApplyConfiguration {
|
||||
b.Status = value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// StorageVersionMigrationSpecApplyConfiguration represents an declarative configuration of the StorageVersionMigrationSpec type for use
|
||||
// with apply.
|
||||
type StorageVersionMigrationSpecApplyConfiguration struct {
|
||||
Resource *GroupVersionResourceApplyConfiguration `json:"resource,omitempty"`
|
||||
ContinueToken *string `json:"continueToken,omitempty"`
|
||||
}
|
||||
|
||||
// StorageVersionMigrationSpecApplyConfiguration constructs an declarative configuration of the StorageVersionMigrationSpec type for use with
|
||||
// apply.
|
||||
func StorageVersionMigrationSpec() *StorageVersionMigrationSpecApplyConfiguration {
|
||||
return &StorageVersionMigrationSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithResource sets the Resource 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 Resource field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationSpecApplyConfiguration) WithResource(value *GroupVersionResourceApplyConfiguration) *StorageVersionMigrationSpecApplyConfiguration {
|
||||
b.Resource = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithContinueToken sets the ContinueToken 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 ContinueToken field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationSpecApplyConfiguration) WithContinueToken(value string) *StorageVersionMigrationSpecApplyConfiguration {
|
||||
b.ContinueToken = &value
|
||||
return b
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
// StorageVersionMigrationStatusApplyConfiguration represents an declarative configuration of the StorageVersionMigrationStatus type for use
|
||||
// with apply.
|
||||
type StorageVersionMigrationStatusApplyConfiguration struct {
|
||||
Conditions []MigrationConditionApplyConfiguration `json:"conditions,omitempty"`
|
||||
ResourceVersion *string `json:"resourceVersion,omitempty"`
|
||||
}
|
||||
|
||||
// StorageVersionMigrationStatusApplyConfiguration constructs an declarative configuration of the StorageVersionMigrationStatus type for use with
|
||||
// apply.
|
||||
func StorageVersionMigrationStatus() *StorageVersionMigrationStatusApplyConfiguration {
|
||||
return &StorageVersionMigrationStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithConditions adds the given value to the Conditions 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 Conditions field.
|
||||
func (b *StorageVersionMigrationStatusApplyConfiguration) WithConditions(values ...*MigrationConditionApplyConfiguration) *StorageVersionMigrationStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConditions")
|
||||
}
|
||||
b.Conditions = append(b.Conditions, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceVersion sets the ResourceVersion 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 ResourceVersion field is set to the value of the last call.
|
||||
func (b *StorageVersionMigrationStatusApplyConfiguration) WithResourceVersion(value string) *StorageVersionMigrationStatusApplyConfiguration {
|
||||
b.ResourceVersion = &value
|
||||
return b
|
||||
}
|
||||
@@ -66,6 +66,7 @@ import (
|
||||
storagev1 "k8s.io/api/storage/v1"
|
||||
storagev1alpha1 "k8s.io/api/storage/v1alpha1"
|
||||
storagev1beta1 "k8s.io/api/storage/v1beta1"
|
||||
storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
|
||||
@@ -116,6 +117,7 @@ import (
|
||||
applyconfigurationsstoragev1 "k8s.io/client-go/applyconfigurations/storage/v1"
|
||||
applyconfigurationsstoragev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1"
|
||||
applyconfigurationsstoragev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1"
|
||||
applyconfigurationsstoragemigrationv1alpha1 "k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1"
|
||||
)
|
||||
|
||||
// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no
|
||||
@@ -123,22 +125,50 @@ import (
|
||||
func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
switch kind {
|
||||
// Group=admissionregistration.k8s.io, Version=v1
|
||||
case v1.SchemeGroupVersion.WithKind("AuditAnnotation"):
|
||||
return &admissionregistrationv1.AuditAnnotationApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("ExpressionWarning"):
|
||||
return &admissionregistrationv1.ExpressionWarningApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("MatchCondition"):
|
||||
return &admissionregistrationv1.MatchConditionApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("MatchResources"):
|
||||
return &admissionregistrationv1.MatchResourcesApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("MutatingWebhook"):
|
||||
return &admissionregistrationv1.MutatingWebhookApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration"):
|
||||
return &admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("NamedRuleWithOperations"):
|
||||
return &admissionregistrationv1.NamedRuleWithOperationsApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("ParamKind"):
|
||||
return &admissionregistrationv1.ParamKindApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("ParamRef"):
|
||||
return &admissionregistrationv1.ParamRefApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("Rule"):
|
||||
return &admissionregistrationv1.RuleApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("RuleWithOperations"):
|
||||
return &admissionregistrationv1.RuleWithOperationsApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("ServiceReference"):
|
||||
return &admissionregistrationv1.ServiceReferenceApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("TypeChecking"):
|
||||
return &admissionregistrationv1.TypeCheckingApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy"):
|
||||
return &admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding"):
|
||||
return &admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBindingSpec"):
|
||||
return &admissionregistrationv1.ValidatingAdmissionPolicyBindingSpecApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicySpec"):
|
||||
return &admissionregistrationv1.ValidatingAdmissionPolicySpecApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyStatus"):
|
||||
return &admissionregistrationv1.ValidatingAdmissionPolicyStatusApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("ValidatingWebhook"):
|
||||
return &admissionregistrationv1.ValidatingWebhookApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration"):
|
||||
return &admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("Validation"):
|
||||
return &admissionregistrationv1.ValidationApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("Variable"):
|
||||
return &admissionregistrationv1.VariableApplyConfiguration{}
|
||||
case v1.SchemeGroupVersion.WithKind("WebhookClientConfig"):
|
||||
return &admissionregistrationv1.WebhookClientConfigApplyConfiguration{}
|
||||
|
||||
@@ -531,6 +561,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationsbatchv1.PodFailurePolicyOnPodConditionsPatternApplyConfiguration{}
|
||||
case batchv1.SchemeGroupVersion.WithKind("PodFailurePolicyRule"):
|
||||
return &applyconfigurationsbatchv1.PodFailurePolicyRuleApplyConfiguration{}
|
||||
case batchv1.SchemeGroupVersion.WithKind("SuccessPolicy"):
|
||||
return &applyconfigurationsbatchv1.SuccessPolicyApplyConfiguration{}
|
||||
case batchv1.SchemeGroupVersion.WithKind("SuccessPolicyRule"):
|
||||
return &applyconfigurationsbatchv1.SuccessPolicyRuleApplyConfiguration{}
|
||||
case batchv1.SchemeGroupVersion.WithKind("UncountedTerminatedPods"):
|
||||
return &applyconfigurationsbatchv1.UncountedTerminatedPodsApplyConfiguration{}
|
||||
|
||||
@@ -585,6 +619,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
// Group=core, Version=v1
|
||||
case corev1.SchemeGroupVersion.WithKind("Affinity"):
|
||||
return &applyconfigurationscorev1.AffinityApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("AppArmorProfile"):
|
||||
return &applyconfigurationscorev1.AppArmorProfileApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("AttachedVolume"):
|
||||
return &applyconfigurationscorev1.AttachedVolumeApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("AWSElasticBlockStoreVolumeSource"):
|
||||
@@ -645,6 +681,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationscorev1.ContainerStateWaitingApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("ContainerStatus"):
|
||||
return &applyconfigurationscorev1.ContainerStatusApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("ContainerUser"):
|
||||
return &applyconfigurationscorev1.ContainerUserApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("CSIPersistentVolumeSource"):
|
||||
return &applyconfigurationscorev1.CSIPersistentVolumeSourceApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("CSIVolumeSource"):
|
||||
@@ -731,6 +769,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationscorev1.LimitRangeItemApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("LimitRangeSpec"):
|
||||
return &applyconfigurationscorev1.LimitRangeSpecApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("LinuxContainerUser"):
|
||||
return &applyconfigurationscorev1.LinuxContainerUserApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("LoadBalancerIngress"):
|
||||
return &applyconfigurationscorev1.LoadBalancerIngressApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("LoadBalancerStatus"):
|
||||
@@ -765,6 +805,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationscorev1.NodeConfigStatusApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("NodeDaemonEndpoints"):
|
||||
return &applyconfigurationscorev1.NodeDaemonEndpointsApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandler"):
|
||||
return &applyconfigurationscorev1.NodeRuntimeHandlerApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandlerFeatures"):
|
||||
return &applyconfigurationscorev1.NodeRuntimeHandlerFeaturesApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("NodeSelector"):
|
||||
return &applyconfigurationscorev1.NodeSelectorApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("NodeSelectorRequirement"):
|
||||
@@ -947,6 +991,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationscorev1.VolumeDeviceApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("VolumeMount"):
|
||||
return &applyconfigurationscorev1.VolumeMountApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("VolumeMountStatus"):
|
||||
return &applyconfigurationscorev1.VolumeMountStatusApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("VolumeNodeAffinity"):
|
||||
return &applyconfigurationscorev1.VolumeNodeAffinityApplyConfiguration{}
|
||||
case corev1.SchemeGroupVersion.WithKind("VolumeProjection"):
|
||||
@@ -1493,6 +1539,30 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
// Group=resource.k8s.io, Version=v1alpha2
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("AllocationResult"):
|
||||
return &resourcev1alpha2.AllocationResultApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("AllocationResultModel"):
|
||||
return &resourcev1alpha2.AllocationResultModelApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("DriverAllocationResult"):
|
||||
return &resourcev1alpha2.DriverAllocationResultApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("DriverRequests"):
|
||||
return &resourcev1alpha2.DriverRequestsApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesAllocationResult"):
|
||||
return &resourcev1alpha2.NamedResourcesAllocationResultApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesAttribute"):
|
||||
return &resourcev1alpha2.NamedResourcesAttributeApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesAttributeValue"):
|
||||
return &resourcev1alpha2.NamedResourcesAttributeValueApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesFilter"):
|
||||
return &resourcev1alpha2.NamedResourcesFilterApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesInstance"):
|
||||
return &resourcev1alpha2.NamedResourcesInstanceApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesIntSlice"):
|
||||
return &resourcev1alpha2.NamedResourcesIntSliceApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesRequest"):
|
||||
return &resourcev1alpha2.NamedResourcesRequestApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesResources"):
|
||||
return &resourcev1alpha2.NamedResourcesResourcesApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesStringSlice"):
|
||||
return &resourcev1alpha2.NamedResourcesStringSliceApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContext"):
|
||||
return &resourcev1alpha2.PodSchedulingContextApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContextSpec"):
|
||||
@@ -1503,6 +1573,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &resourcev1alpha2.ResourceClaimApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimConsumerReference"):
|
||||
return &resourcev1alpha2.ResourceClaimConsumerReferenceApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimParameters"):
|
||||
return &resourcev1alpha2.ResourceClaimParametersApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimParametersReference"):
|
||||
return &resourcev1alpha2.ResourceClaimParametersReferenceApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimSchedulingStatus"):
|
||||
@@ -1517,10 +1589,28 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &resourcev1alpha2.ResourceClaimTemplateSpecApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceClass"):
|
||||
return &resourcev1alpha2.ResourceClassApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceClassParameters"):
|
||||
return &resourcev1alpha2.ResourceClassParametersApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceClassParametersReference"):
|
||||
return &resourcev1alpha2.ResourceClassParametersReferenceApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceFilter"):
|
||||
return &resourcev1alpha2.ResourceFilterApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceFilterModel"):
|
||||
return &resourcev1alpha2.ResourceFilterModelApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceHandle"):
|
||||
return &resourcev1alpha2.ResourceHandleApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceModel"):
|
||||
return &resourcev1alpha2.ResourceModelApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceRequest"):
|
||||
return &resourcev1alpha2.ResourceRequestApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceRequestModel"):
|
||||
return &resourcev1alpha2.ResourceRequestModelApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("ResourceSlice"):
|
||||
return &resourcev1alpha2.ResourceSliceApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("StructuredResourceHandle"):
|
||||
return &resourcev1alpha2.StructuredResourceHandleApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("VendorParameters"):
|
||||
return &resourcev1alpha2.VendorParametersApplyConfiguration{}
|
||||
|
||||
// Group=scheduling.k8s.io, Version=v1
|
||||
case schedulingv1.SchemeGroupVersion.WithKind("PriorityClass"):
|
||||
@@ -1610,6 +1700,18 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
case storagev1beta1.SchemeGroupVersion.WithKind("VolumeNodeResources"):
|
||||
return &applyconfigurationsstoragev1beta1.VolumeNodeResourcesApplyConfiguration{}
|
||||
|
||||
// Group=storagemigration.k8s.io, Version=v1alpha1
|
||||
case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("GroupVersionResource"):
|
||||
return &applyconfigurationsstoragemigrationv1alpha1.GroupVersionResourceApplyConfiguration{}
|
||||
case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("MigrationCondition"):
|
||||
return &applyconfigurationsstoragemigrationv1alpha1.MigrationConditionApplyConfiguration{}
|
||||
case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigration"):
|
||||
return &applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationApplyConfiguration{}
|
||||
case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigrationSpec"):
|
||||
return &applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationSpecApplyConfiguration{}
|
||||
case storagemigrationv1alpha1.SchemeGroupVersion.WithKind("StorageVersionMigrationStatus"):
|
||||
return &applyconfigurationsstoragemigrationv1alpha1.StorageVersionMigrationStatusApplyConfiguration{}
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@ package discovery
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2beta1"
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2"
|
||||
apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
@@ -154,3 +155,124 @@ func convertAPISubresource(parent metav1.APIResource, in apidiscovery.APISubreso
|
||||
result.Verbs = in.Verbs
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Please note the functions below will be removed in v1.33. They facilitate conversion
|
||||
// between the deprecated type apidiscoveryv2beta1.APIGroupDiscoveryList.
|
||||
|
||||
// SplitGroupsAndResourcesV2Beta1 transforms "aggregated" discovery top-level structure into
|
||||
// the previous "unaggregated" discovery groups and resources.
|
||||
// Deprecated: Please use SplitGroupsAndResources
|
||||
func SplitGroupsAndResourcesV2Beta1(aggregatedGroups apidiscoveryv2beta1.APIGroupDiscoveryList) (
|
||||
*metav1.APIGroupList,
|
||||
map[schema.GroupVersion]*metav1.APIResourceList,
|
||||
map[schema.GroupVersion]error) {
|
||||
// Aggregated group list will contain the entirety of discovery, including
|
||||
// groups, versions, and resources. GroupVersions marked "stale" are failed.
|
||||
groups := []*metav1.APIGroup{}
|
||||
failedGVs := map[schema.GroupVersion]error{}
|
||||
resourcesByGV := map[schema.GroupVersion]*metav1.APIResourceList{}
|
||||
for _, aggGroup := range aggregatedGroups.Items {
|
||||
group, resources, failed := convertAPIGroupv2beta1(aggGroup)
|
||||
groups = append(groups, group)
|
||||
for gv, resourceList := range resources {
|
||||
resourcesByGV[gv] = resourceList
|
||||
}
|
||||
for gv, err := range failed {
|
||||
failedGVs[gv] = err
|
||||
}
|
||||
}
|
||||
// Transform slice of groups to group list before returning.
|
||||
groupList := &metav1.APIGroupList{}
|
||||
groupList.Groups = make([]metav1.APIGroup, 0, len(groups))
|
||||
for _, group := range groups {
|
||||
groupList.Groups = append(groupList.Groups, *group)
|
||||
}
|
||||
return groupList, resourcesByGV, failedGVs
|
||||
}
|
||||
|
||||
// convertAPIGroupv2beta1 tranforms an "aggregated" APIGroupDiscovery to an "legacy" APIGroup,
|
||||
// also returning the map of APIResourceList for resources within GroupVersions.
|
||||
func convertAPIGroupv2beta1(g apidiscoveryv2beta1.APIGroupDiscovery) (
|
||||
*metav1.APIGroup,
|
||||
map[schema.GroupVersion]*metav1.APIResourceList,
|
||||
map[schema.GroupVersion]error) {
|
||||
// Iterate through versions to convert to group and resources.
|
||||
group := &metav1.APIGroup{}
|
||||
gvResources := map[schema.GroupVersion]*metav1.APIResourceList{}
|
||||
failedGVs := map[schema.GroupVersion]error{}
|
||||
group.Name = g.ObjectMeta.Name
|
||||
for _, v := range g.Versions {
|
||||
gv := schema.GroupVersion{Group: g.Name, Version: v.Version}
|
||||
if v.Freshness == apidiscoveryv2beta1.DiscoveryFreshnessStale {
|
||||
failedGVs[gv] = StaleGroupVersionError{gv: gv}
|
||||
continue
|
||||
}
|
||||
version := metav1.GroupVersionForDiscovery{}
|
||||
version.GroupVersion = gv.String()
|
||||
version.Version = v.Version
|
||||
group.Versions = append(group.Versions, version)
|
||||
// PreferredVersion is first non-stale Version
|
||||
if group.PreferredVersion == (metav1.GroupVersionForDiscovery{}) {
|
||||
group.PreferredVersion = version
|
||||
}
|
||||
resourceList := &metav1.APIResourceList{}
|
||||
resourceList.GroupVersion = gv.String()
|
||||
for _, r := range v.Resources {
|
||||
resource, err := convertAPIResourcev2beta1(r)
|
||||
if err == nil {
|
||||
resourceList.APIResources = append(resourceList.APIResources, resource)
|
||||
}
|
||||
// Subresources field in new format get transformed into full APIResources.
|
||||
// It is possible a partial result with an error was returned to be used
|
||||
// as the parent resource for the subresource.
|
||||
for _, subresource := range r.Subresources {
|
||||
sr, err := convertAPISubresourcev2beta1(resource, subresource)
|
||||
if err == nil {
|
||||
resourceList.APIResources = append(resourceList.APIResources, sr)
|
||||
}
|
||||
}
|
||||
}
|
||||
gvResources[gv] = resourceList
|
||||
}
|
||||
return group, gvResources, failedGVs
|
||||
}
|
||||
|
||||
// convertAPIResource tranforms a APIResourceDiscovery to an APIResource. We are
|
||||
// resilient to missing GVK, since this resource might be the parent resource
|
||||
// for a subresource. If the parent is missing a GVK, it is not returned in
|
||||
// discovery, and the subresource MUST have the GVK.
|
||||
func convertAPIResourcev2beta1(in apidiscoveryv2beta1.APIResourceDiscovery) (metav1.APIResource, error) {
|
||||
result := metav1.APIResource{
|
||||
Name: in.Resource,
|
||||
SingularName: in.SingularResource,
|
||||
Namespaced: in.Scope == apidiscoveryv2beta1.ScopeNamespace,
|
||||
Verbs: in.Verbs,
|
||||
ShortNames: in.ShortNames,
|
||||
Categories: in.Categories,
|
||||
}
|
||||
// Can return partial result with error, which can be the parent for a
|
||||
// subresource. Do not add this result to the returned discovery resources.
|
||||
if in.ResponseKind == nil || (*in.ResponseKind) == emptyKind {
|
||||
return result, fmt.Errorf("discovery resource %s missing GVK", in.Resource)
|
||||
}
|
||||
result.Group = in.ResponseKind.Group
|
||||
result.Version = in.ResponseKind.Version
|
||||
result.Kind = in.ResponseKind.Kind
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// convertAPISubresource tranforms a APISubresourceDiscovery to an APIResource.
|
||||
func convertAPISubresourcev2beta1(parent metav1.APIResource, in apidiscoveryv2beta1.APISubresourceDiscovery) (metav1.APIResource, error) {
|
||||
result := metav1.APIResource{}
|
||||
if in.ResponseKind == nil || (*in.ResponseKind) == emptyKind {
|
||||
return result, fmt.Errorf("subresource %s/%s missing GVK", parent.Name, in.Subresource)
|
||||
}
|
||||
result.Name = fmt.Sprintf("%s/%s", parent.Name, in.Subresource)
|
||||
result.SingularName = parent.SingularName
|
||||
result.Namespaced = parent.Namespaced
|
||||
result.Group = in.ResponseKind.Group
|
||||
result.Version = in.ResponseKind.Version
|
||||
result.Kind = in.ResponseKind.Kind
|
||||
result.Verbs = in.Verbs
|
||||
return result, nil
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2beta1"
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2"
|
||||
apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
@@ -961,3 +962,941 @@ func TestSplitGroupsAndResources(t *testing.T) {
|
||||
assert.Equal(t, test.expectedGVResources, resourcesByGV)
|
||||
}
|
||||
}
|
||||
|
||||
// Duplicated from test above. Remove after 1.33
|
||||
func TestSplitGroupsAndResourcesV2Beta1(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
agg apidiscoveryv2beta1.APIGroupDiscoveryList
|
||||
expectedGroups metav1.APIGroupList
|
||||
expectedGVResources map[schema.GroupVersion]*metav1.APIResourceList
|
||||
expectedFailedGVs map[schema.GroupVersion]error
|
||||
}{
|
||||
{
|
||||
name: "Aggregated discovery: core/v1 group and pod resource",
|
||||
agg: apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "pods",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Pod",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroups: metav1.APIGroupList{
|
||||
Groups: []metav1.APIGroup{
|
||||
{
|
||||
Name: "",
|
||||
Versions: []metav1.GroupVersionForDiscovery{
|
||||
{
|
||||
GroupVersion: "v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
PreferredVersion: metav1.GroupVersionForDiscovery{
|
||||
GroupVersion: "v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{
|
||||
{Group: "", Version: "v1"}: {
|
||||
GroupVersion: "v1",
|
||||
APIResources: []metav1.APIResource{
|
||||
{
|
||||
Name: "pods",
|
||||
Namespaced: true,
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Pod",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedFailedGVs: map[schema.GroupVersion]error{},
|
||||
},
|
||||
{
|
||||
name: "Aggregated discovery: 1 group/1 resources at /api, 1 group/2 versions/1 resources at /apis",
|
||||
agg: apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "apps",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v2",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v2",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroups: metav1.APIGroupList{
|
||||
Groups: []metav1.APIGroup{
|
||||
{
|
||||
Name: "apps",
|
||||
Versions: []metav1.GroupVersionForDiscovery{
|
||||
{
|
||||
GroupVersion: "apps/v2",
|
||||
Version: "v2",
|
||||
},
|
||||
{
|
||||
GroupVersion: "apps/v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
PreferredVersion: metav1.GroupVersionForDiscovery{
|
||||
GroupVersion: "apps/v2",
|
||||
Version: "v2",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{
|
||||
{Group: "apps", Version: "v1"}: {
|
||||
GroupVersion: "apps/v1",
|
||||
APIResources: []metav1.APIResource{
|
||||
{
|
||||
Name: "deployments",
|
||||
Namespaced: true,
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
},
|
||||
},
|
||||
{Group: "apps", Version: "v2"}: {
|
||||
GroupVersion: "apps/v2",
|
||||
APIResources: []metav1.APIResource{
|
||||
{
|
||||
Name: "deployments",
|
||||
Namespaced: true,
|
||||
Group: "apps",
|
||||
Version: "v2",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedFailedGVs: map[schema.GroupVersion]error{},
|
||||
},
|
||||
{
|
||||
name: "Aggregated discovery: 1 group/2 resources at /api, 1 group/2 resources at /apis",
|
||||
agg: apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "pods",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Pod",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "services",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Service",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "apps",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "statefulsets",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "StatefulSet",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroups: metav1.APIGroupList{
|
||||
Groups: []metav1.APIGroup{
|
||||
{
|
||||
Name: "",
|
||||
Versions: []metav1.GroupVersionForDiscovery{
|
||||
{
|
||||
GroupVersion: "v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
PreferredVersion: metav1.GroupVersionForDiscovery{
|
||||
GroupVersion: "v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "apps",
|
||||
Versions: []metav1.GroupVersionForDiscovery{
|
||||
{
|
||||
GroupVersion: "apps/v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
PreferredVersion: metav1.GroupVersionForDiscovery{
|
||||
GroupVersion: "apps/v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{
|
||||
{Group: "", Version: "v1"}: {
|
||||
GroupVersion: "v1",
|
||||
APIResources: []metav1.APIResource{
|
||||
{
|
||||
Name: "pods",
|
||||
Namespaced: true,
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Pod",
|
||||
},
|
||||
{
|
||||
Name: "services",
|
||||
Namespaced: true,
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Service",
|
||||
},
|
||||
},
|
||||
},
|
||||
{Group: "apps", Version: "v1"}: {
|
||||
GroupVersion: "apps/v1",
|
||||
APIResources: []metav1.APIResource{
|
||||
{
|
||||
Name: "deployments",
|
||||
Namespaced: true,
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
{
|
||||
Name: "statefulsets",
|
||||
Namespaced: true,
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "StatefulSet",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedFailedGVs: map[schema.GroupVersion]error{},
|
||||
},
|
||||
{
|
||||
name: "Aggregated discovery: multiple groups with cluster-scoped resources",
|
||||
agg: apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "pods",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Pod",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "namespaces",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Namespace",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeCluster,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "rbac.authorization.k8s.io",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "roles",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "rbac.authorization.k8s.io",
|
||||
Version: "v1",
|
||||
Kind: "Role",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeCluster,
|
||||
},
|
||||
{
|
||||
Resource: "clusterroles",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "rbac.authorization.k8s.io",
|
||||
Version: "v1",
|
||||
Kind: "ClusterRole",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeCluster,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroups: metav1.APIGroupList{
|
||||
Groups: []metav1.APIGroup{
|
||||
{
|
||||
Name: "",
|
||||
Versions: []metav1.GroupVersionForDiscovery{
|
||||
{
|
||||
GroupVersion: "v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
PreferredVersion: metav1.GroupVersionForDiscovery{
|
||||
GroupVersion: "v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "rbac.authorization.k8s.io",
|
||||
Versions: []metav1.GroupVersionForDiscovery{
|
||||
{
|
||||
GroupVersion: "rbac.authorization.k8s.io/v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
PreferredVersion: metav1.GroupVersionForDiscovery{
|
||||
GroupVersion: "rbac.authorization.k8s.io/v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{
|
||||
{Group: "", Version: "v1"}: {
|
||||
GroupVersion: "v1",
|
||||
APIResources: []metav1.APIResource{
|
||||
{
|
||||
Name: "pods",
|
||||
Namespaced: true,
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Pod",
|
||||
},
|
||||
{
|
||||
Name: "namespaces",
|
||||
Namespaced: false,
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Namespace",
|
||||
},
|
||||
},
|
||||
},
|
||||
{Group: "rbac.authorization.k8s.io", Version: "v1"}: {
|
||||
GroupVersion: "rbac.authorization.k8s.io/v1",
|
||||
APIResources: []metav1.APIResource{
|
||||
{
|
||||
Name: "roles",
|
||||
Namespaced: false,
|
||||
Group: "rbac.authorization.k8s.io",
|
||||
Version: "v1",
|
||||
Kind: "Role",
|
||||
},
|
||||
{
|
||||
Name: "clusterroles",
|
||||
Namespaced: false,
|
||||
Group: "rbac.authorization.k8s.io",
|
||||
Version: "v1",
|
||||
Kind: "ClusterRole",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedFailedGVs: map[schema.GroupVersion]error{},
|
||||
},
|
||||
{
|
||||
name: "Aggregated discovery with single subresource",
|
||||
agg: apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "apps",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
SingularResource: "deployment",
|
||||
ShortNames: []string{"deploy"},
|
||||
Verbs: []string{"parentverb1", "parentverb2", "parentverb3", "parentverb4"},
|
||||
Categories: []string{"all", "testcategory"},
|
||||
Subresources: []apidiscoveryv2beta1.APISubresourceDiscovery{
|
||||
{
|
||||
Subresource: "scale",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Verbs: []string{"get", "patch", "update"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroups: metav1.APIGroupList{
|
||||
Groups: []metav1.APIGroup{
|
||||
{
|
||||
Name: "apps",
|
||||
Versions: []metav1.GroupVersionForDiscovery{
|
||||
{
|
||||
GroupVersion: "apps/v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
PreferredVersion: metav1.GroupVersionForDiscovery{
|
||||
GroupVersion: "apps/v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{
|
||||
{Group: "apps", Version: "v1"}: {
|
||||
GroupVersion: "apps/v1",
|
||||
APIResources: []metav1.APIResource{
|
||||
{
|
||||
Name: "deployments",
|
||||
SingularName: "deployment",
|
||||
Namespaced: true,
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
Verbs: []string{"parentverb1", "parentverb2", "parentverb3", "parentverb4"},
|
||||
ShortNames: []string{"deploy"},
|
||||
Categories: []string{"all", "testcategory"},
|
||||
},
|
||||
{
|
||||
Name: "deployments/scale",
|
||||
SingularName: "deployment",
|
||||
Namespaced: true,
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
Verbs: []string{"get", "patch", "update"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedFailedGVs: map[schema.GroupVersion]error{},
|
||||
},
|
||||
{
|
||||
name: "Aggregated discovery with single subresource and parent missing GVK",
|
||||
agg: apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "external.metrics.k8s.io",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1beta1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
// resilient to nil GVK for parent
|
||||
Resource: "*",
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
SingularResource: "",
|
||||
Subresources: []apidiscoveryv2beta1.APISubresourceDiscovery{
|
||||
{
|
||||
Subresource: "other-external-metric",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Kind: "MetricValueList",
|
||||
},
|
||||
Verbs: []string{"get"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroups: metav1.APIGroupList{
|
||||
Groups: []metav1.APIGroup{
|
||||
{
|
||||
Name: "external.metrics.k8s.io",
|
||||
Versions: []metav1.GroupVersionForDiscovery{
|
||||
{
|
||||
GroupVersion: "external.metrics.k8s.io/v1beta1",
|
||||
Version: "v1beta1",
|
||||
},
|
||||
},
|
||||
PreferredVersion: metav1.GroupVersionForDiscovery{
|
||||
GroupVersion: "external.metrics.k8s.io/v1beta1",
|
||||
Version: "v1beta1",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{
|
||||
{Group: "external.metrics.k8s.io", Version: "v1beta1"}: {
|
||||
GroupVersion: "external.metrics.k8s.io/v1beta1",
|
||||
APIResources: []metav1.APIResource{
|
||||
// Since parent GVK was nil, it is NOT returned--only the subresource.
|
||||
{
|
||||
Name: "*/other-external-metric",
|
||||
SingularName: "",
|
||||
Namespaced: true,
|
||||
Group: "",
|
||||
Version: "",
|
||||
Kind: "MetricValueList",
|
||||
Verbs: []string{"get"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedFailedGVs: map[schema.GroupVersion]error{},
|
||||
},
|
||||
{
|
||||
name: "Aggregated discovery with single subresource and parent empty GVK",
|
||||
agg: apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "external.metrics.k8s.io",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1beta1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
// resilient to empty GVK for parent
|
||||
Resource: "*",
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
SingularResource: "",
|
||||
ResponseKind: &metav1.GroupVersionKind{},
|
||||
Subresources: []apidiscoveryv2beta1.APISubresourceDiscovery{
|
||||
{
|
||||
Subresource: "other-external-metric",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Kind: "MetricValueList",
|
||||
},
|
||||
Verbs: []string{"get"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroups: metav1.APIGroupList{
|
||||
Groups: []metav1.APIGroup{
|
||||
{
|
||||
Name: "external.metrics.k8s.io",
|
||||
Versions: []metav1.GroupVersionForDiscovery{
|
||||
{
|
||||
GroupVersion: "external.metrics.k8s.io/v1beta1",
|
||||
Version: "v1beta1",
|
||||
},
|
||||
},
|
||||
PreferredVersion: metav1.GroupVersionForDiscovery{
|
||||
GroupVersion: "external.metrics.k8s.io/v1beta1",
|
||||
Version: "v1beta1",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{
|
||||
{Group: "external.metrics.k8s.io", Version: "v1beta1"}: {
|
||||
GroupVersion: "external.metrics.k8s.io/v1beta1",
|
||||
APIResources: []metav1.APIResource{
|
||||
// Since parent GVK was nil, it is NOT returned--only the subresource.
|
||||
{
|
||||
Name: "*/other-external-metric",
|
||||
SingularName: "",
|
||||
Namespaced: true,
|
||||
Group: "",
|
||||
Version: "",
|
||||
Kind: "MetricValueList",
|
||||
Verbs: []string{"get"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedFailedGVs: map[schema.GroupVersion]error{},
|
||||
},
|
||||
{
|
||||
name: "Aggregated discovery with multiple subresources",
|
||||
agg: apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "apps",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
SingularResource: "deployment",
|
||||
Subresources: []apidiscoveryv2beta1.APISubresourceDiscovery{
|
||||
{
|
||||
Subresource: "scale",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Verbs: []string{"get", "patch", "update"},
|
||||
},
|
||||
{
|
||||
Subresource: "status",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Verbs: []string{"get", "patch", "update"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroups: metav1.APIGroupList{
|
||||
Groups: []metav1.APIGroup{
|
||||
{
|
||||
Name: "apps",
|
||||
Versions: []metav1.GroupVersionForDiscovery{
|
||||
{
|
||||
GroupVersion: "apps/v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
PreferredVersion: metav1.GroupVersionForDiscovery{
|
||||
GroupVersion: "apps/v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{
|
||||
{Group: "apps", Version: "v1"}: {
|
||||
GroupVersion: "apps/v1",
|
||||
APIResources: []metav1.APIResource{
|
||||
{
|
||||
Name: "deployments",
|
||||
SingularName: "deployment",
|
||||
Namespaced: true,
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
{
|
||||
Name: "deployments/scale",
|
||||
SingularName: "deployment",
|
||||
Namespaced: true,
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
Verbs: []string{"get", "patch", "update"},
|
||||
},
|
||||
{
|
||||
Name: "deployments/status",
|
||||
SingularName: "deployment",
|
||||
Namespaced: true,
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
Verbs: []string{"get", "patch", "update"},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedFailedGVs: map[schema.GroupVersion]error{},
|
||||
},
|
||||
{
|
||||
name: "Aggregated discovery: single failed GV at /api",
|
||||
agg: apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "pods",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Pod",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "services",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Service",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
// Single core Group/Version is stale, so no Version within Group.
|
||||
expectedGroups: metav1.APIGroupList{
|
||||
Groups: []metav1.APIGroup{{Name: ""}},
|
||||
},
|
||||
// Single core Group/Version is stale, so there are no expected resources.
|
||||
expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{},
|
||||
expectedFailedGVs: map[schema.GroupVersion]error{
|
||||
{Group: "", Version: "v1"}: StaleGroupVersionError{gv: schema.GroupVersion{Group: "", Version: "v1"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Aggregated discovery: single failed GV at /apis",
|
||||
agg: apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "apps",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "statefulsets",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "StatefulSets",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
// Single apps/v1 Group/Version is stale, so no Version within Group.
|
||||
expectedGroups: metav1.APIGroupList{
|
||||
Groups: []metav1.APIGroup{{Name: "apps"}},
|
||||
},
|
||||
// Single apps/v1 Group/Version is stale, so there are no expected resources.
|
||||
expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{},
|
||||
expectedFailedGVs: map[schema.GroupVersion]error{
|
||||
{Group: "apps", Version: "v1"}: StaleGroupVersionError{gv: schema.GroupVersion{Group: "apps", Version: "v1"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Aggregated discovery: 1 group/2 versions/1 failed GV at /apis",
|
||||
agg: apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "apps",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
// Stale v2 should report failed GV.
|
||||
{
|
||||
Version: "v2",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "daemonsets",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v2",
|
||||
Kind: "DaemonSets",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale,
|
||||
},
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
// Only apps/v1 is non-stale expected Group/Version
|
||||
expectedGroups: metav1.APIGroupList{
|
||||
Groups: []metav1.APIGroup{
|
||||
{
|
||||
Name: "apps",
|
||||
Versions: []metav1.GroupVersionForDiscovery{
|
||||
{
|
||||
GroupVersion: "apps/v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
// PreferredVersion must be apps/v1
|
||||
PreferredVersion: metav1.GroupVersionForDiscovery{
|
||||
GroupVersion: "apps/v1",
|
||||
Version: "v1",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
// Only apps/v1 resources expected.
|
||||
expectedGVResources: map[schema.GroupVersion]*metav1.APIResourceList{
|
||||
{Group: "apps", Version: "v1"}: {
|
||||
GroupVersion: "apps/v1",
|
||||
APIResources: []metav1.APIResource{
|
||||
{
|
||||
Name: "deployments",
|
||||
Namespaced: true,
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedFailedGVs: map[schema.GroupVersion]error{
|
||||
{Group: "apps", Version: "v2"}: StaleGroupVersionError{gv: schema.GroupVersion{Group: "apps", Version: "v2"}},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
apiGroups, resourcesByGV, failedGVs := SplitGroupsAndResourcesV2Beta1(test.agg)
|
||||
assert.Equal(t, test.expectedFailedGVs, failedGVs)
|
||||
assert.Equal(t, test.expectedGroups, *apiGroups)
|
||||
assert.Equal(t, test.expectedGVResources, resourcesByGV)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2beta1"
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -643,7 +643,7 @@ func TestCachedDiscoveryClientAggregatedServerGroups(t *testing.T) {
|
||||
return
|
||||
}
|
||||
// Content-type is "aggregated" discovery format.
|
||||
w.Header().Set("Content-Type", discovery.AcceptV2Beta1)
|
||||
w.Header().Set("Content-Type", discovery.AcceptV2)
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(output)
|
||||
}))
|
||||
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2beta1"
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2"
|
||||
errorsutil "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -1118,7 +1118,7 @@ func TestAggregatedMemCacheGroupsAndMaybeResources(t *testing.T) {
|
||||
output, err := json.Marshal(agg)
|
||||
require.NoError(t, err)
|
||||
// Content-type is "aggregated" discovery format.
|
||||
w.Header().Set("Content-Type", discovery.AcceptV2Beta1)
|
||||
w.Header().Set("Content-Type", discovery.AcceptV2)
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(output)
|
||||
}))
|
||||
@@ -1161,6 +1161,7 @@ func TestAggregatedMemCacheGroupsAndMaybeResources(t *testing.T) {
|
||||
memClient.Invalidate()
|
||||
assert.False(t, memClient.Fresh())
|
||||
apiGroupList, _, _, err = memClient.GroupsAndMaybeResources()
|
||||
|
||||
require.NoError(t, err)
|
||||
// Test the expected groups are returned for the aggregated format.
|
||||
actualGroupNames = sets.NewString(groupNamesFromList(apiGroupList)...)
|
||||
|
||||
@@ -33,7 +33,8 @@ import (
|
||||
"github.com/golang/protobuf/proto"
|
||||
openapi_v2 "github.com/google/gnostic-models/openapiv2"
|
||||
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2beta1"
|
||||
apidiscoveryv2 "k8s.io/api/apidiscovery/v2"
|
||||
apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -64,12 +65,14 @@ const (
|
||||
// MUST be ordered (g, v, as) for server in "Accept" header (BUT we are resilient
|
||||
// to ordering when comparing returned values in "Content-Type" header).
|
||||
AcceptV2Beta1 = runtime.ContentTypeJSON + ";" + "g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList"
|
||||
AcceptV2 = runtime.ContentTypeJSON + ";" + "g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList"
|
||||
// Prioritize aggregated discovery by placing first in the order of discovery accept types.
|
||||
acceptDiscoveryFormats = AcceptV2Beta1 + "," + AcceptV1
|
||||
acceptDiscoveryFormats = AcceptV2 + "," + AcceptV2Beta1 + "," + AcceptV1
|
||||
)
|
||||
|
||||
// Aggregated discovery content-type GVK.
|
||||
var v2Beta1GVK = schema.GroupVersionKind{Group: "apidiscovery.k8s.io", Version: "v2beta1", Kind: "APIGroupDiscoveryList"}
|
||||
var v2GVK = schema.GroupVersionKind{Group: "apidiscovery.k8s.io", Version: "v2", Kind: "APIGroupDiscoveryList"}
|
||||
|
||||
// DiscoveryInterface holds the methods that discover server-supported API groups,
|
||||
// versions and resources.
|
||||
@@ -265,13 +268,20 @@ func (d *DiscoveryClient) downloadLegacy() (
|
||||
|
||||
var resourcesByGV map[schema.GroupVersion]*metav1.APIResourceList
|
||||
// Based on the content-type server responded with: aggregated or unaggregated.
|
||||
if isGVK, _ := ContentTypeIsGVK(responseContentType, v2Beta1GVK); isGVK {
|
||||
var aggregatedDiscovery apidiscovery.APIGroupDiscoveryList
|
||||
if isGVK, _ := ContentTypeIsGVK(responseContentType, v2GVK); isGVK {
|
||||
var aggregatedDiscovery apidiscoveryv2.APIGroupDiscoveryList
|
||||
err = json.Unmarshal(body, &aggregatedDiscovery)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResources(aggregatedDiscovery)
|
||||
} else if isGVK, _ := ContentTypeIsGVK(responseContentType, v2Beta1GVK); isGVK {
|
||||
var aggregatedDiscovery apidiscoveryv2beta1.APIGroupDiscoveryList
|
||||
err = json.Unmarshal(body, &aggregatedDiscovery)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResourcesV2Beta1(aggregatedDiscovery)
|
||||
} else {
|
||||
// Default is unaggregated discovery v1.
|
||||
var v metav1.APIVersions
|
||||
@@ -317,13 +327,20 @@ func (d *DiscoveryClient) downloadAPIs() (
|
||||
failedGVs := map[schema.GroupVersion]error{}
|
||||
var resourcesByGV map[schema.GroupVersion]*metav1.APIResourceList
|
||||
// Based on the content-type server responded with: aggregated or unaggregated.
|
||||
if isGVK, _ := ContentTypeIsGVK(responseContentType, v2Beta1GVK); isGVK {
|
||||
var aggregatedDiscovery apidiscovery.APIGroupDiscoveryList
|
||||
if isGVK, _ := ContentTypeIsGVK(responseContentType, v2GVK); isGVK {
|
||||
var aggregatedDiscovery apidiscoveryv2.APIGroupDiscoveryList
|
||||
err = json.Unmarshal(body, &aggregatedDiscovery)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResources(aggregatedDiscovery)
|
||||
} else if isGVK, _ := ContentTypeIsGVK(responseContentType, v2Beta1GVK); isGVK {
|
||||
var aggregatedDiscovery apidiscoveryv2beta1.APIGroupDiscoveryList
|
||||
err = json.Unmarshal(body, &aggregatedDiscovery)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
apiGroupList, resourcesByGV, failedGVs = SplitGroupsAndResourcesV2Beta1(aggregatedDiscovery)
|
||||
} else {
|
||||
// Default is unaggregated discovery v1.
|
||||
err = json.Unmarshal(body, apiGroupList)
|
||||
|
||||
@@ -32,7 +32,8 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
golangproto "google.golang.org/protobuf/proto"
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2beta1"
|
||||
apidiscovery "k8s.io/api/apidiscovery/v2"
|
||||
apidiscoveryv2beta1 "k8s.io/api/apidiscovery/v2beta1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
@@ -58,7 +59,8 @@ func TestGetServerVersion(t *testing.T) {
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(output)
|
||||
_, err = w.Write(output)
|
||||
require.NoError(t, err)
|
||||
}))
|
||||
defer server.Close()
|
||||
client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL})
|
||||
@@ -104,7 +106,8 @@ func TestGetServerGroupsWithV1Server(t *testing.T) {
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(output)
|
||||
_, err = w.Write(output)
|
||||
require.NoError(t, err)
|
||||
}))
|
||||
defer server.Close()
|
||||
client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL})
|
||||
@@ -144,7 +147,8 @@ func TestDiscoveryToleratesMissingCoreGroup(t *testing.T) {
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(output)
|
||||
_, err = w.Write(output)
|
||||
require.NoError(t, err)
|
||||
}))
|
||||
defer server.Close()
|
||||
client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL})
|
||||
@@ -180,7 +184,8 @@ func TestDiscoveryFailsWhenNonCoreGroupsMissing(t *testing.T) {
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(output)
|
||||
_, err = w.Write(output)
|
||||
require.NoError(t, err)
|
||||
}))
|
||||
defer server.Close()
|
||||
client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL})
|
||||
@@ -380,7 +385,8 @@ func TestGetServerResourcesForGroupVersion(t *testing.T) {
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(output)
|
||||
_, err = w.Write(output)
|
||||
require.NoError(t, err)
|
||||
}))
|
||||
defer server.Close()
|
||||
for _, test := range tests {
|
||||
@@ -1294,6 +1300,8 @@ func TestAggregatedServerGroups(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||
var output []byte
|
||||
var err error
|
||||
var agg *apidiscovery.APIGroupDiscoveryList
|
||||
switch req.URL.Path {
|
||||
case "/api":
|
||||
@@ -1304,13 +1312,14 @@ func TestAggregatedServerGroups(t *testing.T) {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
output, err := json.Marshal(agg)
|
||||
output, err = json.Marshal(agg)
|
||||
require.NoError(t, err)
|
||||
// Content-Type is "aggregated" discovery format. Add extra parameter
|
||||
// to ensure we are resilient to these extra parameters.
|
||||
w.Header().Set("Content-Type", AcceptV2Beta1+"; charset=utf-8")
|
||||
w.Header().Set("Content-Type", AcceptV2+"; charset=utf-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(output)
|
||||
_, err = w.Write(output)
|
||||
require.NoError(t, err)
|
||||
}))
|
||||
defer server.Close()
|
||||
client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL})
|
||||
@@ -1338,7 +1347,9 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
corev1 *apidiscovery.APIGroupDiscoveryList
|
||||
corev1DiscoveryBeta *apidiscoveryv2beta1.APIGroupDiscoveryList
|
||||
apis *apidiscovery.APIGroupDiscoveryList
|
||||
apisDiscoveryBeta *apidiscoveryv2beta1.APIGroupDiscoveryList
|
||||
expectedGroupNames []string
|
||||
expectedGroupVersions []string
|
||||
expectedGVKs []string
|
||||
@@ -1368,6 +1379,28 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "pods",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Pod",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
apis: &apidiscovery.APIGroupDiscoveryList{
|
||||
Items: []apidiscovery.APIGroupDiscovery{
|
||||
{
|
||||
@@ -1393,6 +1426,31 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "apps",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroupNames: []string{"", "apps"},
|
||||
expectedGroupVersions: []string{"v1", "apps/v1"},
|
||||
expectedGVKs: []string{
|
||||
@@ -1424,6 +1482,28 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "pods",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Pod",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
apis: &apidiscovery.APIGroupDiscoveryList{
|
||||
Items: []apidiscovery.APIGroupDiscovery{
|
||||
{
|
||||
@@ -1463,6 +1543,45 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "apps",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Version: "v2",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v2",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroupNames: []string{"", "apps"},
|
||||
expectedGroupVersions: []string{"v1", "apps/v1", "apps/v2"},
|
||||
expectedGVKs: []string{
|
||||
@@ -1495,6 +1614,28 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "pods",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Pod",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
apis: &apidiscovery.APIGroupDiscoveryList{
|
||||
Items: []apidiscovery.APIGroupDiscovery{
|
||||
{
|
||||
@@ -1535,6 +1676,46 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "apps",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Version: "v2",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v2",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroupNames: []string{"", "apps"},
|
||||
expectedGroupVersions: []string{"v1", "apps/v1"},
|
||||
expectedGVKs: []string{
|
||||
@@ -1576,6 +1757,37 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "pods",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Pod",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "services",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Service",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
apis: &apidiscovery.APIGroupDiscoveryList{
|
||||
Items: []apidiscovery.APIGroupDiscovery{
|
||||
{
|
||||
@@ -1635,6 +1847,65 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "apps",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
// Stale "v2" version not included.
|
||||
{
|
||||
Version: "v2",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v2",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "statefulsets",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v2",
|
||||
Kind: "StatefulSet",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale,
|
||||
},
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "statefulsets",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "StatefulSet",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroupNames: []string{"", "apps"},
|
||||
expectedGroupVersions: []string{"v1", "apps/v1"},
|
||||
expectedGVKs: []string{
|
||||
@@ -1678,6 +1949,37 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "pods",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Pod",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "services",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "",
|
||||
Version: "v1",
|
||||
Kind: "Service",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
apis: &apidiscovery.APIGroupDiscoveryList{
|
||||
Items: []apidiscovery.APIGroupDiscovery{
|
||||
{
|
||||
@@ -1767,6 +2069,95 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "apps",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "statefulsets",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "StatefulSet",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "batch",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
// Stale Group/Version is not included
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "jobs",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "batch",
|
||||
Version: "v1",
|
||||
Kind: "Job",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "cronjobs",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "batch",
|
||||
Version: "v1",
|
||||
Kind: "CronJob",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale,
|
||||
},
|
||||
{
|
||||
Version: "v1beta1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "jobs",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "batch",
|
||||
Version: "v1beta1",
|
||||
Kind: "Job",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "cronjobs",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "batch",
|
||||
Version: "v1beta1",
|
||||
Kind: "CronJob",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroupNames: []string{"", "apps", "batch"},
|
||||
expectedGroupVersions: []string{"v1", "apps/v1", "batch/v1beta1"},
|
||||
expectedGVKs: []string{
|
||||
@@ -1780,8 +2171,9 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
expectedFailedGVs: []string{"batch/v1"},
|
||||
},
|
||||
{
|
||||
name: "Aggregated discovery: /api returns nothing, 2 groups/2 resources at /apis",
|
||||
corev1: &apidiscovery.APIGroupDiscoveryList{},
|
||||
name: "Aggregated discovery: /api returns nothing, 2 groups/2 resources at /apis",
|
||||
corev1: &apidiscovery.APIGroupDiscoveryList{},
|
||||
corev1DiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{},
|
||||
apis: &apidiscovery.APIGroupDiscoveryList{
|
||||
Items: []apidiscovery.APIGroupDiscovery{
|
||||
{
|
||||
@@ -1871,6 +2263,95 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
apisDiscoveryBeta: &apidiscoveryv2beta1.APIGroupDiscoveryList{
|
||||
Items: []apidiscoveryv2beta1.APIGroupDiscovery{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "apps",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "deployments",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "Deployment",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "statefulsets",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "apps",
|
||||
Version: "v1",
|
||||
Kind: "StatefulSet",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "batch",
|
||||
},
|
||||
Versions: []apidiscoveryv2beta1.APIVersionDiscovery{
|
||||
{
|
||||
Version: "v1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "jobs",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "batch",
|
||||
Version: "v1",
|
||||
Kind: "Job",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "cronjobs",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "batch",
|
||||
Version: "v1",
|
||||
Kind: "CronJob",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
// Stale "v1beta1" not included.
|
||||
Version: "v1beta1",
|
||||
Resources: []apidiscoveryv2beta1.APIResourceDiscovery{
|
||||
{
|
||||
Resource: "jobs",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "batch",
|
||||
Version: "v1beta1",
|
||||
Kind: "Job",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
{
|
||||
Resource: "cronjobs",
|
||||
ResponseKind: &metav1.GroupVersionKind{
|
||||
Group: "batch",
|
||||
Version: "v1beta1",
|
||||
Kind: "CronJob",
|
||||
},
|
||||
Scope: apidiscoveryv2beta1.ScopeNamespace,
|
||||
},
|
||||
},
|
||||
Freshness: apidiscoveryv2beta1.DiscoveryFreshnessStale,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expectedGroupNames: []string{"apps", "batch"},
|
||||
expectedGroupVersions: []string{"apps/v1", "batch/v1"},
|
||||
expectedGVKs: []string{
|
||||
@@ -1883,61 +2364,84 @@ func TestAggregatedServerGroupsAndResources(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
// Ensure that client can parse both V2Beta1 and V2 types from server
|
||||
serverAccepts := []string{AcceptV2Beta1, AcceptV2}
|
||||
for _, test := range tests {
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||
var agg *apidiscovery.APIGroupDiscoveryList
|
||||
switch req.URL.Path {
|
||||
case "/api":
|
||||
agg = test.corev1
|
||||
case "/apis":
|
||||
agg = test.apis
|
||||
default:
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
for _, accept := range serverAccepts {
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||
var output []byte
|
||||
var err error
|
||||
if accept == AcceptV2 {
|
||||
var agg *apidiscovery.APIGroupDiscoveryList
|
||||
switch req.URL.Path {
|
||||
case "/api":
|
||||
agg = test.corev1
|
||||
case "/apis":
|
||||
agg = test.apis
|
||||
default:
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
output, err = json.Marshal(agg)
|
||||
require.NoError(t, err)
|
||||
} else {
|
||||
var agg *apidiscoveryv2beta1.APIGroupDiscoveryList
|
||||
switch req.URL.Path {
|
||||
case "/api":
|
||||
agg = test.corev1DiscoveryBeta
|
||||
case "/apis":
|
||||
agg = test.apisDiscoveryBeta
|
||||
default:
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
output, err = json.Marshal(&agg)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
// Content-Type is "aggregated" discovery format. Add extra parameter
|
||||
// to ensure we are resilient to these extra parameters.
|
||||
w.Header().Set("Content-Type", accept+"; charset=utf-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
_, err = w.Write(output)
|
||||
require.NoError(t, err)
|
||||
|
||||
}))
|
||||
defer server.Close()
|
||||
client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL})
|
||||
apiGroups, resources, err := client.ServerGroupsAndResources()
|
||||
if len(test.expectedFailedGVs) > 0 {
|
||||
require.Error(t, err)
|
||||
expectedFailedGVs := sets.NewString(test.expectedFailedGVs...)
|
||||
actualFailedGVs := sets.NewString(failedGroupVersions(err)...)
|
||||
assert.True(t, expectedFailedGVs.Equal(actualFailedGVs),
|
||||
"%s: Expected Failed GVs (%s), got (%s)", test.name, expectedFailedGVs, actualFailedGVs)
|
||||
} else {
|
||||
require.NoError(t, err)
|
||||
}
|
||||
output, err := json.Marshal(agg)
|
||||
require.NoError(t, err)
|
||||
// Content-type is "aggregated" discovery format. Add extra parameter
|
||||
// to ensure we are resilient to these extra parameters.
|
||||
w.Header().Set("Content-Type", AcceptV2Beta1+"; charset=utf-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(output)
|
||||
}))
|
||||
defer server.Close()
|
||||
client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL})
|
||||
apiGroups, resources, err := client.ServerGroupsAndResources()
|
||||
if len(test.expectedFailedGVs) > 0 {
|
||||
require.Error(t, err)
|
||||
expectedFailedGVs := sets.NewString(test.expectedFailedGVs...)
|
||||
actualFailedGVs := sets.NewString(failedGroupVersions(err)...)
|
||||
assert.True(t, expectedFailedGVs.Equal(actualFailedGVs),
|
||||
"%s: Expected Failed GVs (%s), got (%s)", test.name, expectedFailedGVs, actualFailedGVs)
|
||||
} else {
|
||||
require.NoError(t, err)
|
||||
// Test the expected groups are returned for the aggregated format.
|
||||
expectedGroupNames := sets.NewString(test.expectedGroupNames...)
|
||||
actualGroupNames := sets.NewString(groupNames(apiGroups)...)
|
||||
assert.True(t, expectedGroupNames.Equal(actualGroupNames),
|
||||
"%s: Expected GVKs (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List())
|
||||
// If the core V1 group is returned from /api, it should be the first group.
|
||||
if expectedGroupNames.Has("") {
|
||||
assert.True(t, len(apiGroups) > 0)
|
||||
actualFirstGroup := apiGroups[0]
|
||||
assert.True(t, len(actualFirstGroup.Versions) > 0)
|
||||
actualFirstGroupVersion := actualFirstGroup.Versions[0].GroupVersion
|
||||
assert.Equal(t, "v1", actualFirstGroupVersion)
|
||||
}
|
||||
// Test the expected group/versions are returned from the aggregated discovery.
|
||||
expectedGroupVersions := sets.NewString(test.expectedGroupVersions...)
|
||||
actualGroupVersions := sets.NewString(groupVersions(resources)...)
|
||||
assert.True(t, expectedGroupVersions.Equal(actualGroupVersions),
|
||||
"%s: Expected GroupVersions(%s), got (%s)", test.name, expectedGroupVersions.List(), actualGroupVersions.List())
|
||||
// Test the expected GVKs are returned from the aggregated discovery.
|
||||
expectedGVKs := sets.NewString(test.expectedGVKs...)
|
||||
actualGVKs := sets.NewString(groupVersionKinds(resources)...)
|
||||
assert.True(t, expectedGVKs.Equal(actualGVKs),
|
||||
"%s: Expected GVKs (%s), got (%s)", test.name, expectedGVKs.List(), actualGVKs.List())
|
||||
}
|
||||
// Test the expected groups are returned for the aggregated format.
|
||||
expectedGroupNames := sets.NewString(test.expectedGroupNames...)
|
||||
actualGroupNames := sets.NewString(groupNames(apiGroups)...)
|
||||
assert.True(t, expectedGroupNames.Equal(actualGroupNames),
|
||||
"%s: Expected GVKs (%s), got (%s)", test.name, expectedGroupNames.List(), actualGroupNames.List())
|
||||
// If the core V1 group is returned from /api, it should be the first group.
|
||||
if expectedGroupNames.Has("") {
|
||||
assert.True(t, len(apiGroups) > 0)
|
||||
actualFirstGroup := apiGroups[0]
|
||||
assert.True(t, len(actualFirstGroup.Versions) > 0)
|
||||
actualFirstGroupVersion := actualFirstGroup.Versions[0].GroupVersion
|
||||
assert.Equal(t, "v1", actualFirstGroupVersion)
|
||||
}
|
||||
// Test the expected group/versions are returned from the aggregated discovery.
|
||||
expectedGroupVersions := sets.NewString(test.expectedGroupVersions...)
|
||||
actualGroupVersions := sets.NewString(groupVersions(resources)...)
|
||||
assert.True(t, expectedGroupVersions.Equal(actualGroupVersions),
|
||||
"%s: Expected GroupVersions(%s), got (%s)", test.name, expectedGroupVersions.List(), actualGroupVersions.List())
|
||||
// Test the expected GVKs are returned from the aggregated discovery.
|
||||
expectedGVKs := sets.NewString(test.expectedGVKs...)
|
||||
actualGVKs := sets.NewString(groupVersionKinds(resources)...)
|
||||
assert.True(t, expectedGVKs.Equal(actualGVKs),
|
||||
"%s: Expected GVKs (%s), got (%s)", test.name, expectedGVKs.List(), actualGVKs.List())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2023,8 +2527,10 @@ func TestAggregatedServerGroupsAndResourcesWithErrors(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||
var agg *apidiscovery.APIGroupDiscoveryList
|
||||
var output []byte
|
||||
var err error
|
||||
var status int
|
||||
var agg *apidiscovery.APIGroupDiscoveryList
|
||||
switch req.URL.Path {
|
||||
case "/api":
|
||||
agg = test.corev1
|
||||
@@ -2036,15 +2542,17 @@ func TestAggregatedServerGroupsAndResourcesWithErrors(t *testing.T) {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
output, err := json.Marshal(agg)
|
||||
output, err = json.Marshal(agg)
|
||||
require.NoError(t, err)
|
||||
// Content-type is "aggregated" discovery format. Add extra parameter
|
||||
// Content-Type is "aggregated" discovery format. Add extra parameter
|
||||
// to ensure we are resilient to these extra parameters.
|
||||
w.Header().Set("Content-Type", AcceptV2Beta1+"; charset=utf-8")
|
||||
w.Header().Set("Content-Type", AcceptV2+"; charset=utf-8")
|
||||
w.WriteHeader(status)
|
||||
w.Write(output)
|
||||
_, err = w.Write(output)
|
||||
require.NoError(t, err)
|
||||
}))
|
||||
defer server.Close()
|
||||
|
||||
client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL})
|
||||
apiGroups, resources, err := client.ServerGroupsAndResources()
|
||||
if test.expectedErr {
|
||||
@@ -2635,6 +3143,8 @@ func TestAggregatedServerPreferredResources(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||
var output []byte
|
||||
var err error
|
||||
var agg *apidiscovery.APIGroupDiscoveryList
|
||||
switch req.URL.Path {
|
||||
case "/api":
|
||||
@@ -2645,13 +3155,14 @@ func TestAggregatedServerPreferredResources(t *testing.T) {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
output, err := json.Marshal(agg)
|
||||
output, err = json.Marshal(agg)
|
||||
require.NoError(t, err)
|
||||
// Content-type is "aggregated" discovery format. Add extra parameter
|
||||
// Content-Type is "aggregated" discovery format. Add extra parameter
|
||||
// to ensure we are resilient to these extra parameters.
|
||||
w.Header().Set("Content-Type", AcceptV2Beta1+"; charset=utf-8")
|
||||
w.Header().Set("Content-Type", AcceptV2+"; charset=utf-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(output)
|
||||
_, err = w.Write(output)
|
||||
require.NoError(t, err)
|
||||
}))
|
||||
defer server.Close()
|
||||
client := NewDiscoveryClientForConfigOrDie(&restclient.Config{Host: server.URL})
|
||||
@@ -2674,7 +3185,7 @@ func TestAggregatedServerPreferredResources(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDiscoveryContentTypeVersion(t *testing.T) {
|
||||
v2beta1 := schema.GroupVersionKind{Group: "apidiscovery.k8s.io", Version: "v2beta1", Kind: "APIGroupDiscoveryList"}
|
||||
v2 := schema.GroupVersionKind{Group: "apidiscovery.k8s.io", Version: "v2", Kind: "APIGroupDiscoveryList"}
|
||||
tests := []struct {
|
||||
contentType string
|
||||
gvk schema.GroupVersionKind
|
||||
@@ -2682,59 +3193,59 @@ func TestDiscoveryContentTypeVersion(t *testing.T) {
|
||||
expectErr bool
|
||||
}{
|
||||
{
|
||||
contentType: "application/json; g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList",
|
||||
gvk: v2beta1,
|
||||
contentType: "application/json; g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList",
|
||||
gvk: v2,
|
||||
match: true,
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
// content-type parameters are not in correct order, but comparison ignores order.
|
||||
contentType: "application/json; v=v2beta1;as=APIGroupDiscoveryList;g=apidiscovery.k8s.io",
|
||||
gvk: v2beta1,
|
||||
contentType: "application/json; v=v2;as=APIGroupDiscoveryList;g=apidiscovery.k8s.io",
|
||||
gvk: v2,
|
||||
match: true,
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
// content-type parameters are not in correct order, but comparison ignores order.
|
||||
contentType: "application/json; as=APIGroupDiscoveryList;g=apidiscovery.k8s.io;v=v2beta1",
|
||||
gvk: v2beta1,
|
||||
contentType: "application/json; as=APIGroupDiscoveryList;g=apidiscovery.k8s.io;v=v2",
|
||||
gvk: v2,
|
||||
match: true,
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
// Ignores extra parameter "charset=utf-8"
|
||||
contentType: "application/json; g=apidiscovery.k8s.io;v=v2beta1;as=APIGroupDiscoveryList;charset=utf-8",
|
||||
gvk: v2beta1,
|
||||
contentType: "application/json; g=apidiscovery.k8s.io;v=v2;as=APIGroupDiscoveryList;charset=utf-8",
|
||||
gvk: v2,
|
||||
match: true,
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
contentType: "application/json",
|
||||
gvk: v2beta1,
|
||||
gvk: v2,
|
||||
match: false,
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
contentType: "application/json; charset=UTF-8",
|
||||
gvk: v2beta1,
|
||||
gvk: v2,
|
||||
match: false,
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
contentType: "text/json",
|
||||
gvk: v2beta1,
|
||||
gvk: v2,
|
||||
match: false,
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
contentType: "text/html",
|
||||
gvk: v2beta1,
|
||||
gvk: v2,
|
||||
match: false,
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
contentType: "",
|
||||
gvk: v2beta1,
|
||||
gvk: v2,
|
||||
match: false,
|
||||
expectErr: true,
|
||||
},
|
||||
|
||||
2
discovery/testdata/apis/batch/v1.json
vendored
2
discovery/testdata/apis/batch/v1.json
vendored
File diff suppressed because one or more lines are too long
2
discovery/testdata/apis/batch/v1beta1.json
vendored
2
discovery/testdata/apis/batch/v1beta1.json
vendored
File diff suppressed because one or more lines are too long
248
dynamic/golden_test.go
Normal file
248
dynamic/golden_test.go
Normal file
@@ -0,0 +1,248 @@
|
||||
/*
|
||||
Copyright 2024 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package dynamic_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/http/httputil"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/client-go/dynamic"
|
||||
"k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
func TestGoldenRequest(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
do func(context.Context, dynamic.Interface) error
|
||||
}{
|
||||
{
|
||||
name: "create",
|
||||
do: func(ctx context.Context, client dynamic.Interface) error {
|
||||
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Create(
|
||||
ctx,
|
||||
&unstructured.Unstructured{Object: map[string]interface{}{
|
||||
"metadata": map[string]interface{}{"name": "mips"},
|
||||
}},
|
||||
metav1.CreateOptions{FieldValidation: "warn"},
|
||||
"fin",
|
||||
)
|
||||
return err
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "update",
|
||||
do: func(ctx context.Context, client dynamic.Interface) error {
|
||||
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Update(
|
||||
ctx,
|
||||
&unstructured.Unstructured{Object: map[string]interface{}{
|
||||
"metadata": map[string]interface{}{"name": "mips"},
|
||||
}},
|
||||
metav1.UpdateOptions{FieldValidation: "warn"},
|
||||
"fin",
|
||||
)
|
||||
return err
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "updatestatus",
|
||||
do: func(ctx context.Context, client dynamic.Interface) error {
|
||||
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").UpdateStatus(
|
||||
ctx,
|
||||
&unstructured.Unstructured{Object: map[string]interface{}{
|
||||
"metadata": map[string]interface{}{"name": "mips"},
|
||||
}},
|
||||
metav1.UpdateOptions{FieldValidation: "warn"},
|
||||
)
|
||||
return err
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "delete",
|
||||
do: func(ctx context.Context, client dynamic.Interface) error {
|
||||
return client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Delete(
|
||||
ctx,
|
||||
"mips",
|
||||
metav1.DeleteOptions{DryRun: []string{metav1.DryRunAll}},
|
||||
"fin",
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "deletecollection",
|
||||
do: func(ctx context.Context, client dynamic.Interface) error {
|
||||
return client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").DeleteCollection(
|
||||
ctx,
|
||||
metav1.DeleteOptions{DryRun: []string{metav1.DryRunAll}},
|
||||
metav1.ListOptions{ResourceVersion: "42"},
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "get",
|
||||
do: func(ctx context.Context, client dynamic.Interface) error {
|
||||
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Get(
|
||||
ctx,
|
||||
"mips",
|
||||
metav1.GetOptions{ResourceVersion: "42"},
|
||||
"fin",
|
||||
)
|
||||
return err
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "list",
|
||||
do: func(ctx context.Context, client dynamic.Interface) error {
|
||||
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").List(
|
||||
ctx,
|
||||
metav1.ListOptions{ResourceVersion: "42"},
|
||||
)
|
||||
return err
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "watch",
|
||||
do: func(ctx context.Context, client dynamic.Interface) error {
|
||||
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Watch(
|
||||
ctx,
|
||||
metav1.ListOptions{ResourceVersion: "42"},
|
||||
)
|
||||
return err
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "patch",
|
||||
do: func(ctx context.Context, client dynamic.Interface) error {
|
||||
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Patch(
|
||||
ctx,
|
||||
"mips",
|
||||
types.StrategicMergePatchType,
|
||||
[]byte("{\"foo\":\"bar\"}\n"),
|
||||
metav1.PatchOptions{FieldManager: "baz"},
|
||||
"fin",
|
||||
)
|
||||
return err
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "apply",
|
||||
do: func(ctx context.Context, client dynamic.Interface) error {
|
||||
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Apply(
|
||||
ctx,
|
||||
"mips",
|
||||
&unstructured.Unstructured{Object: map[string]interface{}{
|
||||
"metadata": map[string]interface{}{"name": "mips"},
|
||||
}},
|
||||
metav1.ApplyOptions{Force: true},
|
||||
"fin",
|
||||
)
|
||||
return err
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "applystatus",
|
||||
do: func(ctx context.Context, client dynamic.Interface) error {
|
||||
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").ApplyStatus(
|
||||
ctx,
|
||||
"mips",
|
||||
&unstructured.Unstructured{Object: map[string]interface{}{
|
||||
"metadata": map[string]interface{}{"name": "mips"},
|
||||
}},
|
||||
metav1.ApplyOptions{Force: true},
|
||||
)
|
||||
return err
|
||||
},
|
||||
},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
handled := make(chan struct{})
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
defer close(handled)
|
||||
|
||||
got, err := httputil.DumpRequest(r, true)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
path := filepath.Join("testdata", filepath.FromSlash(t.Name()))
|
||||
|
||||
if os.Getenv("UPDATE_DYNAMIC_CLIENT_FIXTURES") == "true" {
|
||||
err := os.WriteFile(path, got, os.FileMode(0755))
|
||||
if err != nil {
|
||||
t.Fatalf("failed to update fixture: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
want, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to load fixture: %v", err)
|
||||
}
|
||||
if diff := cmp.Diff(got, want); diff != "" {
|
||||
t.Errorf("unexpected difference from expected bytes:\n%s", diff)
|
||||
}
|
||||
}))
|
||||
defer srv.Close()
|
||||
|
||||
client, err := dynamic.NewForConfig(&rest.Config{
|
||||
Host: "example.com",
|
||||
UserAgent: "TestGoldenRequest",
|
||||
Transport: &http.Transport{
|
||||
// The client will send a static Host header while always
|
||||
// connecting to the test server.
|
||||
DialContext: func(ctx context.Context, network string, addr string) (net.Conn, error) {
|
||||
u, err := url.Parse(srv.URL)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse test server url: %w", err)
|
||||
}
|
||||
return (&net.Dialer{}).DialContext(ctx, "tcp", u.Host)
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
||||
defer cancel()
|
||||
if err := tc.do(ctx, client); err != nil {
|
||||
// This test detects server-perceptible changes to the request. As
|
||||
// long as the server receives the expected request, a non-nil error
|
||||
// returned from a client method is not a failure.
|
||||
t.Logf("client returned non-nil error: %v", err)
|
||||
}
|
||||
|
||||
select {
|
||||
case <-handled:
|
||||
default:
|
||||
t.Fatal("no request received")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/util/consistencydetector"
|
||||
)
|
||||
|
||||
type DynamicClient struct {
|
||||
@@ -292,7 +293,16 @@ func (c *dynamicResourceClient) Get(ctx context.Context, name string, opts metav
|
||||
return uncastObj.(*unstructured.Unstructured), nil
|
||||
}
|
||||
|
||||
func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) {
|
||||
func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (result *unstructured.UnstructuredList, err error) {
|
||||
defer func() {
|
||||
if err == nil {
|
||||
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, fmt.Sprintf("list request for %v", c.resource), c.list, opts, result)
|
||||
}
|
||||
}()
|
||||
return c.list(ctx, opts)
|
||||
}
|
||||
|
||||
func (c *dynamicResourceClient) list(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) {
|
||||
if err := validateNamespaceWithOptionalName(c.namespace); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
9
dynamic/testdata/TestGoldenRequest/apply
vendored
Executable file
9
dynamic/testdata/TestGoldenRequest/apply
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
PATCH /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?force=true HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Accept-Encoding: gzip
|
||||
Content-Length: 29
|
||||
Content-Type: application/apply-patch+yaml
|
||||
User-Agent: TestGoldenRequest
|
||||
|
||||
{"metadata":{"name":"mips"}}
|
||||
9
dynamic/testdata/TestGoldenRequest/applystatus
vendored
Executable file
9
dynamic/testdata/TestGoldenRequest/applystatus
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
PATCH /apis/flops/v1alpha1/namespaces/mops/flips/mips/status?force=true HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Accept-Encoding: gzip
|
||||
Content-Length: 29
|
||||
Content-Type: application/apply-patch+yaml
|
||||
User-Agent: TestGoldenRequest
|
||||
|
||||
{"metadata":{"name":"mips"}}
|
||||
9
dynamic/testdata/TestGoldenRequest/create
vendored
Executable file
9
dynamic/testdata/TestGoldenRequest/create
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
POST /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?fieldValidation=warn HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Accept-Encoding: gzip
|
||||
Content-Length: 29
|
||||
Content-Type: application/json
|
||||
User-Agent: TestGoldenRequest
|
||||
|
||||
{"metadata":{"name":"mips"}}
|
||||
9
dynamic/testdata/TestGoldenRequest/delete
vendored
Executable file
9
dynamic/testdata/TestGoldenRequest/delete
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
DELETE /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Accept-Encoding: gzip
|
||||
Content-Length: 60
|
||||
Content-Type: application/json
|
||||
User-Agent: TestGoldenRequest
|
||||
|
||||
{"kind":"DeleteOptions","apiVersion":"v1","dryRun":["All"]}
|
||||
9
dynamic/testdata/TestGoldenRequest/deletecollection
vendored
Executable file
9
dynamic/testdata/TestGoldenRequest/deletecollection
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
DELETE /apis/flops/v1alpha1/namespaces/mops/flips?resourceVersion=42 HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Accept-Encoding: gzip
|
||||
Content-Length: 60
|
||||
Content-Type: application/json
|
||||
User-Agent: TestGoldenRequest
|
||||
|
||||
{"kind":"DeleteOptions","apiVersion":"v1","dryRun":["All"]}
|
||||
6
dynamic/testdata/TestGoldenRequest/get
vendored
Executable file
6
dynamic/testdata/TestGoldenRequest/get
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
GET /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?resourceVersion=42 HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Accept-Encoding: gzip
|
||||
User-Agent: TestGoldenRequest
|
||||
|
||||
6
dynamic/testdata/TestGoldenRequest/list
vendored
Executable file
6
dynamic/testdata/TestGoldenRequest/list
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
GET /apis/flops/v1alpha1/namespaces/mops/flips?resourceVersion=42 HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Accept-Encoding: gzip
|
||||
User-Agent: TestGoldenRequest
|
||||
|
||||
9
dynamic/testdata/TestGoldenRequest/patch
vendored
Executable file
9
dynamic/testdata/TestGoldenRequest/patch
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
PATCH /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?fieldManager=baz HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Accept-Encoding: gzip
|
||||
Content-Length: 14
|
||||
Content-Type: application/strategic-merge-patch+json
|
||||
User-Agent: TestGoldenRequest
|
||||
|
||||
{"foo":"bar"}
|
||||
9
dynamic/testdata/TestGoldenRequest/update
vendored
Executable file
9
dynamic/testdata/TestGoldenRequest/update
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
PUT /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?fieldValidation=warn HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Accept-Encoding: gzip
|
||||
Content-Length: 29
|
||||
Content-Type: application/json
|
||||
User-Agent: TestGoldenRequest
|
||||
|
||||
{"metadata":{"name":"mips"}}
|
||||
9
dynamic/testdata/TestGoldenRequest/updatestatus
vendored
Executable file
9
dynamic/testdata/TestGoldenRequest/updatestatus
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
PUT /apis/flops/v1alpha1/namespaces/mops/flips/mips/status?fieldValidation=warn HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Accept-Encoding: gzip
|
||||
Content-Length: 29
|
||||
Content-Type: application/json
|
||||
User-Agent: TestGoldenRequest
|
||||
|
||||
{"metadata":{"name":"mips"}}
|
||||
6
dynamic/testdata/TestGoldenRequest/watch
vendored
Executable file
6
dynamic/testdata/TestGoldenRequest/watch
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
GET /apis/flops/v1alpha1/namespaces/mops/flips?resourceVersion=42&watch=true HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Accept-Encoding: gzip
|
||||
User-Agent: TestGoldenRequest
|
||||
|
||||
@@ -37,12 +37,12 @@ import (
|
||||
// Controller demonstrates how to implement a controller with client-go.
|
||||
type Controller struct {
|
||||
indexer cache.Indexer
|
||||
queue workqueue.RateLimitingInterface
|
||||
queue workqueue.TypedRateLimitingInterface[string]
|
||||
informer cache.Controller
|
||||
}
|
||||
|
||||
// NewController creates a new Controller.
|
||||
func NewController(queue workqueue.RateLimitingInterface, indexer cache.Indexer, informer cache.Controller) *Controller {
|
||||
func NewController(queue workqueue.TypedRateLimitingInterface[string], indexer cache.Indexer, informer cache.Controller) *Controller {
|
||||
return &Controller{
|
||||
informer: informer,
|
||||
indexer: indexer,
|
||||
@@ -62,7 +62,7 @@ func (c *Controller) processNextItem() bool {
|
||||
defer c.queue.Done(key)
|
||||
|
||||
// Invoke the method containing the business logic
|
||||
err := c.syncToStdout(key.(string))
|
||||
err := c.syncToStdout(key)
|
||||
// Handle the error if something went wrong during the execution of the business logic
|
||||
c.handleErr(err, key)
|
||||
return true
|
||||
@@ -90,7 +90,7 @@ func (c *Controller) syncToStdout(key string) error {
|
||||
}
|
||||
|
||||
// handleErr checks if an error happened and makes sure we will retry later.
|
||||
func (c *Controller) handleErr(err error, key interface{}) {
|
||||
func (c *Controller) handleErr(err error, key string) {
|
||||
if err == nil {
|
||||
// Forget about the #AddRateLimited history of the key on every successful synchronization.
|
||||
// This ensures that future processing of updates for this key is not delayed because of
|
||||
@@ -168,7 +168,7 @@ func main() {
|
||||
podListWatcher := cache.NewListWatchFromClient(clientset.CoreV1().RESTClient(), "pods", v1.NamespaceDefault, fields.Everything())
|
||||
|
||||
// create the workqueue
|
||||
queue := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter())
|
||||
queue := workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]())
|
||||
|
||||
// Bind the workqueue to a cache with the help of an informer. This way we make sure that
|
||||
// whenever the cache is updated, the pod key is added to the workqueue.
|
||||
|
||||
@@ -47,6 +47,10 @@ var _ Gates = &envVarFeatureGates{}
|
||||
//
|
||||
// Please note that environmental variables can only be set to the boolean value.
|
||||
// Incorrect values will be ignored and logged.
|
||||
//
|
||||
// Features can also be set directly via the Set method.
|
||||
// In that case, these features take precedence over
|
||||
// features set via environmental variables.
|
||||
func newEnvVarFeatureGates(features map[Feature]FeatureSpec) *envVarFeatureGates {
|
||||
known := map[Feature]FeatureSpec{}
|
||||
for name, spec := range features {
|
||||
@@ -57,7 +61,8 @@ func newEnvVarFeatureGates(features map[Feature]FeatureSpec) *envVarFeatureGates
|
||||
callSiteName: naming.GetNameFromCallsite(internalPackages...),
|
||||
known: known,
|
||||
}
|
||||
fg.enabled.Store(map[Feature]bool{})
|
||||
fg.enabledViaEnvVar.Store(map[Feature]bool{})
|
||||
fg.enabledViaSetMethod = map[Feature]bool{}
|
||||
|
||||
return fg
|
||||
}
|
||||
@@ -74,17 +79,34 @@ type envVarFeatureGates struct {
|
||||
// known holds known feature gates
|
||||
known map[Feature]FeatureSpec
|
||||
|
||||
// enabled holds a map[Feature]bool
|
||||
// enabledViaEnvVar holds a map[Feature]bool
|
||||
// with values explicitly set via env var
|
||||
enabled atomic.Value
|
||||
enabledViaEnvVar atomic.Value
|
||||
|
||||
// lockEnabledViaSetMethod protects enabledViaSetMethod
|
||||
lockEnabledViaSetMethod sync.RWMutex
|
||||
|
||||
// enabledViaSetMethod holds values explicitly set
|
||||
// via Set method, features stored in this map take
|
||||
// precedence over features stored in enabledViaEnvVar
|
||||
enabledViaSetMethod map[Feature]bool
|
||||
|
||||
// readEnvVars holds the boolean value which
|
||||
// indicates whether readEnvVarsOnce has been called.
|
||||
readEnvVars atomic.Bool
|
||||
}
|
||||
|
||||
// Enabled returns true if the key is enabled. If the key is not known, this call will panic.
|
||||
// Enabled returns true if the key is enabled. If the key is not known, this call will panic.
|
||||
func (f *envVarFeatureGates) Enabled(key Feature) bool {
|
||||
if v, ok := f.wasFeatureEnabledViaSetMethod(key); ok {
|
||||
// ensue that the state of all known features
|
||||
// is loaded from environment variables
|
||||
// on the first call to Enabled method.
|
||||
if !f.hasAlreadyReadEnvVar() {
|
||||
_ = f.getEnabledMapFromEnvVar()
|
||||
}
|
||||
return v
|
||||
}
|
||||
if v, ok := f.getEnabledMapFromEnvVar()[key]; ok {
|
||||
return v
|
||||
}
|
||||
@@ -94,6 +116,26 @@ func (f *envVarFeatureGates) Enabled(key Feature) bool {
|
||||
panic(fmt.Errorf("feature %q is not registered in FeatureGates %q", key, f.callSiteName))
|
||||
}
|
||||
|
||||
// Set sets the given feature to the given value.
|
||||
//
|
||||
// Features set via this method take precedence over
|
||||
// the features set via environment variables.
|
||||
func (f *envVarFeatureGates) Set(featureName Feature, featureValue bool) error {
|
||||
feature, ok := f.known[featureName]
|
||||
if !ok {
|
||||
return fmt.Errorf("feature %q is not registered in FeatureGates %q", featureName, f.callSiteName)
|
||||
}
|
||||
if feature.LockToDefault && feature.Default != featureValue {
|
||||
return fmt.Errorf("cannot set feature gate %q to %v, feature is locked to %v", featureName, featureValue, feature.Default)
|
||||
}
|
||||
|
||||
f.lockEnabledViaSetMethod.Lock()
|
||||
defer f.lockEnabledViaSetMethod.Unlock()
|
||||
f.enabledViaSetMethod[featureName] = featureValue
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// getEnabledMapFromEnvVar will fill the enabled map on the first call.
|
||||
// This is the only time a known feature can be set to a value
|
||||
// read from the corresponding environmental variable.
|
||||
@@ -119,7 +161,7 @@ func (f *envVarFeatureGates) getEnabledMapFromEnvVar() map[Feature]bool {
|
||||
featureGatesState[feature] = boolVal
|
||||
}
|
||||
}
|
||||
f.enabled.Store(featureGatesState)
|
||||
f.enabledViaEnvVar.Store(featureGatesState)
|
||||
f.readEnvVars.Store(true)
|
||||
|
||||
for feature, featureSpec := range f.known {
|
||||
@@ -130,7 +172,15 @@ func (f *envVarFeatureGates) getEnabledMapFromEnvVar() map[Feature]bool {
|
||||
klog.V(1).InfoS("Feature gate default state", "feature", feature, "enabled", featureSpec.Default)
|
||||
}
|
||||
})
|
||||
return f.enabled.Load().(map[Feature]bool)
|
||||
return f.enabledViaEnvVar.Load().(map[Feature]bool)
|
||||
}
|
||||
|
||||
func (f *envVarFeatureGates) wasFeatureEnabledViaSetMethod(key Feature) (bool, bool) {
|
||||
f.lockEnabledViaSetMethod.RLock()
|
||||
defer f.lockEnabledViaSetMethod.RUnlock()
|
||||
|
||||
value, found := f.enabledViaSetMethod[key]
|
||||
return value, found
|
||||
}
|
||||
|
||||
func (f *envVarFeatureGates) hasAlreadyReadEnvVar() bool {
|
||||
|
||||
@@ -23,21 +23,21 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestEnvVarFeatureGates(t *testing.T) {
|
||||
defaultTestFeatures := map[Feature]FeatureSpec{
|
||||
"TestAlpha": {
|
||||
Default: false,
|
||||
LockToDefault: false,
|
||||
PreRelease: "Alpha",
|
||||
},
|
||||
"TestBeta": {
|
||||
Default: true,
|
||||
LockToDefault: false,
|
||||
PreRelease: "Beta",
|
||||
},
|
||||
}
|
||||
expectedDefaultFeaturesState := map[Feature]bool{"TestAlpha": false, "TestBeta": true}
|
||||
var defaultTestFeatures = map[Feature]FeatureSpec{
|
||||
"TestAlpha": {
|
||||
Default: false,
|
||||
LockToDefault: false,
|
||||
PreRelease: "Alpha",
|
||||
},
|
||||
"TestBeta": {
|
||||
Default: true,
|
||||
LockToDefault: false,
|
||||
PreRelease: "Beta",
|
||||
},
|
||||
}
|
||||
|
||||
func TestEnvVarFeatureGates(t *testing.T) {
|
||||
expectedDefaultFeaturesState := map[Feature]bool{"TestAlpha": false, "TestBeta": true}
|
||||
copyExpectedStateMap := func(toCopy map[Feature]bool) map[Feature]bool {
|
||||
m := map[Feature]bool{}
|
||||
for k, v := range toCopy {
|
||||
@@ -47,11 +47,14 @@ func TestEnvVarFeatureGates(t *testing.T) {
|
||||
}
|
||||
|
||||
scenarios := []struct {
|
||||
name string
|
||||
features map[Feature]FeatureSpec
|
||||
envVariables map[string]string
|
||||
expectedFeaturesState map[Feature]bool
|
||||
expectedInternalEnabledFeatureState map[Feature]bool
|
||||
name string
|
||||
features map[Feature]FeatureSpec
|
||||
envVariables map[string]string
|
||||
setMethodFeatures map[Feature]bool
|
||||
|
||||
expectedFeaturesState map[Feature]bool
|
||||
expectedInternalEnabledViaEnvVarFeatureState map[Feature]bool
|
||||
expectedInternalEnabledViaSetMethodFeatureState map[Feature]bool
|
||||
}{
|
||||
{
|
||||
name: "can add empty features",
|
||||
@@ -76,7 +79,7 @@ func TestEnvVarFeatureGates(t *testing.T) {
|
||||
expectedDefaultFeaturesStateCopy["TestAlpha"] = true
|
||||
return expectedDefaultFeaturesStateCopy
|
||||
}(),
|
||||
expectedInternalEnabledFeatureState: map[Feature]bool{"TestAlpha": true},
|
||||
expectedInternalEnabledViaEnvVarFeatureState: map[Feature]bool{"TestAlpha": true},
|
||||
},
|
||||
{
|
||||
name: "incorrect env var value gets ignored",
|
||||
@@ -111,9 +114,25 @@ func TestEnvVarFeatureGates(t *testing.T) {
|
||||
PreRelease: "Alpha",
|
||||
},
|
||||
},
|
||||
envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "True"},
|
||||
expectedFeaturesState: map[Feature]bool{"TestAlpha": true},
|
||||
expectedInternalEnabledFeatureState: map[Feature]bool{"TestAlpha": true},
|
||||
envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "True"},
|
||||
expectedFeaturesState: map[Feature]bool{"TestAlpha": true},
|
||||
expectedInternalEnabledViaEnvVarFeatureState: map[Feature]bool{"TestAlpha": true},
|
||||
},
|
||||
{
|
||||
name: "setting a feature via the Set method works",
|
||||
features: defaultTestFeatures,
|
||||
setMethodFeatures: map[Feature]bool{"TestAlpha": true},
|
||||
expectedFeaturesState: map[Feature]bool{"TestAlpha": true},
|
||||
expectedInternalEnabledViaSetMethodFeatureState: map[Feature]bool{"TestAlpha": true},
|
||||
},
|
||||
{
|
||||
name: "setting a feature via the Set method wins",
|
||||
features: defaultTestFeatures,
|
||||
setMethodFeatures: map[Feature]bool{"TestAlpha": false},
|
||||
envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "True"},
|
||||
expectedFeaturesState: map[Feature]bool{"TestAlpha": false},
|
||||
expectedInternalEnabledViaEnvVarFeatureState: map[Feature]bool{"TestAlpha": true},
|
||||
expectedInternalEnabledViaSetMethodFeatureState: map[Feature]bool{"TestAlpha": false},
|
||||
},
|
||||
}
|
||||
for _, scenario := range scenarios {
|
||||
@@ -123,20 +142,33 @@ func TestEnvVarFeatureGates(t *testing.T) {
|
||||
}
|
||||
target := newEnvVarFeatureGates(scenario.features)
|
||||
|
||||
for k, v := range scenario.setMethodFeatures {
|
||||
err := target.Set(k, v)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
for expectedFeature, expectedValue := range scenario.expectedFeaturesState {
|
||||
actualValue := target.Enabled(expectedFeature)
|
||||
require.Equal(t, actualValue, expectedValue, "expected feature=%v, to be=%v, not=%v", expectedFeature, expectedValue, actualValue)
|
||||
}
|
||||
|
||||
enabledInternalMap := target.enabled.Load().(map[Feature]bool)
|
||||
require.Len(t, enabledInternalMap, len(scenario.expectedInternalEnabledFeatureState))
|
||||
enabledViaEnvVarInternalMap := target.enabledViaEnvVar.Load().(map[Feature]bool)
|
||||
require.Len(t, enabledViaEnvVarInternalMap, len(scenario.expectedInternalEnabledViaEnvVarFeatureState))
|
||||
for expectedFeatureName, expectedFeatureValue := range scenario.expectedInternalEnabledViaEnvVarFeatureState {
|
||||
actualFeatureValue, wasExpectedFeatureFound := enabledViaEnvVarInternalMap[expectedFeatureName]
|
||||
if !wasExpectedFeatureFound {
|
||||
t.Errorf("feature %v has not been found in enabledViaEnvVarInternalMap", expectedFeatureName)
|
||||
}
|
||||
require.Equal(t, expectedFeatureValue, actualFeatureValue, "feature %v has incorrect value = %v, expected = %v", expectedFeatureName, actualFeatureValue, expectedFeatureValue)
|
||||
}
|
||||
|
||||
for expectedFeature, expectedInternalPresence := range scenario.expectedInternalEnabledFeatureState {
|
||||
featureInternalValue, featureSet := enabledInternalMap[expectedFeature]
|
||||
require.Equal(t, expectedInternalPresence, featureSet, "feature %v present = %v, expected = %v", expectedFeature, featureSet, expectedInternalPresence)
|
||||
|
||||
expectedFeatureInternalValue := scenario.expectedFeaturesState[expectedFeature]
|
||||
require.Equal(t, expectedFeatureInternalValue, featureInternalValue)
|
||||
enabledViaSetMethodInternalMap := target.enabledViaSetMethod
|
||||
require.Len(t, enabledViaSetMethodInternalMap, len(scenario.expectedInternalEnabledViaSetMethodFeatureState))
|
||||
for expectedFeatureName, expectedFeatureValue := range scenario.expectedInternalEnabledViaSetMethodFeatureState {
|
||||
actualFeatureValue, wasExpectedFeatureFound := enabledViaSetMethodInternalMap[expectedFeatureName]
|
||||
if !wasExpectedFeatureFound {
|
||||
t.Errorf("feature %v has not been found in enabledViaSetMethod", expectedFeatureName)
|
||||
}
|
||||
require.Equal(t, expectedFeatureValue, actualFeatureValue, "feature %v has incorrect value = %v, expected = %v", expectedFeatureName, actualFeatureValue, expectedFeatureValue)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -154,3 +186,48 @@ func TestHasAlreadyReadEnvVar(t *testing.T) {
|
||||
_ = target.getEnabledMapFromEnvVar()
|
||||
require.True(t, target.hasAlreadyReadEnvVar())
|
||||
}
|
||||
|
||||
func TestEnvVarFeatureGatesSetNegative(t *testing.T) {
|
||||
scenarios := []struct {
|
||||
name string
|
||||
features map[Feature]FeatureSpec
|
||||
featureName Feature
|
||||
featureValue bool
|
||||
|
||||
expectedErr func(string) error
|
||||
}{
|
||||
{
|
||||
name: "empty feature name returns an error",
|
||||
features: defaultTestFeatures,
|
||||
expectedErr: func(callSiteName string) error {
|
||||
return fmt.Errorf("feature %q is not registered in FeatureGates %q", "", callSiteName)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "setting unknown feature returns an error",
|
||||
features: defaultTestFeatures,
|
||||
featureName: "Unknown",
|
||||
expectedErr: func(callSiteName string) error {
|
||||
return fmt.Errorf("feature %q is not registered in FeatureGates %q", "Unknown", callSiteName)
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "setting locked feature returns an error",
|
||||
features: map[Feature]FeatureSpec{"LockedFeature": {LockToDefault: true, Default: true}},
|
||||
featureName: "LockedFeature",
|
||||
featureValue: false,
|
||||
expectedErr: func(_ string) error {
|
||||
return fmt.Errorf("cannot set feature gate %q to %v, feature is locked to %v", "LockedFeature", false, true)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, scenario := range scenarios {
|
||||
t.Run(scenario.name, func(t *testing.T) {
|
||||
target := newEnvVarFeatureGates(scenario.features)
|
||||
|
||||
err := target.Set(scenario.featureName, scenario.featureValue)
|
||||
require.Equal(t, scenario.expectedErr(target.callSiteName), err)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,15 @@ func TestAddFeaturesToExistingFeatureGates(t *testing.T) {
|
||||
require.Equal(t, defaultKubernetesFeatureGates, fakeFeatureGates.specs)
|
||||
}
|
||||
|
||||
func TestReplaceFeatureGatesWithWarningIndicator(t *testing.T) {
|
||||
defaultFeatureGates := FeatureGates()
|
||||
require.Panics(t, func() { defaultFeatureGates.Enabled("Foo") }, "reading an unregistered feature gate Foo should panic")
|
||||
|
||||
if !replaceFeatureGatesWithWarningIndicator(defaultFeatureGates) {
|
||||
t.Error("replacing the default feature gates after reading a value hasn't produced a warning")
|
||||
}
|
||||
}
|
||||
|
||||
type fakeRegistry struct {
|
||||
specs map[Feature]FeatureSpec
|
||||
}
|
||||
|
||||
@@ -37,6 +37,10 @@ const (
|
||||
// The feature is disabled in Beta by default because
|
||||
// it will only be turned on for selected control plane component(s).
|
||||
WatchListClient Feature = "WatchListClient"
|
||||
|
||||
// owner: @nilekhc
|
||||
// alpha: v1.30
|
||||
InformerResourceVersion Feature = "InformerResourceVersion"
|
||||
)
|
||||
|
||||
// defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys.
|
||||
@@ -45,5 +49,6 @@ const (
|
||||
// After registering with the binary, the features are, by default, controllable using environment variables.
|
||||
// For more details, please see envVarFeatureGates implementation.
|
||||
var defaultKubernetesFeatureGates = map[Feature]FeatureSpec{
|
||||
WatchListClient: {Default: false, PreRelease: Beta},
|
||||
WatchListClient: {Default: false, PreRelease: Beta},
|
||||
InformerResourceVersion: {Default: false, PreRelease: Alpha},
|
||||
}
|
||||
|
||||
90
features/testing/features.go
Normal file
90
features/testing/features.go
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
Copyright 2024 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package testing
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
clientfeatures "k8s.io/client-go/features"
|
||||
)
|
||||
|
||||
var (
|
||||
overriddenFeaturesLock sync.Mutex
|
||||
overriddenFeatures map[clientfeatures.Feature]string
|
||||
)
|
||||
|
||||
func init() {
|
||||
overriddenFeatures = map[clientfeatures.Feature]string{}
|
||||
}
|
||||
|
||||
type featureGatesSetter interface {
|
||||
clientfeatures.Gates
|
||||
|
||||
Set(clientfeatures.Feature, bool) error
|
||||
}
|
||||
|
||||
// SetFeatureDuringTest sets the specified feature to the specified value for the duration of the test.
|
||||
//
|
||||
// Example use:
|
||||
//
|
||||
// clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, true)
|
||||
func SetFeatureDuringTest(tb testing.TB, feature clientfeatures.Feature, featureValue bool) {
|
||||
if err := setFeatureDuringTestInternal(tb, feature, featureValue); err != nil {
|
||||
tb.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func setFeatureDuringTestInternal(tb testing.TB, feature clientfeatures.Feature, featureValue bool) error {
|
||||
overriddenFeaturesLock.Lock()
|
||||
defer overriddenFeaturesLock.Unlock()
|
||||
|
||||
currentFeatureGates := clientfeatures.FeatureGates()
|
||||
featureGates, ok := currentFeatureGates.(featureGatesSetter)
|
||||
if !ok {
|
||||
panic(fmt.Errorf("clientfeatures.FeatureGates(): %T does not implement featureGatesSetter interface", currentFeatureGates))
|
||||
}
|
||||
|
||||
originalFeatureValue := featureGates.Enabled(feature)
|
||||
if overridingTestName, ok := overriddenFeatures[feature]; ok {
|
||||
if !sameTestOrSubtest(tb, overridingTestName) {
|
||||
return fmt.Errorf("client-go feature %q is currently overridden by %q test and cannot be also modified by %q", feature, overridingTestName, tb.Name())
|
||||
}
|
||||
}
|
||||
|
||||
if err := featureGates.Set(feature, featureValue); err != nil {
|
||||
return err
|
||||
}
|
||||
overriddenFeatures[feature] = tb.Name()
|
||||
|
||||
tb.Cleanup(func() {
|
||||
overriddenFeaturesLock.Lock()
|
||||
defer overriddenFeaturesLock.Unlock()
|
||||
delete(overriddenFeatures, feature)
|
||||
if err := featureGates.Set(feature, originalFeatureValue); err != nil {
|
||||
tb.Errorf("failed restoring client-go feature: %v to its original value: %v, err: %v", feature, originalFeatureValue, err)
|
||||
}
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
// copied from component-base/featuregate/testing
|
||||
func sameTestOrSubtest(tb testing.TB, testName string) bool {
|
||||
return tb.Name() == testName || strings.HasPrefix(tb.Name(), testName+"/")
|
||||
}
|
||||
@@ -30,24 +30,123 @@ func TestDriveInitDefaultFeatureGates(t *testing.T) {
|
||||
featureGates := features.FeatureGates()
|
||||
assertFunctionPanicsWithMessage(t, func() { featureGates.Enabled("FakeFeatureGate") }, "features.FeatureGates().Enabled", fmt.Sprintf("feature %q is not registered in FeatureGate", "FakeFeatureGate"))
|
||||
|
||||
fakeFeatureGates := &alwaysEnabledFakeGates{}
|
||||
require.True(t, fakeFeatureGates.Enabled("FakeFeatureGate"))
|
||||
fakeGates := &fakeFeatureGates{features: map[features.Feature]bool{"FakeFeatureGate": true}}
|
||||
require.True(t, fakeGates.Enabled("FakeFeatureGate"))
|
||||
|
||||
features.ReplaceFeatureGates(fakeFeatureGates)
|
||||
features.ReplaceFeatureGates(fakeGates)
|
||||
featureGates = features.FeatureGates()
|
||||
|
||||
assertFeatureGatesType(t, featureGates)
|
||||
require.True(t, featureGates.Enabled("FakeFeatureGate"))
|
||||
}
|
||||
|
||||
type alwaysEnabledFakeGates struct{}
|
||||
func TestSetFeatureGatesDuringTest(t *testing.T) {
|
||||
featureA := features.Feature("FeatureA")
|
||||
featureB := features.Feature("FeatureB")
|
||||
fakeGates := &fakeFeatureGates{map[features.Feature]bool{featureA: true, featureB: true}}
|
||||
features.ReplaceFeatureGates(fakeGates)
|
||||
t.Cleanup(func() {
|
||||
// since cleanup functions will be called in last added, first called order.
|
||||
// check if the original feature wasn't restored
|
||||
require.True(t, features.FeatureGates().Enabled(featureA), "the original feature = %v wasn't restored", featureA)
|
||||
})
|
||||
|
||||
func (f *alwaysEnabledFakeGates) Enabled(features.Feature) bool {
|
||||
return true
|
||||
SetFeatureDuringTest(t, featureA, false)
|
||||
|
||||
require.False(t, features.FeatureGates().Enabled(featureA))
|
||||
require.True(t, features.FeatureGates().Enabled(featureB))
|
||||
}
|
||||
|
||||
func TestSetFeatureGatesDuringTestPanics(t *testing.T) {
|
||||
fakeGates := &fakeFeatureGates{features: map[features.Feature]bool{"FakeFeatureGate": true}}
|
||||
|
||||
features.ReplaceFeatureGates(fakeGates)
|
||||
assertFunctionPanicsWithMessage(t, func() { SetFeatureDuringTest(t, "UnknownFeature", false) }, "SetFeatureDuringTest", fmt.Sprintf("feature %q is not registered in featureGates", "UnknownFeature"))
|
||||
|
||||
readOnlyGates := &readOnlyAlwaysDisabledFeatureGates{}
|
||||
features.ReplaceFeatureGates(readOnlyGates)
|
||||
assertFunctionPanicsWithMessage(t, func() { SetFeatureDuringTest(t, "FakeFeature", false) }, "SetFeatureDuringTest", fmt.Sprintf("clientfeatures.FeatureGates(): %T does not implement featureGatesSetter interface", readOnlyGates))
|
||||
}
|
||||
|
||||
func TestOverridesForSetFeatureGatesDuringTest(t *testing.T) {
|
||||
scenarios := []struct {
|
||||
name string
|
||||
firstTestName string
|
||||
secondTestName string
|
||||
expectError bool
|
||||
}{
|
||||
{
|
||||
name: "concurrent tests setting the same feature fail",
|
||||
firstTestName: "fooTest",
|
||||
secondTestName: "barTest",
|
||||
expectError: true,
|
||||
},
|
||||
|
||||
{
|
||||
name: "same test setting the same feature does not fail",
|
||||
firstTestName: "fooTest",
|
||||
secondTestName: "fooTest",
|
||||
expectError: false,
|
||||
},
|
||||
|
||||
{
|
||||
name: "subtests setting the same feature don't not fail",
|
||||
firstTestName: "fooTest",
|
||||
secondTestName: "fooTest/scenario1",
|
||||
expectError: false,
|
||||
},
|
||||
}
|
||||
for _, scenario := range scenarios {
|
||||
t.Run(scenario.name, func(t *testing.T) {
|
||||
featureA := features.Feature("FeatureA")
|
||||
fakeGates := &fakeFeatureGates{map[features.Feature]bool{featureA: true}}
|
||||
fakeTesting := &fakeT{fakeTestName: scenario.firstTestName, TB: t}
|
||||
|
||||
features.ReplaceFeatureGates(fakeGates)
|
||||
require.NoError(t, setFeatureDuringTestInternal(fakeTesting, featureA, true))
|
||||
require.True(t, features.FeatureGates().Enabled(featureA))
|
||||
|
||||
fakeTesting.fakeTestName = scenario.secondTestName
|
||||
err := setFeatureDuringTestInternal(fakeTesting, featureA, false)
|
||||
require.Equal(t, scenario.expectError, err != nil)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
type fakeFeatureGates struct {
|
||||
features map[features.Feature]bool
|
||||
}
|
||||
|
||||
func (f *fakeFeatureGates) Enabled(feature features.Feature) bool {
|
||||
featureValue, ok := f.features[feature]
|
||||
if !ok {
|
||||
panic(fmt.Errorf("feature %q is not registered in featureGates", feature))
|
||||
}
|
||||
return featureValue
|
||||
}
|
||||
|
||||
func (f *fakeFeatureGates) Set(feature features.Feature, value bool) error {
|
||||
f.features[feature] = value
|
||||
return nil
|
||||
}
|
||||
|
||||
type readOnlyAlwaysDisabledFeatureGates struct{}
|
||||
|
||||
func (f *readOnlyAlwaysDisabledFeatureGates) Enabled(feature features.Feature) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
type fakeT struct {
|
||||
fakeTestName string
|
||||
testing.TB
|
||||
}
|
||||
|
||||
func (t *fakeT) Name() string {
|
||||
return t.fakeTestName
|
||||
}
|
||||
|
||||
func assertFeatureGatesType(t *testing.T, fg features.Gates) {
|
||||
_, ok := fg.(*alwaysEnabledFakeGates)
|
||||
_, ok := fg.(*fakeFeatureGates)
|
||||
if !ok {
|
||||
t.Fatalf("passed features.FeatureGates() is NOT of type *alwaysEnabledFakeGates, it is of type = %T", fg)
|
||||
}
|
||||
|
||||
44
go.mod
44
go.mod
@@ -2,45 +2,47 @@
|
||||
|
||||
module k8s.io/client-go
|
||||
|
||||
go 1.21
|
||||
go 1.22.0
|
||||
|
||||
require (
|
||||
github.com/evanphx/json-patch v4.12.0+incompatible
|
||||
github.com/gogo/protobuf v1.3.2
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
|
||||
github.com/golang/protobuf v1.5.3
|
||||
github.com/golang/protobuf v1.5.4
|
||||
github.com/google/gnostic-models v0.6.8
|
||||
github.com/google/go-cmp v0.6.0
|
||||
github.com/google/gofuzz v1.2.0
|
||||
github.com/google/uuid v1.3.0
|
||||
github.com/google/uuid v1.3.1
|
||||
github.com/gorilla/websocket v1.5.0
|
||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7
|
||||
github.com/imdario/mergo v0.3.6
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/stretchr/testify v1.8.4
|
||||
golang.org/x/net v0.19.0
|
||||
golang.org/x/oauth2 v0.10.0
|
||||
golang.org/x/term v0.15.0
|
||||
go.uber.org/goleak v1.3.0
|
||||
golang.org/x/net v0.25.0
|
||||
golang.org/x/oauth2 v0.20.0
|
||||
golang.org/x/term v0.20.0
|
||||
golang.org/x/time v0.3.0
|
||||
google.golang.org/protobuf v1.31.0
|
||||
k8s.io/api v0.0.0-20240210012304-e08bb0fc5290
|
||||
k8s.io/apimachinery v0.0.0-20240210011909-4a1251b70e07
|
||||
google.golang.org/protobuf v1.33.0
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0
|
||||
k8s.io/api v0.31.0-alpha.2
|
||||
k8s.io/apimachinery v0.31.0-alpha.2
|
||||
k8s.io/klog/v2 v2.120.1
|
||||
k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e
|
||||
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
|
||||
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1
|
||||
sigs.k8s.io/yaml v1.3.0
|
||||
sigs.k8s.io/yaml v1.4.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.7.0-beta // indirect
|
||||
github.com/go-logr/logr v1.4.1 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||
github.com/go-openapi/swag v0.22.3 // indirect
|
||||
github.com/go-openapi/swag v0.22.4 // indirect
|
||||
github.com/google/btree v1.0.1 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
@@ -50,17 +52,13 @@ require (
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
|
||||
github.com/onsi/gomega v1.33.1 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
golang.org/x/sys v0.15.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
golang.org/x/sys v0.20.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
replace (
|
||||
k8s.io/api => k8s.io/api v0.0.0-20240210012304-e08bb0fc5290
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240210011909-4a1251b70e07
|
||||
)
|
||||
|
||||
100
go.sum
100
go.sum
@@ -2,45 +2,44 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd
|
||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
|
||||
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
|
||||
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
|
||||
github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||
github.com/fxamacker/cbor/v2 v2.7.0-beta h1:m5bO941uTVpSms26QjzEJxUZaC3S/h1pSJexBCu4wAA=
|
||||
github.com/fxamacker/cbor/v2 v2.7.0-beta/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
|
||||
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
|
||||
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
||||
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
||||
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
||||
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
||||
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
|
||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
|
||||
github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
|
||||
github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
|
||||
github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA=
|
||||
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
|
||||
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
|
||||
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM=
|
||||
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
|
||||
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
|
||||
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
||||
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
@@ -74,18 +73,19 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
|
||||
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
|
||||
github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=
|
||||
github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM=
|
||||
github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE=
|
||||
github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk=
|
||||
github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA=
|
||||
github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To=
|
||||
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
|
||||
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
|
||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
@@ -97,58 +97,58 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
|
||||
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
|
||||
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
|
||||
golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8=
|
||||
golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI=
|
||||
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=
|
||||
golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
|
||||
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
|
||||
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA=
|
||||
golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
|
||||
golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw=
|
||||
golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
|
||||
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
|
||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
@@ -157,19 +157,19 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
k8s.io/api v0.0.0-20240210012304-e08bb0fc5290 h1:kJtm0TH2Kd9ckhj9D5+IqSvPl94XgmIpCZgICcbSrWA=
|
||||
k8s.io/api v0.0.0-20240210012304-e08bb0fc5290/go.mod h1:NZBmJRWEuf2RKTOYTMZCchDDEMCw5N2rWL299ZWWmOY=
|
||||
k8s.io/apimachinery v0.0.0-20240210011909-4a1251b70e07 h1:scQR0eGti1E17UVjIWHrF1ZcWpjFj0cn0sIszKJwdOQ=
|
||||
k8s.io/apimachinery v0.0.0-20240210011909-4a1251b70e07/go.mod h1:akBo0Z+IFaOazGhD1RG6NG75rWj9oAhmz7UHqmfygmw=
|
||||
k8s.io/api v0.31.0-alpha.2 h1:azMbpAFERqtGmgDtg/f7efnxgPBW+8ieyHNKxT97EMI=
|
||||
k8s.io/api v0.31.0-alpha.2/go.mod h1:S1X5UjUV8NZmR1vmKIkUpruhr0AWAvocZVZ5zxKMvi4=
|
||||
k8s.io/apimachinery v0.31.0-alpha.2 h1:jya7Ax6yRLH+CSW/osUEO+hxe4rVNrXU8lNB0fZcGkk=
|
||||
k8s.io/apimachinery v0.31.0-alpha.2/go.mod h1:3nAExNh3CrzC6eKT9a32j/rv+uJ8Zod87oOmgUjZNAY=
|
||||
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
|
||||
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||
k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e h1:snPmy96t93RredGRjKfMFt+gvxuVAncqSAyBveJtr4Q=
|
||||
k8s.io/kube-openapi v0.0.0-20231113174909-778a5567bc1e/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
|
||||
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98=
|
||||
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
|
||||
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
|
||||
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
|
||||
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
|
||||
@@ -26,6 +26,10 @@ import (
|
||||
type Interface interface {
|
||||
// MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer.
|
||||
MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer
|
||||
// ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer.
|
||||
ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer
|
||||
// ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer.
|
||||
ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer
|
||||
// ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer.
|
||||
ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer
|
||||
}
|
||||
@@ -46,6 +50,16 @@ func (v *version) MutatingWebhookConfigurations() MutatingWebhookConfigurationIn
|
||||
return &mutatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ValidatingAdmissionPolicies returns a ValidatingAdmissionPolicyInformer.
|
||||
func (v *version) ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInformer {
|
||||
return &validatingAdmissionPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindingInformer.
|
||||
func (v *version) ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInformer {
|
||||
return &validatingAdmissionPolicyBindingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer.
|
||||
func (v *version) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer {
|
||||
return &validatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
kubernetes "k8s.io/client-go/kubernetes"
|
||||
v1 "k8s.io/client-go/listers/admissionregistration/v1"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ValidatingAdmissionPolicyInformer provides access to a shared informer and lister for
|
||||
// ValidatingAdmissionPolicies.
|
||||
type ValidatingAdmissionPolicyInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.ValidatingAdmissionPolicyLister
|
||||
}
|
||||
|
||||
type validatingAdmissionPolicyInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredValidatingAdmissionPolicyInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AdmissionregistrationV1().ValidatingAdmissionPolicies().Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&admissionregistrationv1.ValidatingAdmissionPolicy{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *validatingAdmissionPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredValidatingAdmissionPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *validatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&admissionregistrationv1.ValidatingAdmissionPolicy{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *validatingAdmissionPolicyInformer) Lister() v1.ValidatingAdmissionPolicyLister {
|
||||
return v1.NewValidatingAdmissionPolicyLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
kubernetes "k8s.io/client-go/kubernetes"
|
||||
v1 "k8s.io/client-go/listers/admissionregistration/v1"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ValidatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for
|
||||
// ValidatingAdmissionPolicyBindings.
|
||||
type ValidatingAdmissionPolicyBindingInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.ValidatingAdmissionPolicyBindingLister
|
||||
}
|
||||
|
||||
type validatingAdmissionPolicyBindingInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredValidatingAdmissionPolicyBindingInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.AdmissionregistrationV1().ValidatingAdmissionPolicyBindings().Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&admissionregistrationv1.ValidatingAdmissionPolicyBinding{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *validatingAdmissionPolicyBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredValidatingAdmissionPolicyBindingInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *validatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&admissionregistrationv1.ValidatingAdmissionPolicyBinding{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *validatingAdmissionPolicyBindingInformer) Lister() v1.ValidatingAdmissionPolicyBindingLister {
|
||||
return v1.NewValidatingAdmissionPolicyBindingLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -46,6 +46,7 @@ import (
|
||||
resource "k8s.io/client-go/informers/resource"
|
||||
scheduling "k8s.io/client-go/informers/scheduling"
|
||||
storage "k8s.io/client-go/informers/storage"
|
||||
storagemigration "k8s.io/client-go/informers/storagemigration"
|
||||
kubernetes "k8s.io/client-go/kubernetes"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
@@ -290,6 +291,7 @@ type SharedInformerFactory interface {
|
||||
Resource() resource.Interface
|
||||
Scheduling() scheduling.Interface
|
||||
Storage() storage.Interface
|
||||
Storagemigration() storagemigration.Interface
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Admissionregistration() admissionregistration.Interface {
|
||||
@@ -367,3 +369,7 @@ func (f *sharedInformerFactory) Scheduling() scheduling.Interface {
|
||||
func (f *sharedInformerFactory) Storage() storage.Interface {
|
||||
return storage.New(f, f.namespace, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Storagemigration() storagemigration.Interface {
|
||||
return storagemigration.New(f, f.namespace, f.tweakListOptions)
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ import (
|
||||
storagev1 "k8s.io/api/storage/v1"
|
||||
storagev1alpha1 "k8s.io/api/storage/v1alpha1"
|
||||
storagev1beta1 "k8s.io/api/storage/v1beta1"
|
||||
storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
@@ -100,6 +101,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
// Group=admissionregistration.k8s.io, Version=v1
|
||||
case v1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().MutatingWebhookConfigurations().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("validatingadmissionpolicies"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().ValidatingAdmissionPolicies().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().ValidatingAdmissionPolicyBindings().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().ValidatingWebhookConfigurations().Informer()}, nil
|
||||
|
||||
@@ -362,10 +367,16 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().PodSchedulingContexts().Informer()}, nil
|
||||
case v1alpha2.SchemeGroupVersion.WithResource("resourceclaims"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClaims().Informer()}, nil
|
||||
case v1alpha2.SchemeGroupVersion.WithResource("resourceclaimparameters"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClaimParameters().Informer()}, nil
|
||||
case v1alpha2.SchemeGroupVersion.WithResource("resourceclaimtemplates"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClaimTemplates().Informer()}, nil
|
||||
case v1alpha2.SchemeGroupVersion.WithResource("resourceclasses"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClasses().Informer()}, nil
|
||||
case v1alpha2.SchemeGroupVersion.WithResource("resourceclassparameters"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClassParameters().Informer()}, nil
|
||||
case v1alpha2.SchemeGroupVersion.WithResource("resourceslices"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceSlices().Informer()}, nil
|
||||
|
||||
// Group=scheduling.k8s.io, Version=v1
|
||||
case schedulingv1.SchemeGroupVersion.WithResource("priorityclasses"):
|
||||
@@ -411,6 +422,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
case storagev1beta1.SchemeGroupVersion.WithResource("volumeattachments"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().VolumeAttachments().Informer()}, nil
|
||||
|
||||
// Group=storagemigration.k8s.io, Version=v1alpha1
|
||||
case storagemigrationv1alpha1.SchemeGroupVersion.WithResource("storageversionmigrations"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Storagemigration().V1alpha1().StorageVersionMigrations().Informer()}, nil
|
||||
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("no informer found for %v", resource)
|
||||
|
||||
@@ -28,10 +28,16 @@ type Interface interface {
|
||||
PodSchedulingContexts() PodSchedulingContextInformer
|
||||
// ResourceClaims returns a ResourceClaimInformer.
|
||||
ResourceClaims() ResourceClaimInformer
|
||||
// ResourceClaimParameters returns a ResourceClaimParametersInformer.
|
||||
ResourceClaimParameters() ResourceClaimParametersInformer
|
||||
// ResourceClaimTemplates returns a ResourceClaimTemplateInformer.
|
||||
ResourceClaimTemplates() ResourceClaimTemplateInformer
|
||||
// ResourceClasses returns a ResourceClassInformer.
|
||||
ResourceClasses() ResourceClassInformer
|
||||
// ResourceClassParameters returns a ResourceClassParametersInformer.
|
||||
ResourceClassParameters() ResourceClassParametersInformer
|
||||
// ResourceSlices returns a ResourceSliceInformer.
|
||||
ResourceSlices() ResourceSliceInformer
|
||||
}
|
||||
|
||||
type version struct {
|
||||
@@ -55,6 +61,11 @@ func (v *version) ResourceClaims() ResourceClaimInformer {
|
||||
return &resourceClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ResourceClaimParameters returns a ResourceClaimParametersInformer.
|
||||
func (v *version) ResourceClaimParameters() ResourceClaimParametersInformer {
|
||||
return &resourceClaimParametersInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ResourceClaimTemplates returns a ResourceClaimTemplateInformer.
|
||||
func (v *version) ResourceClaimTemplates() ResourceClaimTemplateInformer {
|
||||
return &resourceClaimTemplateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
@@ -64,3 +75,13 @@ func (v *version) ResourceClaimTemplates() ResourceClaimTemplateInformer {
|
||||
func (v *version) ResourceClasses() ResourceClassInformer {
|
||||
return &resourceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ResourceClassParameters returns a ResourceClassParametersInformer.
|
||||
func (v *version) ResourceClassParameters() ResourceClassParametersInformer {
|
||||
return &resourceClassParametersInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ResourceSlices returns a ResourceSliceInformer.
|
||||
func (v *version) ResourceSlices() ResourceSliceInformer {
|
||||
return &resourceSliceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
90
informers/resource/v1alpha2/resourceclaimparameters.go
Normal file
90
informers/resource/v1alpha2/resourceclaimparameters.go
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
resourcev1alpha2 "k8s.io/api/resource/v1alpha2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
kubernetes "k8s.io/client-go/kubernetes"
|
||||
v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ResourceClaimParametersInformer provides access to a shared informer and lister for
|
||||
// ResourceClaimParameters.
|
||||
type ResourceClaimParametersInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1alpha2.ResourceClaimParametersLister
|
||||
}
|
||||
|
||||
type resourceClaimParametersInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewResourceClaimParametersInformer constructs a new informer for ResourceClaimParameters type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewResourceClaimParametersInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredResourceClaimParametersInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredResourceClaimParametersInformer constructs a new informer for ResourceClaimParameters type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredResourceClaimParametersInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ResourceV1alpha2().ResourceClaimParameters(namespace).List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ResourceV1alpha2().ResourceClaimParameters(namespace).Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&resourcev1alpha2.ResourceClaimParameters{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *resourceClaimParametersInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredResourceClaimParametersInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *resourceClaimParametersInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&resourcev1alpha2.ResourceClaimParameters{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *resourceClaimParametersInformer) Lister() v1alpha2.ResourceClaimParametersLister {
|
||||
return v1alpha2.NewResourceClaimParametersLister(f.Informer().GetIndexer())
|
||||
}
|
||||
90
informers/resource/v1alpha2/resourceclassparameters.go
Normal file
90
informers/resource/v1alpha2/resourceclassparameters.go
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
resourcev1alpha2 "k8s.io/api/resource/v1alpha2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
kubernetes "k8s.io/client-go/kubernetes"
|
||||
v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ResourceClassParametersInformer provides access to a shared informer and lister for
|
||||
// ResourceClassParameters.
|
||||
type ResourceClassParametersInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1alpha2.ResourceClassParametersLister
|
||||
}
|
||||
|
||||
type resourceClassParametersInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewResourceClassParametersInformer constructs a new informer for ResourceClassParameters type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewResourceClassParametersInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredResourceClassParametersInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredResourceClassParametersInformer constructs a new informer for ResourceClassParameters type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredResourceClassParametersInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ResourceV1alpha2().ResourceClassParameters(namespace).List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ResourceV1alpha2().ResourceClassParameters(namespace).Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&resourcev1alpha2.ResourceClassParameters{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *resourceClassParametersInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredResourceClassParametersInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *resourceClassParametersInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&resourcev1alpha2.ResourceClassParameters{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *resourceClassParametersInformer) Lister() v1alpha2.ResourceClassParametersLister {
|
||||
return v1alpha2.NewResourceClassParametersLister(f.Informer().GetIndexer())
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user