forked from reconcilerio/dies
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure every resource in k8s 1.23 (reconcilerio#22)
For resources with multiple supported versions, only the recommended version is included. We can look to include other versions over time. New resources include: ``` APIVERSION KIND v1 Binding v1 ComponentStatus v1 PodTemplate v1 ReplicationController apiregistration.k8s.io/v1 APIService apps/v1 ControllerRevision authentication.k8s.io/v1 TokenReview authorization.k8s.io/v1 LocalSubjectAccessReview authorization.k8s.io/v1 SelfSubjectAccessReview authorization.k8s.io/v1 SelfSubjectRulesReview authorization.k8s.io/v1 SubjectAccessReview certificates.k8s.io/v1 CertificateSigningRequest coordination.k8s.io/v1 Lease discovery.k8s.io/v1 EndpointSlice events.k8s.io/v1 Event flowcontrol.apiserver.k8s.io/v1beta1 FlowSchema flowcontrol.apiserver.k8s.io/v1beta1 PriorityLevelConfiguration node.k8s.io/v1 RuntimeClass policy/v1 PodDisruptionBudget policy/v1beta1 PodSecurityPolicy scheduling.k8s.io/v1 PriorityClass storage.k8s.io/v1 CSIDriver storage.k8s.io/v1 CSINode storage.k8s.io/v1beta1 CSIStorageCapacity storage.k8s.io/v1 StorageClass storage.k8s.io/v1 VolumeAttachment ``` The `dies.dev/apis/rbac` package is deprecated, the content is now at `dies.dev/apis/authorization/rbac`. Aliases have been created for backwards compatibility, but will be removed in the future. Signed-off-by: Scott Andrews <scott@andrews.me>
- Loading branch information
Showing
111 changed files
with
17,879 additions
and
4,212 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
Copyright 2022 the original author or 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 v1 | ||
|
||
import ( | ||
diemetav1 "dies.dev/apis/meta/v1" | ||
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration" | ||
) | ||
|
||
// +die:object=true | ||
type _ = apiregistrationv1.APIService | ||
|
||
// +die | ||
type _ = apiregistrationv1.APIServiceSpec | ||
|
||
func (d *APIServiceSpecDie) TargetDie(fn func(d *ServiceReferenceDie)) *APIServiceSpecDie { | ||
return d.DieStamp(func(r *apiregistrationv1.APIServiceSpec) { | ||
d := ServiceReferenceBlank.DieImmutable(false).DieFeedPtr(r.Service) | ||
fn(d) | ||
r.Service = d.DieReleasePtr() | ||
}) | ||
} | ||
|
||
// +die | ||
type _ = apiregistrationv1.ServiceReference | ||
|
||
// +die | ||
type _ = apiregistrationv1.APIServiceStatus | ||
|
||
func (d *APIServiceStatusDie) ConditionsDie(conditions ...*diemetav1.ConditionDie) *APIServiceStatusDie { | ||
return d.DieStamp(func(r *apiregistrationv1.APIServiceStatus) { | ||
r.Conditions = make([]apiregistrationv1.APIServiceCondition, len(conditions)) | ||
for i := range conditions { | ||
c := conditions[i].DieRelease() | ||
r.Conditions[i] = apiregistrationv1.APIServiceCondition{ | ||
Type: apiregistrationv1.APIServiceConditionType(c.Type), | ||
Status: apiregistrationv1.ConditionStatus(c.Status), | ||
Reason: c.Reason, | ||
Message: c.Message, | ||
LastTransitionTime: c.LastTransitionTime, | ||
} | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
Copyright 2022 the original author or 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 v1_test | ||
|
||
import ( | ||
"testing" | ||
|
||
dieapiregistrationv1 "dies.dev/apis/apiregistration/v1" | ||
diemetav1 "dies.dev/apis/meta/v1" | ||
"github.com/google/go-cmp/cmp" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration" | ||
) | ||
|
||
func TestAPIService(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
die *dieapiregistrationv1.APIServiceDie | ||
expected apiregistrationv1.APIService | ||
}{ | ||
{ | ||
name: "empty", | ||
die: dieapiregistrationv1.APIServiceBlank, | ||
expected: apiregistrationv1.APIService{}, | ||
}, | ||
{ | ||
name: "object metadata", | ||
die: dieapiregistrationv1.APIServiceBlank. | ||
MetadataDie(func(d *diemetav1.ObjectMetaDie) { | ||
d.Namespace("my-namespace") | ||
d.Name("my-name") | ||
}), | ||
expected: apiregistrationv1.APIService{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Namespace: "my-namespace", | ||
Name: "my-name", | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
for _, c := range tests { | ||
t.Run(c.name, func(t *testing.T) { | ||
actual := c.die.DieRelease() | ||
if diff := cmp.Diff(c.expected, actual); diff != "" { | ||
t.Errorf("(-expected, +actual): %s", diff) | ||
} | ||
}) | ||
} | ||
} |
Oops, something went wrong.