From 1e1fef77f22020458b7863fa80dcee90fd64a46e Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Wed, 24 Jan 2024 14:29:32 -0700 Subject: [PATCH 1/2] Revert "Merge pull request #3460 from stbenjam/revert-3448-1706107197301" This reverts commit d7b8d7596f1296ae0ab7f4fe430420674b490830, reversing changes made to 6c84753aab99ce494c8817ef79d9365a755b153c. --- Makefile | 4 +- api/certificates/register.go | 3 + ...certificatesigningrequestapproval_types.go | 7 +- api/certificates/v1alpha1/doc.go | 4 + api/certificates/v1alpha1/register.go | 37 ++ .../v1alpha1/zz_generated.deepcopy.go | 114 ++++++ .../v1beta1/zz_generated.deepcopy.go | 89 ----- .../certificatesigningrequestapproval.go | 14 +- client/applyconfiguration/utils.go | 358 +++++++++--------- client/clientset/clientset/clientset.go | 17 +- .../clientset/fake/clientset_generated.go | 7 + client/clientset/clientset/fake/register.go | 2 + client/clientset/clientset/scheme/register.go | 2 + .../v1alpha1/certificates_client.go | 106 ++++++ .../certificatesigningrequestapproval.go | 56 +-- .../typed/certificates/v1alpha1/doc.go | 19 + .../typed/certificates/v1alpha1/fake/doc.go | 19 + .../v1alpha1/fake/fake_certificates_client.go | 39 ++ .../fake_certificatesigningrequestapproval.go | 64 ++-- .../v1alpha1/generated_expansion.go | 20 + .../v1beta1/fake/fake_hypershift_client.go | 4 - .../hypershift/v1beta1/generated_expansion.go | 2 - .../hypershift/v1beta1/hypershift_client.go | 5 - .../certificates/interface.go | 45 +++ .../certificatesigningrequestapproval.go | 20 +- .../certificates/v1alpha1/interface.go | 44 +++ client/informers/externalversions/factory.go | 6 + client/informers/externalversions/generic.go | 15 +- .../hypershift/v1beta1/interface.go | 7 - .../certificatesigningrequestapproval.go | 24 +- .../v1alpha1/expansion_generated.go | 26 ++ .../hypershift/v1beta1/expansion_generated.go | 8 - ...o_certificatesigningrequestapprovals.yaml} | 6 +- cmd/install/assets/hypershift_operator.go | 5 + .../pkioperator/reconcile.go | 2 +- ...tReconcileControlPlanePKIOperatorRole.yaml | 2 +- ...ificatesigningrequestapprovalcontroller.go | 9 +- ...tesigningrequestapprovalcontroller_test.go | 25 +- docs/content/reference/api.md | 89 ----- hack/app-sre/saas_template.yaml | 128 +++---- .../hostedcluster/hostedcluster_controller.go | 5 + test/e2e/create_cluster_test.go | 6 +- 42 files changed, 887 insertions(+), 577 deletions(-) create mode 100644 api/certificates/register.go rename api/{hypershift/v1beta1 => certificates/v1alpha1}/certificatesigningrequestapproval_types.go (88%) create mode 100644 api/certificates/v1alpha1/doc.go create mode 100644 api/certificates/v1alpha1/register.go create mode 100644 api/certificates/v1alpha1/zz_generated.deepcopy.go rename client/applyconfiguration/{hypershift/v1beta1 => certificates/v1alpha1}/certificatesigningrequestapproval.go (94%) create mode 100644 client/clientset/clientset/typed/certificates/v1alpha1/certificates_client.go rename client/clientset/clientset/typed/{hypershift/v1beta1 => certificates/v1alpha1}/certificatesigningrequestapproval.go (73%) create mode 100644 client/clientset/clientset/typed/certificates/v1alpha1/doc.go create mode 100644 client/clientset/clientset/typed/certificates/v1alpha1/fake/doc.go create mode 100644 client/clientset/clientset/typed/certificates/v1alpha1/fake/fake_certificates_client.go rename client/clientset/clientset/typed/{hypershift/v1beta1 => certificates/v1alpha1}/fake/fake_certificatesigningrequestapproval.go (66%) create mode 100644 client/clientset/clientset/typed/certificates/v1alpha1/generated_expansion.go create mode 100644 client/informers/externalversions/certificates/interface.go rename client/informers/externalversions/{hypershift/v1beta1 => certificates/v1alpha1}/certificatesigningrequestapproval.go (79%) create mode 100644 client/informers/externalversions/certificates/v1alpha1/interface.go rename client/listers/{hypershift/v1beta1 => certificates/v1alpha1}/certificatesigningrequestapproval.go (81%) create mode 100644 client/listers/certificates/v1alpha1/expansion_generated.go rename cmd/install/assets/hypershift-operator/{hypershift.openshift.io_certificatesigningrequestapprovals.yaml => certificates.hypershift.openshift.io_certificatesigningrequestapprovals.yaml} (92%) diff --git a/Makefile b/Makefile index 3e29f82fc1..be606b0e1e 100644 --- a/Makefile +++ b/Makefile @@ -94,9 +94,9 @@ api: hypershift-api cluster-api cluster-api-provider-aws cluster-api-provider-ib .PHONY: hypershift-api hypershift-api: $(CONTROLLER_GEN) - $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/hypershift/..." + $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/..." rm -rf cmd/install/assets/hypershift-operator/*.yaml - $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./api/hypershift/..." output:crd:artifacts:config=cmd/install/assets/hypershift-operator + $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./api/..." output:crd:artifacts:config=cmd/install/assets/hypershift-operator .PHONY: cluster-api cluster-api: $(CONTROLLER_GEN) diff --git a/api/certificates/register.go b/api/certificates/register.go new file mode 100644 index 0000000000..d833455317 --- /dev/null +++ b/api/certificates/register.go @@ -0,0 +1,3 @@ +package certificates + +const GroupName = "certificates.hypershift.openshift.io" diff --git a/api/hypershift/v1beta1/certificatesigningrequestapproval_types.go b/api/certificates/v1alpha1/certificatesigningrequestapproval_types.go similarity index 88% rename from api/hypershift/v1beta1/certificatesigningrequestapproval_types.go rename to api/certificates/v1alpha1/certificatesigningrequestapproval_types.go index 5a924483d6..a898236291 100644 --- a/api/hypershift/v1beta1/certificatesigningrequestapproval_types.go +++ b/api/certificates/v1alpha1/certificatesigningrequestapproval_types.go @@ -1,14 +1,9 @@ -package v1beta1 +package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -func init() { - SchemeBuilder.Register(&CertificateSigningRequestApproval{}) - SchemeBuilder.Register(&CertificateSigningRequestApprovalList{}) -} - // +genclient // +kubebuilder:resource:path=certificatesigningrequestapprovals,shortName=csra;csras,scope=Namespaced // +kubebuilder:object:root=true diff --git a/api/certificates/v1alpha1/doc.go b/api/certificates/v1alpha1/doc.go new file mode 100644 index 0000000000..94981313a7 --- /dev/null +++ b/api/certificates/v1alpha1/doc.go @@ -0,0 +1,4 @@ +// +k8s:deepcopy-gen=package,register +// +groupName=certificates.hypershift.openshift.io +// +k8s:openapi-gen=true +package v1alpha1 diff --git a/api/certificates/v1alpha1/register.go b/api/certificates/v1alpha1/register.go new file mode 100644 index 0000000000..2c1f2b5d29 --- /dev/null +++ b/api/certificates/v1alpha1/register.go @@ -0,0 +1,37 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + + "github.com/openshift/hypershift/api/certificates" +) + +// SchemeGroupVersion is group version used to register these objects. +var SchemeGroupVersion = schema.GroupVersion{Group: certificates.GroupName, Version: "v1alpha1"} + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind. +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource. +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &CertificateSigningRequestApproval{}, + &CertificateSigningRequestApprovalList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/api/certificates/v1alpha1/zz_generated.deepcopy.go b/api/certificates/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..aac2d488f7 --- /dev/null +++ b/api/certificates/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,114 @@ +//go:build !ignore_autogenerated + +/* + + +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 controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateSigningRequestApproval) DeepCopyInto(out *CertificateSigningRequestApproval) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestApproval. +func (in *CertificateSigningRequestApproval) DeepCopy() *CertificateSigningRequestApproval { + if in == nil { + return nil + } + out := new(CertificateSigningRequestApproval) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CertificateSigningRequestApproval) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateSigningRequestApprovalList) DeepCopyInto(out *CertificateSigningRequestApprovalList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CertificateSigningRequestApproval, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestApprovalList. +func (in *CertificateSigningRequestApprovalList) DeepCopy() *CertificateSigningRequestApprovalList { + if in == nil { + return nil + } + out := new(CertificateSigningRequestApprovalList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CertificateSigningRequestApprovalList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateSigningRequestApprovalSpec) DeepCopyInto(out *CertificateSigningRequestApprovalSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestApprovalSpec. +func (in *CertificateSigningRequestApprovalSpec) DeepCopy() *CertificateSigningRequestApprovalSpec { + if in == nil { + return nil + } + out := new(CertificateSigningRequestApprovalSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateSigningRequestApprovalStatus) DeepCopyInto(out *CertificateSigningRequestApprovalStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestApprovalStatus. +func (in *CertificateSigningRequestApprovalStatus) DeepCopy() *CertificateSigningRequestApprovalStatus { + if in == nil { + return nil + } + out := new(CertificateSigningRequestApprovalStatus) + in.DeepCopyInto(out) + return out +} diff --git a/api/hypershift/v1beta1/zz_generated.deepcopy.go b/api/hypershift/v1beta1/zz_generated.deepcopy.go index 32bab9b619..4c531fc17b 100644 --- a/api/hypershift/v1beta1/zz_generated.deepcopy.go +++ b/api/hypershift/v1beta1/zz_generated.deepcopy.go @@ -533,95 +533,6 @@ func (in *AzurePlatformSpec) DeepCopy() *AzurePlatformSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertificateSigningRequestApproval) DeepCopyInto(out *CertificateSigningRequestApproval) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestApproval. -func (in *CertificateSigningRequestApproval) DeepCopy() *CertificateSigningRequestApproval { - if in == nil { - return nil - } - out := new(CertificateSigningRequestApproval) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CertificateSigningRequestApproval) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertificateSigningRequestApprovalList) DeepCopyInto(out *CertificateSigningRequestApprovalList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CertificateSigningRequestApproval, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestApprovalList. -func (in *CertificateSigningRequestApprovalList) DeepCopy() *CertificateSigningRequestApprovalList { - if in == nil { - return nil - } - out := new(CertificateSigningRequestApprovalList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CertificateSigningRequestApprovalList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertificateSigningRequestApprovalSpec) DeepCopyInto(out *CertificateSigningRequestApprovalSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestApprovalSpec. -func (in *CertificateSigningRequestApprovalSpec) DeepCopy() *CertificateSigningRequestApprovalSpec { - if in == nil { - return nil - } - out := new(CertificateSigningRequestApprovalSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertificateSigningRequestApprovalStatus) DeepCopyInto(out *CertificateSigningRequestApprovalStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestApprovalStatus. -func (in *CertificateSigningRequestApprovalStatus) DeepCopy() *CertificateSigningRequestApprovalStatus { - if in == nil { - return nil - } - out := new(CertificateSigningRequestApprovalStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterAutoscaling) DeepCopyInto(out *ClusterAutoscaling) { *out = *in diff --git a/client/applyconfiguration/hypershift/v1beta1/certificatesigningrequestapproval.go b/client/applyconfiguration/certificates/v1alpha1/certificatesigningrequestapproval.go similarity index 94% rename from client/applyconfiguration/hypershift/v1beta1/certificatesigningrequestapproval.go rename to client/applyconfiguration/certificates/v1alpha1/certificatesigningrequestapproval.go index 5798fbf9ad..54131691c6 100644 --- a/client/applyconfiguration/hypershift/v1beta1/certificatesigningrequestapproval.go +++ b/client/applyconfiguration/certificates/v1alpha1/certificatesigningrequestapproval.go @@ -15,10 +15,10 @@ limitations under the License. */ // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1beta1 +package v1alpha1 import ( - v1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" + v1alpha1 "github.com/openshift/hypershift/api/certificates/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" @@ -29,8 +29,8 @@ import ( type CertificateSigningRequestApprovalApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *v1beta1.CertificateSigningRequestApprovalSpec `json:"spec,omitempty"` - Status *v1beta1.CertificateSigningRequestApprovalStatus `json:"status,omitempty"` + Spec *v1alpha1.CertificateSigningRequestApprovalSpec `json:"spec,omitempty"` + Status *v1alpha1.CertificateSigningRequestApprovalStatus `json:"status,omitempty"` } // CertificateSigningRequestApproval constructs an declarative configuration of the CertificateSigningRequestApproval type for use with @@ -40,7 +40,7 @@ func CertificateSigningRequestApproval(name, namespace string) *CertificateSigni b.WithName(name) b.WithNamespace(namespace) b.WithKind("CertificateSigningRequestApproval") - b.WithAPIVersion("hypershift.openshift.io/v1beta1") + b.WithAPIVersion("certificates.hypershift.openshift.io/v1alpha1") return b } @@ -205,7 +205,7 @@ func (b *CertificateSigningRequestApprovalApplyConfiguration) ensureObjectMetaAp // 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 *CertificateSigningRequestApprovalApplyConfiguration) WithSpec(value v1beta1.CertificateSigningRequestApprovalSpec) *CertificateSigningRequestApprovalApplyConfiguration { +func (b *CertificateSigningRequestApprovalApplyConfiguration) WithSpec(value v1alpha1.CertificateSigningRequestApprovalSpec) *CertificateSigningRequestApprovalApplyConfiguration { b.Spec = &value return b } @@ -213,7 +213,7 @@ func (b *CertificateSigningRequestApprovalApplyConfiguration) WithSpec(value v1b // 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 *CertificateSigningRequestApprovalApplyConfiguration) WithStatus(value v1beta1.CertificateSigningRequestApprovalStatus) *CertificateSigningRequestApprovalApplyConfiguration { +func (b *CertificateSigningRequestApprovalApplyConfiguration) WithStatus(value v1alpha1.CertificateSigningRequestApprovalStatus) *CertificateSigningRequestApprovalApplyConfiguration { b.Status = &value return b } diff --git a/client/applyconfiguration/utils.go b/client/applyconfiguration/utils.go index 745eb13b6e..d893783041 100644 --- a/client/applyconfiguration/utils.go +++ b/client/applyconfiguration/utils.go @@ -18,9 +18,11 @@ limitations under the License. package applyconfiguration import ( - v1alpha1 "github.com/openshift/hypershift/api/hypershift/v1alpha1" + v1alpha1 "github.com/openshift/hypershift/api/certificates/v1alpha1" + hypershiftv1alpha1 "github.com/openshift/hypershift/api/hypershift/v1alpha1" v1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" - hypershiftv1alpha1 "github.com/openshift/hypershift/client/applyconfiguration/hypershift/v1alpha1" + certificatesv1alpha1 "github.com/openshift/hypershift/client/applyconfiguration/certificates/v1alpha1" + applyconfigurationhypershiftv1alpha1 "github.com/openshift/hypershift/client/applyconfiguration/hypershift/v1alpha1" hypershiftv1beta1 "github.com/openshift/hypershift/client/applyconfiguration/hypershift/v1beta1" schema "k8s.io/apimachinery/pkg/runtime/schema" ) @@ -29,179 +31,183 @@ import ( // apply configuration type exists for the given GroupVersionKind. func ForKind(kind schema.GroupVersionKind) interface{} { switch kind { - // Group=hypershift.openshift.io, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithKind("AESCBCSpec"): - return &hypershiftv1alpha1.AESCBCSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AgentNodePoolPlatform"): - return &hypershiftv1alpha1.AgentNodePoolPlatformApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AgentPlatformSpec"): - return &hypershiftv1alpha1.AgentPlatformSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("APIEndpoint"): - return &hypershiftv1alpha1.APIEndpointApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("APIServerNetworking"): - return &hypershiftv1alpha1.APIServerNetworkingApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AWSCloudProviderConfig"): - return &hypershiftv1alpha1.AWSCloudProviderConfigApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AWSKMSAuthSpec"): - return &hypershiftv1alpha1.AWSKMSAuthSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AWSKMSKeyEntry"): - return &hypershiftv1alpha1.AWSKMSKeyEntryApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AWSKMSSpec"): - return &hypershiftv1alpha1.AWSKMSSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AWSNodePoolPlatform"): - return &hypershiftv1alpha1.AWSNodePoolPlatformApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AWSPlatformSpec"): - return &hypershiftv1alpha1.AWSPlatformSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AWSPlatformStatus"): - return &hypershiftv1alpha1.AWSPlatformStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AWSResourceReference"): - return &hypershiftv1alpha1.AWSResourceReferenceApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AWSResourceTag"): - return &hypershiftv1alpha1.AWSResourceTagApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AWSRoleCredentials"): - return &hypershiftv1alpha1.AWSRoleCredentialsApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AWSRolesRef"): - return &hypershiftv1alpha1.AWSRolesRefApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AWSServiceEndpoint"): - return &hypershiftv1alpha1.AWSServiceEndpointApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AzureKMSSpec"): - return &hypershiftv1alpha1.AzureKMSSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AzureNodePoolPlatform"): - return &hypershiftv1alpha1.AzureNodePoolPlatformApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("AzurePlatformSpec"): - return &hypershiftv1alpha1.AzurePlatformSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ClusterAutoscaling"): - return &hypershiftv1alpha1.ClusterAutoscalingApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ClusterConfiguration"): - return &hypershiftv1alpha1.ClusterConfigurationApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ClusterNetworkEntry"): - return &hypershiftv1alpha1.ClusterNetworkEntryApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ClusterNetworking"): - return &hypershiftv1alpha1.ClusterNetworkingApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ClusterVersionStatus"): - return &hypershiftv1alpha1.ClusterVersionStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("DNSSpec"): - return &hypershiftv1alpha1.DNSSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("EtcdSpec"): - return &hypershiftv1alpha1.EtcdSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("EtcdTLSConfig"): - return &hypershiftv1alpha1.EtcdTLSConfigApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Filter"): - return &hypershiftv1alpha1.FilterApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("HostedCluster"): - return &hypershiftv1alpha1.HostedClusterApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("HostedClusterSpec"): - return &hypershiftv1alpha1.HostedClusterSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("HostedClusterStatus"): - return &hypershiftv1alpha1.HostedClusterStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("IBMCloudKMSAuthSpec"): - return &hypershiftv1alpha1.IBMCloudKMSAuthSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("IBMCloudKMSKeyEntry"): - return &hypershiftv1alpha1.IBMCloudKMSKeyEntryApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("IBMCloudKMSSpec"): - return &hypershiftv1alpha1.IBMCloudKMSSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("IBMCloudKMSUnmanagedAuthSpec"): - return &hypershiftv1alpha1.IBMCloudKMSUnmanagedAuthSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("IBMCloudPlatformSpec"): - return &hypershiftv1alpha1.IBMCloudPlatformSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ImageContentSource"): - return &hypershiftv1alpha1.ImageContentSourceApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("InPlaceUpgrade"): - return &hypershiftv1alpha1.InPlaceUpgradeApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KMSSpec"): - return &hypershiftv1alpha1.KMSSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubeconfigSecretRef"): - return &hypershiftv1alpha1.KubeconfigSecretRefApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubevirtCachingStrategy"): - return &hypershiftv1alpha1.KubevirtCachingStrategyApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubevirtCompute"): - return &hypershiftv1alpha1.KubevirtComputeApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubevirtDiskImage"): - return &hypershiftv1alpha1.KubevirtDiskImageApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubevirtManualStorageDriverConfig"): - return &hypershiftv1alpha1.KubevirtManualStorageDriverConfigApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubevirtNetwork"): - return &hypershiftv1alpha1.KubevirtNetworkApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubevirtNodePoolPlatform"): - return &hypershiftv1alpha1.KubevirtNodePoolPlatformApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubeVirtNodePoolStatus"): - return &hypershiftv1alpha1.KubeVirtNodePoolStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubevirtPersistentVolume"): - return &hypershiftv1alpha1.KubevirtPersistentVolumeApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubevirtPlatformCredentials"): - return &hypershiftv1alpha1.KubevirtPlatformCredentialsApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubevirtPlatformSpec"): - return &hypershiftv1alpha1.KubevirtPlatformSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubevirtRootVolume"): - return &hypershiftv1alpha1.KubevirtRootVolumeApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubevirtStorageClassMapping"): - return &hypershiftv1alpha1.KubevirtStorageClassMappingApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubevirtStorageDriverSpec"): - return &hypershiftv1alpha1.KubevirtStorageDriverSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("KubevirtVolume"): - return &hypershiftv1alpha1.KubevirtVolumeApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("LoadBalancerPublishingStrategy"): - return &hypershiftv1alpha1.LoadBalancerPublishingStrategyApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("MachineNetworkEntry"): - return &hypershiftv1alpha1.MachineNetworkEntryApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ManagedEtcdSpec"): - return &hypershiftv1alpha1.ManagedEtcdSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ManagedEtcdStorageSpec"): - return &hypershiftv1alpha1.ManagedEtcdStorageSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("NodePool"): - return &hypershiftv1alpha1.NodePoolApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("NodePoolAutoScaling"): - return &hypershiftv1alpha1.NodePoolAutoScalingApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("NodePoolCondition"): - return &hypershiftv1alpha1.NodePoolConditionApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("NodePoolManagement"): - return &hypershiftv1alpha1.NodePoolManagementApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("NodePoolPlatform"): - return &hypershiftv1alpha1.NodePoolPlatformApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("NodePoolPlatformStatus"): - return &hypershiftv1alpha1.NodePoolPlatformStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("NodePoolSpec"): - return &hypershiftv1alpha1.NodePoolSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("NodePoolStatus"): - return &hypershiftv1alpha1.NodePoolStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("NodePortPublishingStrategy"): - return &hypershiftv1alpha1.NodePortPublishingStrategyApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("PersistentVolumeEtcdStorageSpec"): - return &hypershiftv1alpha1.PersistentVolumeEtcdStorageSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("PlatformSpec"): - return &hypershiftv1alpha1.PlatformSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("PlatformStatus"): - return &hypershiftv1alpha1.PlatformStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("PowerVSNodePoolPlatform"): - return &hypershiftv1alpha1.PowerVSNodePoolPlatformApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("PowerVSPlatformSpec"): - return &hypershiftv1alpha1.PowerVSPlatformSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("PowerVSResourceReference"): - return &hypershiftv1alpha1.PowerVSResourceReferenceApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("PowerVSVPC"): - return &hypershiftv1alpha1.PowerVSVPCApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Release"): - return &hypershiftv1alpha1.ReleaseApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ReplaceUpgrade"): - return &hypershiftv1alpha1.ReplaceUpgradeApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("RollingUpdate"): - return &hypershiftv1alpha1.RollingUpdateApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("RoutePublishingStrategy"): - return &hypershiftv1alpha1.RoutePublishingStrategyApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("SecretEncryptionSpec"): - return &hypershiftv1alpha1.SecretEncryptionSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ServiceNetworkEntry"): - return &hypershiftv1alpha1.ServiceNetworkEntryApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ServicePublishingStrategy"): - return &hypershiftv1alpha1.ServicePublishingStrategyApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ServicePublishingStrategyMapping"): - return &hypershiftv1alpha1.ServicePublishingStrategyMappingApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Taint"): - return &hypershiftv1alpha1.TaintApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("UnmanagedEtcdSpec"): - return &hypershiftv1alpha1.UnmanagedEtcdSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Volume"): - return &hypershiftv1alpha1.VolumeApplyConfiguration{} + // Group=certificates.hypershift.openshift.io, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithKind("CertificateSigningRequestApproval"): + return &certificatesv1alpha1.CertificateSigningRequestApprovalApplyConfiguration{} + + // Group=hypershift.openshift.io, Version=v1alpha1 + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AESCBCSpec"): + return &applyconfigurationhypershiftv1alpha1.AESCBCSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AgentNodePoolPlatform"): + return &applyconfigurationhypershiftv1alpha1.AgentNodePoolPlatformApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AgentPlatformSpec"): + return &applyconfigurationhypershiftv1alpha1.AgentPlatformSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("APIEndpoint"): + return &applyconfigurationhypershiftv1alpha1.APIEndpointApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("APIServerNetworking"): + return &applyconfigurationhypershiftv1alpha1.APIServerNetworkingApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AWSCloudProviderConfig"): + return &applyconfigurationhypershiftv1alpha1.AWSCloudProviderConfigApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AWSKMSAuthSpec"): + return &applyconfigurationhypershiftv1alpha1.AWSKMSAuthSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AWSKMSKeyEntry"): + return &applyconfigurationhypershiftv1alpha1.AWSKMSKeyEntryApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AWSKMSSpec"): + return &applyconfigurationhypershiftv1alpha1.AWSKMSSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AWSNodePoolPlatform"): + return &applyconfigurationhypershiftv1alpha1.AWSNodePoolPlatformApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AWSPlatformSpec"): + return &applyconfigurationhypershiftv1alpha1.AWSPlatformSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AWSPlatformStatus"): + return &applyconfigurationhypershiftv1alpha1.AWSPlatformStatusApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AWSResourceReference"): + return &applyconfigurationhypershiftv1alpha1.AWSResourceReferenceApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AWSResourceTag"): + return &applyconfigurationhypershiftv1alpha1.AWSResourceTagApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AWSRoleCredentials"): + return &applyconfigurationhypershiftv1alpha1.AWSRoleCredentialsApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AWSRolesRef"): + return &applyconfigurationhypershiftv1alpha1.AWSRolesRefApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AWSServiceEndpoint"): + return &applyconfigurationhypershiftv1alpha1.AWSServiceEndpointApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AzureKMSSpec"): + return &applyconfigurationhypershiftv1alpha1.AzureKMSSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AzureNodePoolPlatform"): + return &applyconfigurationhypershiftv1alpha1.AzureNodePoolPlatformApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("AzurePlatformSpec"): + return &applyconfigurationhypershiftv1alpha1.AzurePlatformSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("ClusterAutoscaling"): + return &applyconfigurationhypershiftv1alpha1.ClusterAutoscalingApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("ClusterConfiguration"): + return &applyconfigurationhypershiftv1alpha1.ClusterConfigurationApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("ClusterNetworkEntry"): + return &applyconfigurationhypershiftv1alpha1.ClusterNetworkEntryApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("ClusterNetworking"): + return &applyconfigurationhypershiftv1alpha1.ClusterNetworkingApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("ClusterVersionStatus"): + return &applyconfigurationhypershiftv1alpha1.ClusterVersionStatusApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("DNSSpec"): + return &applyconfigurationhypershiftv1alpha1.DNSSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("EtcdSpec"): + return &applyconfigurationhypershiftv1alpha1.EtcdSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("EtcdTLSConfig"): + return &applyconfigurationhypershiftv1alpha1.EtcdTLSConfigApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("Filter"): + return &applyconfigurationhypershiftv1alpha1.FilterApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("HostedCluster"): + return &applyconfigurationhypershiftv1alpha1.HostedClusterApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("HostedClusterSpec"): + return &applyconfigurationhypershiftv1alpha1.HostedClusterSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("HostedClusterStatus"): + return &applyconfigurationhypershiftv1alpha1.HostedClusterStatusApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("IBMCloudKMSAuthSpec"): + return &applyconfigurationhypershiftv1alpha1.IBMCloudKMSAuthSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("IBMCloudKMSKeyEntry"): + return &applyconfigurationhypershiftv1alpha1.IBMCloudKMSKeyEntryApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("IBMCloudKMSSpec"): + return &applyconfigurationhypershiftv1alpha1.IBMCloudKMSSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("IBMCloudKMSUnmanagedAuthSpec"): + return &applyconfigurationhypershiftv1alpha1.IBMCloudKMSUnmanagedAuthSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("IBMCloudPlatformSpec"): + return &applyconfigurationhypershiftv1alpha1.IBMCloudPlatformSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("ImageContentSource"): + return &applyconfigurationhypershiftv1alpha1.ImageContentSourceApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("InPlaceUpgrade"): + return &applyconfigurationhypershiftv1alpha1.InPlaceUpgradeApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KMSSpec"): + return &applyconfigurationhypershiftv1alpha1.KMSSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubeconfigSecretRef"): + return &applyconfigurationhypershiftv1alpha1.KubeconfigSecretRefApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubevirtCachingStrategy"): + return &applyconfigurationhypershiftv1alpha1.KubevirtCachingStrategyApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubevirtCompute"): + return &applyconfigurationhypershiftv1alpha1.KubevirtComputeApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubevirtDiskImage"): + return &applyconfigurationhypershiftv1alpha1.KubevirtDiskImageApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubevirtManualStorageDriverConfig"): + return &applyconfigurationhypershiftv1alpha1.KubevirtManualStorageDriverConfigApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubevirtNetwork"): + return &applyconfigurationhypershiftv1alpha1.KubevirtNetworkApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubevirtNodePoolPlatform"): + return &applyconfigurationhypershiftv1alpha1.KubevirtNodePoolPlatformApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubeVirtNodePoolStatus"): + return &applyconfigurationhypershiftv1alpha1.KubeVirtNodePoolStatusApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubevirtPersistentVolume"): + return &applyconfigurationhypershiftv1alpha1.KubevirtPersistentVolumeApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubevirtPlatformCredentials"): + return &applyconfigurationhypershiftv1alpha1.KubevirtPlatformCredentialsApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubevirtPlatformSpec"): + return &applyconfigurationhypershiftv1alpha1.KubevirtPlatformSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubevirtRootVolume"): + return &applyconfigurationhypershiftv1alpha1.KubevirtRootVolumeApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubevirtStorageClassMapping"): + return &applyconfigurationhypershiftv1alpha1.KubevirtStorageClassMappingApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubevirtStorageDriverSpec"): + return &applyconfigurationhypershiftv1alpha1.KubevirtStorageDriverSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("KubevirtVolume"): + return &applyconfigurationhypershiftv1alpha1.KubevirtVolumeApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("LoadBalancerPublishingStrategy"): + return &applyconfigurationhypershiftv1alpha1.LoadBalancerPublishingStrategyApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("MachineNetworkEntry"): + return &applyconfigurationhypershiftv1alpha1.MachineNetworkEntryApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("ManagedEtcdSpec"): + return &applyconfigurationhypershiftv1alpha1.ManagedEtcdSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("ManagedEtcdStorageSpec"): + return &applyconfigurationhypershiftv1alpha1.ManagedEtcdStorageSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("NodePool"): + return &applyconfigurationhypershiftv1alpha1.NodePoolApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("NodePoolAutoScaling"): + return &applyconfigurationhypershiftv1alpha1.NodePoolAutoScalingApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("NodePoolCondition"): + return &applyconfigurationhypershiftv1alpha1.NodePoolConditionApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("NodePoolManagement"): + return &applyconfigurationhypershiftv1alpha1.NodePoolManagementApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("NodePoolPlatform"): + return &applyconfigurationhypershiftv1alpha1.NodePoolPlatformApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("NodePoolPlatformStatus"): + return &applyconfigurationhypershiftv1alpha1.NodePoolPlatformStatusApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("NodePoolSpec"): + return &applyconfigurationhypershiftv1alpha1.NodePoolSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("NodePoolStatus"): + return &applyconfigurationhypershiftv1alpha1.NodePoolStatusApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("NodePortPublishingStrategy"): + return &applyconfigurationhypershiftv1alpha1.NodePortPublishingStrategyApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("PersistentVolumeEtcdStorageSpec"): + return &applyconfigurationhypershiftv1alpha1.PersistentVolumeEtcdStorageSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("PlatformSpec"): + return &applyconfigurationhypershiftv1alpha1.PlatformSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("PlatformStatus"): + return &applyconfigurationhypershiftv1alpha1.PlatformStatusApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("PowerVSNodePoolPlatform"): + return &applyconfigurationhypershiftv1alpha1.PowerVSNodePoolPlatformApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("PowerVSPlatformSpec"): + return &applyconfigurationhypershiftv1alpha1.PowerVSPlatformSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("PowerVSResourceReference"): + return &applyconfigurationhypershiftv1alpha1.PowerVSResourceReferenceApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("PowerVSVPC"): + return &applyconfigurationhypershiftv1alpha1.PowerVSVPCApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("Release"): + return &applyconfigurationhypershiftv1alpha1.ReleaseApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("ReplaceUpgrade"): + return &applyconfigurationhypershiftv1alpha1.ReplaceUpgradeApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("RollingUpdate"): + return &applyconfigurationhypershiftv1alpha1.RollingUpdateApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("RoutePublishingStrategy"): + return &applyconfigurationhypershiftv1alpha1.RoutePublishingStrategyApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("SecretEncryptionSpec"): + return &applyconfigurationhypershiftv1alpha1.SecretEncryptionSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("ServiceNetworkEntry"): + return &applyconfigurationhypershiftv1alpha1.ServiceNetworkEntryApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("ServicePublishingStrategy"): + return &applyconfigurationhypershiftv1alpha1.ServicePublishingStrategyApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("ServicePublishingStrategyMapping"): + return &applyconfigurationhypershiftv1alpha1.ServicePublishingStrategyMappingApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("Taint"): + return &applyconfigurationhypershiftv1alpha1.TaintApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("UnmanagedEtcdSpec"): + return &applyconfigurationhypershiftv1alpha1.UnmanagedEtcdSpecApplyConfiguration{} + case hypershiftv1alpha1.SchemeGroupVersion.WithKind("Volume"): + return &applyconfigurationhypershiftv1alpha1.VolumeApplyConfiguration{} // Group=hypershift.openshift.io, Version=v1beta1 case v1beta1.SchemeGroupVersion.WithKind("AESCBCSpec"): @@ -242,8 +248,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &hypershiftv1beta1.AzureNodePoolPlatformApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("AzurePlatformSpec"): return &hypershiftv1beta1.AzurePlatformSpecApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequestApproval"): - return &hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ClusterAutoscaling"): return &hypershiftv1beta1.ClusterAutoscalingApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ClusterConfiguration"): diff --git a/client/clientset/clientset/clientset.go b/client/clientset/clientset/clientset.go index 0e6c429136..e4f581feae 100644 --- a/client/clientset/clientset/clientset.go +++ b/client/clientset/clientset/clientset.go @@ -21,6 +21,7 @@ import ( "fmt" "net/http" + certificatesv1alpha1 "github.com/openshift/hypershift/client/clientset/clientset/typed/certificates/v1alpha1" hypershiftv1alpha1 "github.com/openshift/hypershift/client/clientset/clientset/typed/hypershift/v1alpha1" hypershiftv1beta1 "github.com/openshift/hypershift/client/clientset/clientset/typed/hypershift/v1beta1" discovery "k8s.io/client-go/discovery" @@ -30,6 +31,7 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface + CertificatesV1alpha1() certificatesv1alpha1.CertificatesV1alpha1Interface HypershiftV1alpha1() hypershiftv1alpha1.HypershiftV1alpha1Interface HypershiftV1beta1() hypershiftv1beta1.HypershiftV1beta1Interface } @@ -37,8 +39,14 @@ type Interface interface { // Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient - hypershiftV1alpha1 *hypershiftv1alpha1.HypershiftV1alpha1Client - hypershiftV1beta1 *hypershiftv1beta1.HypershiftV1beta1Client + certificatesV1alpha1 *certificatesv1alpha1.CertificatesV1alpha1Client + hypershiftV1alpha1 *hypershiftv1alpha1.HypershiftV1alpha1Client + hypershiftV1beta1 *hypershiftv1beta1.HypershiftV1beta1Client +} + +// CertificatesV1alpha1 retrieves the CertificatesV1alpha1Client +func (c *Clientset) CertificatesV1alpha1() certificatesv1alpha1.CertificatesV1alpha1Interface { + return c.certificatesV1alpha1 } // HypershiftV1alpha1 retrieves the HypershiftV1alpha1Client @@ -95,6 +103,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, var cs Clientset var err error + cs.certificatesV1alpha1, err = certificatesv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.hypershiftV1alpha1, err = hypershiftv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -124,6 +136,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset + cs.certificatesV1alpha1 = certificatesv1alpha1.New(c) cs.hypershiftV1alpha1 = hypershiftv1alpha1.New(c) cs.hypershiftV1beta1 = hypershiftv1beta1.New(c) diff --git a/client/clientset/clientset/fake/clientset_generated.go b/client/clientset/clientset/fake/clientset_generated.go index 5a8605c9ae..194f085464 100644 --- a/client/clientset/clientset/fake/clientset_generated.go +++ b/client/clientset/clientset/fake/clientset_generated.go @@ -19,6 +19,8 @@ package fake import ( clientset "github.com/openshift/hypershift/client/clientset/clientset" + certificatesv1alpha1 "github.com/openshift/hypershift/client/clientset/clientset/typed/certificates/v1alpha1" + fakecertificatesv1alpha1 "github.com/openshift/hypershift/client/clientset/clientset/typed/certificates/v1alpha1/fake" hypershiftv1alpha1 "github.com/openshift/hypershift/client/clientset/clientset/typed/hypershift/v1alpha1" fakehypershiftv1alpha1 "github.com/openshift/hypershift/client/clientset/clientset/typed/hypershift/v1alpha1/fake" hypershiftv1beta1 "github.com/openshift/hypershift/client/clientset/clientset/typed/hypershift/v1beta1" @@ -80,6 +82,11 @@ var ( _ testing.FakeClient = &Clientset{} ) +// CertificatesV1alpha1 retrieves the CertificatesV1alpha1Client +func (c *Clientset) CertificatesV1alpha1() certificatesv1alpha1.CertificatesV1alpha1Interface { + return &fakecertificatesv1alpha1.FakeCertificatesV1alpha1{Fake: &c.Fake} +} + // HypershiftV1alpha1 retrieves the HypershiftV1alpha1Client func (c *Clientset) HypershiftV1alpha1() hypershiftv1alpha1.HypershiftV1alpha1Interface { return &fakehypershiftv1alpha1.FakeHypershiftV1alpha1{Fake: &c.Fake} diff --git a/client/clientset/clientset/fake/register.go b/client/clientset/clientset/fake/register.go index cf336fd1cb..056c332d88 100644 --- a/client/clientset/clientset/fake/register.go +++ b/client/clientset/clientset/fake/register.go @@ -18,6 +18,7 @@ limitations under the License. package fake import ( + certificatesv1alpha1 "github.com/openshift/hypershift/api/certificates/v1alpha1" hypershiftv1alpha1 "github.com/openshift/hypershift/api/hypershift/v1alpha1" hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -31,6 +32,7 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ + certificatesv1alpha1.AddToScheme, hypershiftv1alpha1.AddToScheme, hypershiftv1beta1.AddToScheme, } diff --git a/client/clientset/clientset/scheme/register.go b/client/clientset/clientset/scheme/register.go index 02f80fde31..92f1e1295a 100644 --- a/client/clientset/clientset/scheme/register.go +++ b/client/clientset/clientset/scheme/register.go @@ -18,6 +18,7 @@ limitations under the License. package scheme import ( + certificatesv1alpha1 "github.com/openshift/hypershift/api/certificates/v1alpha1" hypershiftv1alpha1 "github.com/openshift/hypershift/api/hypershift/v1alpha1" hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -31,6 +32,7 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ + certificatesv1alpha1.AddToScheme, hypershiftv1alpha1.AddToScheme, hypershiftv1beta1.AddToScheme, } diff --git a/client/clientset/clientset/typed/certificates/v1alpha1/certificates_client.go b/client/clientset/clientset/typed/certificates/v1alpha1/certificates_client.go new file mode 100644 index 0000000000..a316cd0cec --- /dev/null +++ b/client/clientset/clientset/typed/certificates/v1alpha1/certificates_client.go @@ -0,0 +1,106 @@ +/* + + +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 client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + v1alpha1 "github.com/openshift/hypershift/api/certificates/v1alpha1" + "github.com/openshift/hypershift/client/clientset/clientset/scheme" + rest "k8s.io/client-go/rest" +) + +type CertificatesV1alpha1Interface interface { + RESTClient() rest.Interface + CertificateSigningRequestApprovalsGetter +} + +// CertificatesV1alpha1Client is used to interact with features provided by the certificates.hypershift.openshift.io group. +type CertificatesV1alpha1Client struct { + restClient rest.Interface +} + +func (c *CertificatesV1alpha1Client) CertificateSigningRequestApprovals(namespace string) CertificateSigningRequestApprovalInterface { + return newCertificateSigningRequestApprovals(c, namespace) +} + +// NewForConfig creates a new CertificatesV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*CertificatesV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new CertificatesV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CertificatesV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &CertificatesV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new CertificatesV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *CertificatesV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new CertificatesV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *CertificatesV1alpha1Client { + return &CertificatesV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *CertificatesV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/client/clientset/clientset/typed/hypershift/v1beta1/certificatesigningrequestapproval.go b/client/clientset/clientset/typed/certificates/v1alpha1/certificatesigningrequestapproval.go similarity index 73% rename from client/clientset/clientset/typed/hypershift/v1beta1/certificatesigningrequestapproval.go rename to client/clientset/clientset/typed/certificates/v1alpha1/certificatesigningrequestapproval.go index 313ecdd31c..e71feed455 100644 --- a/client/clientset/clientset/typed/hypershift/v1beta1/certificatesigningrequestapproval.go +++ b/client/clientset/clientset/typed/certificates/v1alpha1/certificatesigningrequestapproval.go @@ -15,7 +15,7 @@ limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. -package v1beta1 +package v1alpha1 import ( "context" @@ -23,8 +23,8 @@ import ( "fmt" "time" - v1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" - hypershiftv1beta1 "github.com/openshift/hypershift/client/applyconfiguration/hypershift/v1beta1" + v1alpha1 "github.com/openshift/hypershift/api/certificates/v1alpha1" + certificatesv1alpha1 "github.com/openshift/hypershift/client/applyconfiguration/certificates/v1alpha1" scheme "github.com/openshift/hypershift/client/clientset/clientset/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -40,17 +40,17 @@ type CertificateSigningRequestApprovalsGetter interface { // CertificateSigningRequestApprovalInterface has methods to work with CertificateSigningRequestApproval resources. type CertificateSigningRequestApprovalInterface interface { - Create(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.CreateOptions) (*v1beta1.CertificateSigningRequestApproval, error) - Update(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequestApproval, error) - UpdateStatus(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequestApproval, error) + Create(ctx context.Context, certificateSigningRequestApproval *v1alpha1.CertificateSigningRequestApproval, opts v1.CreateOptions) (*v1alpha1.CertificateSigningRequestApproval, error) + Update(ctx context.Context, certificateSigningRequestApproval *v1alpha1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (*v1alpha1.CertificateSigningRequestApproval, error) + UpdateStatus(ctx context.Context, certificateSigningRequestApproval *v1alpha1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (*v1alpha1.CertificateSigningRequestApproval, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CertificateSigningRequestApproval, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CertificateSigningRequestApprovalList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.CertificateSigningRequestApproval, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.CertificateSigningRequestApprovalList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequestApproval, err error) - Apply(ctx context.Context, certificateSigningRequestApproval *hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) - ApplyStatus(ctx context.Context, certificateSigningRequestApproval *hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CertificateSigningRequestApproval, err error) + Apply(ctx context.Context, certificateSigningRequestApproval *certificatesv1alpha1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.CertificateSigningRequestApproval, err error) + ApplyStatus(ctx context.Context, certificateSigningRequestApproval *certificatesv1alpha1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.CertificateSigningRequestApproval, err error) CertificateSigningRequestApprovalExpansion } @@ -61,7 +61,7 @@ type certificateSigningRequestApprovals struct { } // newCertificateSigningRequestApprovals returns a CertificateSigningRequestApprovals -func newCertificateSigningRequestApprovals(c *HypershiftV1beta1Client, namespace string) *certificateSigningRequestApprovals { +func newCertificateSigningRequestApprovals(c *CertificatesV1alpha1Client, namespace string) *certificateSigningRequestApprovals { return &certificateSigningRequestApprovals{ client: c.RESTClient(), ns: namespace, @@ -69,8 +69,8 @@ func newCertificateSigningRequestApprovals(c *HypershiftV1beta1Client, namespace } // Get takes name of the certificateSigningRequestApproval, and returns the corresponding certificateSigningRequestApproval object, and an error if there is any. -func (c *certificateSigningRequestApprovals) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { - result = &v1beta1.CertificateSigningRequestApproval{} +func (c *certificateSigningRequestApprovals) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CertificateSigningRequestApproval, err error) { + result = &v1alpha1.CertificateSigningRequestApproval{} err = c.client.Get(). Namespace(c.ns). Resource("certificatesigningrequestapprovals"). @@ -82,12 +82,12 @@ func (c *certificateSigningRequestApprovals) Get(ctx context.Context, name strin } // List takes label and field selectors, and returns the list of CertificateSigningRequestApprovals that match those selectors. -func (c *certificateSigningRequestApprovals) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestApprovalList, err error) { +func (c *certificateSigningRequestApprovals) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CertificateSigningRequestApprovalList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1beta1.CertificateSigningRequestApprovalList{} + result = &v1alpha1.CertificateSigningRequestApprovalList{} err = c.client.Get(). Namespace(c.ns). Resource("certificatesigningrequestapprovals"). @@ -114,8 +114,8 @@ func (c *certificateSigningRequestApprovals) Watch(ctx context.Context, opts v1. } // Create takes the representation of a certificateSigningRequestApproval and creates it. Returns the server's representation of the certificateSigningRequestApproval, and an error, if there is any. -func (c *certificateSigningRequestApprovals) Create(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.CreateOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { - result = &v1beta1.CertificateSigningRequestApproval{} +func (c *certificateSigningRequestApprovals) Create(ctx context.Context, certificateSigningRequestApproval *v1alpha1.CertificateSigningRequestApproval, opts v1.CreateOptions) (result *v1alpha1.CertificateSigningRequestApproval, err error) { + result = &v1alpha1.CertificateSigningRequestApproval{} err = c.client.Post(). Namespace(c.ns). Resource("certificatesigningrequestapprovals"). @@ -127,8 +127,8 @@ func (c *certificateSigningRequestApprovals) Create(ctx context.Context, certifi } // Update takes the representation of a certificateSigningRequestApproval and updates it. Returns the server's representation of the certificateSigningRequestApproval, and an error, if there is any. -func (c *certificateSigningRequestApprovals) Update(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { - result = &v1beta1.CertificateSigningRequestApproval{} +func (c *certificateSigningRequestApprovals) Update(ctx context.Context, certificateSigningRequestApproval *v1alpha1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (result *v1alpha1.CertificateSigningRequestApproval, err error) { + result = &v1alpha1.CertificateSigningRequestApproval{} err = c.client.Put(). Namespace(c.ns). Resource("certificatesigningrequestapprovals"). @@ -142,8 +142,8 @@ func (c *certificateSigningRequestApprovals) Update(ctx context.Context, certifi // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *certificateSigningRequestApprovals) UpdateStatus(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { - result = &v1beta1.CertificateSigningRequestApproval{} +func (c *certificateSigningRequestApprovals) UpdateStatus(ctx context.Context, certificateSigningRequestApproval *v1alpha1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (result *v1alpha1.CertificateSigningRequestApproval, err error) { + result = &v1alpha1.CertificateSigningRequestApproval{} err = c.client.Put(). Namespace(c.ns). Resource("certificatesigningrequestapprovals"). @@ -184,8 +184,8 @@ func (c *certificateSigningRequestApprovals) DeleteCollection(ctx context.Contex } // Patch applies the patch and returns the patched certificateSigningRequestApproval. -func (c *certificateSigningRequestApprovals) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequestApproval, err error) { - result = &v1beta1.CertificateSigningRequestApproval{} +func (c *certificateSigningRequestApprovals) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CertificateSigningRequestApproval, err error) { + result = &v1alpha1.CertificateSigningRequestApproval{} err = c.client.Patch(pt). Namespace(c.ns). Resource("certificatesigningrequestapprovals"). @@ -199,7 +199,7 @@ func (c *certificateSigningRequestApprovals) Patch(ctx context.Context, name str } // Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequestApproval. -func (c *certificateSigningRequestApprovals) Apply(ctx context.Context, certificateSigningRequestApproval *hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { +func (c *certificateSigningRequestApprovals) Apply(ctx context.Context, certificateSigningRequestApproval *certificatesv1alpha1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.CertificateSigningRequestApproval, err error) { if certificateSigningRequestApproval == nil { return nil, fmt.Errorf("certificateSigningRequestApproval provided to Apply must not be nil") } @@ -212,7 +212,7 @@ func (c *certificateSigningRequestApprovals) Apply(ctx context.Context, certific if name == nil { return nil, fmt.Errorf("certificateSigningRequestApproval.Name must be provided to Apply") } - result = &v1beta1.CertificateSigningRequestApproval{} + result = &v1alpha1.CertificateSigningRequestApproval{} err = c.client.Patch(types.ApplyPatchType). Namespace(c.ns). Resource("certificatesigningrequestapprovals"). @@ -226,7 +226,7 @@ func (c *certificateSigningRequestApprovals) Apply(ctx context.Context, certific // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *certificateSigningRequestApprovals) ApplyStatus(ctx context.Context, certificateSigningRequestApproval *hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { +func (c *certificateSigningRequestApprovals) ApplyStatus(ctx context.Context, certificateSigningRequestApproval *certificatesv1alpha1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.CertificateSigningRequestApproval, err error) { if certificateSigningRequestApproval == nil { return nil, fmt.Errorf("certificateSigningRequestApproval provided to Apply must not be nil") } @@ -241,7 +241,7 @@ func (c *certificateSigningRequestApprovals) ApplyStatus(ctx context.Context, ce return nil, fmt.Errorf("certificateSigningRequestApproval.Name must be provided to Apply") } - result = &v1beta1.CertificateSigningRequestApproval{} + result = &v1alpha1.CertificateSigningRequestApproval{} err = c.client.Patch(types.ApplyPatchType). Namespace(c.ns). Resource("certificatesigningrequestapprovals"). diff --git a/client/clientset/clientset/typed/certificates/v1alpha1/doc.go b/client/clientset/clientset/typed/certificates/v1alpha1/doc.go new file mode 100644 index 0000000000..0e375e4fc2 --- /dev/null +++ b/client/clientset/clientset/typed/certificates/v1alpha1/doc.go @@ -0,0 +1,19 @@ +/* + + +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 client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/client/clientset/clientset/typed/certificates/v1alpha1/fake/doc.go b/client/clientset/clientset/typed/certificates/v1alpha1/fake/doc.go new file mode 100644 index 0000000000..422564f2d5 --- /dev/null +++ b/client/clientset/clientset/typed/certificates/v1alpha1/fake/doc.go @@ -0,0 +1,19 @@ +/* + + +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 client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/client/clientset/clientset/typed/certificates/v1alpha1/fake/fake_certificates_client.go b/client/clientset/clientset/typed/certificates/v1alpha1/fake/fake_certificates_client.go new file mode 100644 index 0000000000..10361f15d6 --- /dev/null +++ b/client/clientset/clientset/typed/certificates/v1alpha1/fake/fake_certificates_client.go @@ -0,0 +1,39 @@ +/* + + +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 client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/openshift/hypershift/client/clientset/clientset/typed/certificates/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeCertificatesV1alpha1 struct { + *testing.Fake +} + +func (c *FakeCertificatesV1alpha1) CertificateSigningRequestApprovals(namespace string) v1alpha1.CertificateSigningRequestApprovalInterface { + return &FakeCertificateSigningRequestApprovals{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeCertificatesV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_certificatesigningrequestapproval.go b/client/clientset/clientset/typed/certificates/v1alpha1/fake/fake_certificatesigningrequestapproval.go similarity index 66% rename from client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_certificatesigningrequestapproval.go rename to client/clientset/clientset/typed/certificates/v1alpha1/fake/fake_certificatesigningrequestapproval.go index 6d9e62e34d..fd365c96c3 100644 --- a/client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_certificatesigningrequestapproval.go +++ b/client/clientset/clientset/typed/certificates/v1alpha1/fake/fake_certificatesigningrequestapproval.go @@ -22,8 +22,8 @@ import ( json "encoding/json" "fmt" - v1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" - hypershiftv1beta1 "github.com/openshift/hypershift/client/applyconfiguration/hypershift/v1beta1" + v1alpha1 "github.com/openshift/hypershift/api/certificates/v1alpha1" + certificatesv1alpha1 "github.com/openshift/hypershift/client/applyconfiguration/certificates/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" @@ -33,29 +33,29 @@ import ( // FakeCertificateSigningRequestApprovals implements CertificateSigningRequestApprovalInterface type FakeCertificateSigningRequestApprovals struct { - Fake *FakeHypershiftV1beta1 + Fake *FakeCertificatesV1alpha1 ns string } -var certificatesigningrequestapprovalsResource = v1beta1.SchemeGroupVersion.WithResource("certificatesigningrequestapprovals") +var certificatesigningrequestapprovalsResource = v1alpha1.SchemeGroupVersion.WithResource("certificatesigningrequestapprovals") -var certificatesigningrequestapprovalsKind = v1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequestApproval") +var certificatesigningrequestapprovalsKind = v1alpha1.SchemeGroupVersion.WithKind("CertificateSigningRequestApproval") // Get takes name of the certificateSigningRequestApproval, and returns the corresponding certificateSigningRequestApproval object, and an error if there is any. -func (c *FakeCertificateSigningRequestApprovals) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { +func (c *FakeCertificateSigningRequestApprovals) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CertificateSigningRequestApproval, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(certificatesigningrequestapprovalsResource, c.ns, name), &v1beta1.CertificateSigningRequestApproval{}) + Invokes(testing.NewGetAction(certificatesigningrequestapprovalsResource, c.ns, name), &v1alpha1.CertificateSigningRequestApproval{}) if obj == nil { return nil, err } - return obj.(*v1beta1.CertificateSigningRequestApproval), err + return obj.(*v1alpha1.CertificateSigningRequestApproval), err } // List takes label and field selectors, and returns the list of CertificateSigningRequestApprovals that match those selectors. -func (c *FakeCertificateSigningRequestApprovals) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestApprovalList, err error) { +func (c *FakeCertificateSigningRequestApprovals) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CertificateSigningRequestApprovalList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(certificatesigningrequestapprovalsResource, certificatesigningrequestapprovalsKind, c.ns, opts), &v1beta1.CertificateSigningRequestApprovalList{}) + Invokes(testing.NewListAction(certificatesigningrequestapprovalsResource, certificatesigningrequestapprovalsKind, c.ns, opts), &v1alpha1.CertificateSigningRequestApprovalList{}) if obj == nil { return nil, err @@ -65,8 +65,8 @@ func (c *FakeCertificateSigningRequestApprovals) List(ctx context.Context, opts if label == nil { label = labels.Everything() } - list := &v1beta1.CertificateSigningRequestApprovalList{ListMeta: obj.(*v1beta1.CertificateSigningRequestApprovalList).ListMeta} - for _, item := range obj.(*v1beta1.CertificateSigningRequestApprovalList).Items { + list := &v1alpha1.CertificateSigningRequestApprovalList{ListMeta: obj.(*v1alpha1.CertificateSigningRequestApprovalList).ListMeta} + for _, item := range obj.(*v1alpha1.CertificateSigningRequestApprovalList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -82,43 +82,43 @@ func (c *FakeCertificateSigningRequestApprovals) Watch(ctx context.Context, opts } // Create takes the representation of a certificateSigningRequestApproval and creates it. Returns the server's representation of the certificateSigningRequestApproval, and an error, if there is any. -func (c *FakeCertificateSigningRequestApprovals) Create(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.CreateOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { +func (c *FakeCertificateSigningRequestApprovals) Create(ctx context.Context, certificateSigningRequestApproval *v1alpha1.CertificateSigningRequestApproval, opts v1.CreateOptions) (result *v1alpha1.CertificateSigningRequestApproval, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(certificatesigningrequestapprovalsResource, c.ns, certificateSigningRequestApproval), &v1beta1.CertificateSigningRequestApproval{}) + Invokes(testing.NewCreateAction(certificatesigningrequestapprovalsResource, c.ns, certificateSigningRequestApproval), &v1alpha1.CertificateSigningRequestApproval{}) if obj == nil { return nil, err } - return obj.(*v1beta1.CertificateSigningRequestApproval), err + return obj.(*v1alpha1.CertificateSigningRequestApproval), err } // Update takes the representation of a certificateSigningRequestApproval and updates it. Returns the server's representation of the certificateSigningRequestApproval, and an error, if there is any. -func (c *FakeCertificateSigningRequestApprovals) Update(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { +func (c *FakeCertificateSigningRequestApprovals) Update(ctx context.Context, certificateSigningRequestApproval *v1alpha1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (result *v1alpha1.CertificateSigningRequestApproval, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(certificatesigningrequestapprovalsResource, c.ns, certificateSigningRequestApproval), &v1beta1.CertificateSigningRequestApproval{}) + Invokes(testing.NewUpdateAction(certificatesigningrequestapprovalsResource, c.ns, certificateSigningRequestApproval), &v1alpha1.CertificateSigningRequestApproval{}) if obj == nil { return nil, err } - return obj.(*v1beta1.CertificateSigningRequestApproval), err + return obj.(*v1alpha1.CertificateSigningRequestApproval), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeCertificateSigningRequestApprovals) UpdateStatus(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequestApproval, error) { +func (c *FakeCertificateSigningRequestApprovals) UpdateStatus(ctx context.Context, certificateSigningRequestApproval *v1alpha1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (*v1alpha1.CertificateSigningRequestApproval, error) { obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(certificatesigningrequestapprovalsResource, "status", c.ns, certificateSigningRequestApproval), &v1beta1.CertificateSigningRequestApproval{}) + Invokes(testing.NewUpdateSubresourceAction(certificatesigningrequestapprovalsResource, "status", c.ns, certificateSigningRequestApproval), &v1alpha1.CertificateSigningRequestApproval{}) if obj == nil { return nil, err } - return obj.(*v1beta1.CertificateSigningRequestApproval), err + return obj.(*v1alpha1.CertificateSigningRequestApproval), err } // Delete takes name of the certificateSigningRequestApproval and deletes it. Returns an error if one occurs. func (c *FakeCertificateSigningRequestApprovals) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(certificatesigningrequestapprovalsResource, c.ns, name, opts), &v1beta1.CertificateSigningRequestApproval{}) + Invokes(testing.NewDeleteActionWithOptions(certificatesigningrequestapprovalsResource, c.ns, name, opts), &v1alpha1.CertificateSigningRequestApproval{}) return err } @@ -127,23 +127,23 @@ func (c *FakeCertificateSigningRequestApprovals) Delete(ctx context.Context, nam func (c *FakeCertificateSigningRequestApprovals) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionAction(certificatesigningrequestapprovalsResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &v1beta1.CertificateSigningRequestApprovalList{}) + _, err := c.Fake.Invokes(action, &v1alpha1.CertificateSigningRequestApprovalList{}) return err } // Patch applies the patch and returns the patched certificateSigningRequestApproval. -func (c *FakeCertificateSigningRequestApprovals) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequestApproval, err error) { +func (c *FakeCertificateSigningRequestApprovals) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CertificateSigningRequestApproval, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(certificatesigningrequestapprovalsResource, c.ns, name, pt, data, subresources...), &v1beta1.CertificateSigningRequestApproval{}) + Invokes(testing.NewPatchSubresourceAction(certificatesigningrequestapprovalsResource, c.ns, name, pt, data, subresources...), &v1alpha1.CertificateSigningRequestApproval{}) if obj == nil { return nil, err } - return obj.(*v1beta1.CertificateSigningRequestApproval), err + return obj.(*v1alpha1.CertificateSigningRequestApproval), err } // Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequestApproval. -func (c *FakeCertificateSigningRequestApprovals) Apply(ctx context.Context, certificateSigningRequestApproval *hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { +func (c *FakeCertificateSigningRequestApprovals) Apply(ctx context.Context, certificateSigningRequestApproval *certificatesv1alpha1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.CertificateSigningRequestApproval, err error) { if certificateSigningRequestApproval == nil { return nil, fmt.Errorf("certificateSigningRequestApproval provided to Apply must not be nil") } @@ -156,17 +156,17 @@ func (c *FakeCertificateSigningRequestApprovals) Apply(ctx context.Context, cert return nil, fmt.Errorf("certificateSigningRequestApproval.Name must be provided to Apply") } obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(certificatesigningrequestapprovalsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.CertificateSigningRequestApproval{}) + Invokes(testing.NewPatchSubresourceAction(certificatesigningrequestapprovalsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.CertificateSigningRequestApproval{}) if obj == nil { return nil, err } - return obj.(*v1beta1.CertificateSigningRequestApproval), err + return obj.(*v1alpha1.CertificateSigningRequestApproval), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeCertificateSigningRequestApprovals) ApplyStatus(ctx context.Context, certificateSigningRequestApproval *hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { +func (c *FakeCertificateSigningRequestApprovals) ApplyStatus(ctx context.Context, certificateSigningRequestApproval *certificatesv1alpha1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.CertificateSigningRequestApproval, err error) { if certificateSigningRequestApproval == nil { return nil, fmt.Errorf("certificateSigningRequestApproval provided to Apply must not be nil") } @@ -179,10 +179,10 @@ func (c *FakeCertificateSigningRequestApprovals) ApplyStatus(ctx context.Context return nil, fmt.Errorf("certificateSigningRequestApproval.Name must be provided to Apply") } obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(certificatesigningrequestapprovalsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.CertificateSigningRequestApproval{}) + Invokes(testing.NewPatchSubresourceAction(certificatesigningrequestapprovalsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.CertificateSigningRequestApproval{}) if obj == nil { return nil, err } - return obj.(*v1beta1.CertificateSigningRequestApproval), err + return obj.(*v1alpha1.CertificateSigningRequestApproval), err } diff --git a/client/clientset/clientset/typed/certificates/v1alpha1/generated_expansion.go b/client/clientset/clientset/typed/certificates/v1alpha1/generated_expansion.go new file mode 100644 index 0000000000..8663cffba9 --- /dev/null +++ b/client/clientset/clientset/typed/certificates/v1alpha1/generated_expansion.go @@ -0,0 +1,20 @@ +/* + + +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 client-gen. DO NOT EDIT. + +package v1alpha1 + +type CertificateSigningRequestApprovalExpansion interface{} diff --git a/client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_hypershift_client.go b/client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_hypershift_client.go index c5d32a5901..6d0b9d23a2 100644 --- a/client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_hypershift_client.go +++ b/client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_hypershift_client.go @@ -27,10 +27,6 @@ type FakeHypershiftV1beta1 struct { *testing.Fake } -func (c *FakeHypershiftV1beta1) CertificateSigningRequestApprovals(namespace string) v1beta1.CertificateSigningRequestApprovalInterface { - return &FakeCertificateSigningRequestApprovals{c, namespace} -} - func (c *FakeHypershiftV1beta1) HostedClusters(namespace string) v1beta1.HostedClusterInterface { return &FakeHostedClusters{c, namespace} } diff --git a/client/clientset/clientset/typed/hypershift/v1beta1/generated_expansion.go b/client/clientset/clientset/typed/hypershift/v1beta1/generated_expansion.go index 33cbdad7ac..29c529638c 100644 --- a/client/clientset/clientset/typed/hypershift/v1beta1/generated_expansion.go +++ b/client/clientset/clientset/typed/hypershift/v1beta1/generated_expansion.go @@ -17,8 +17,6 @@ limitations under the License. package v1beta1 -type CertificateSigningRequestApprovalExpansion interface{} - type HostedClusterExpansion interface{} type HostedControlPlaneExpansion interface{} diff --git a/client/clientset/clientset/typed/hypershift/v1beta1/hypershift_client.go b/client/clientset/clientset/typed/hypershift/v1beta1/hypershift_client.go index 7ce2da0f94..dfcdaf022e 100644 --- a/client/clientset/clientset/typed/hypershift/v1beta1/hypershift_client.go +++ b/client/clientset/clientset/typed/hypershift/v1beta1/hypershift_client.go @@ -27,7 +27,6 @@ import ( type HypershiftV1beta1Interface interface { RESTClient() rest.Interface - CertificateSigningRequestApprovalsGetter HostedClustersGetter HostedControlPlanesGetter NodePoolsGetter @@ -38,10 +37,6 @@ type HypershiftV1beta1Client struct { restClient rest.Interface } -func (c *HypershiftV1beta1Client) CertificateSigningRequestApprovals(namespace string) CertificateSigningRequestApprovalInterface { - return newCertificateSigningRequestApprovals(c, namespace) -} - func (c *HypershiftV1beta1Client) HostedClusters(namespace string) HostedClusterInterface { return newHostedClusters(c, namespace) } diff --git a/client/informers/externalversions/certificates/interface.go b/client/informers/externalversions/certificates/interface.go new file mode 100644 index 0000000000..d7cb923ba1 --- /dev/null +++ b/client/informers/externalversions/certificates/interface.go @@ -0,0 +1,45 @@ +/* + + +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 certificates + +import ( + v1alpha1 "github.com/openshift/hypershift/client/informers/externalversions/certificates/v1alpha1" + internalinterfaces "github.com/openshift/hypershift/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/client/informers/externalversions/hypershift/v1beta1/certificatesigningrequestapproval.go b/client/informers/externalversions/certificates/v1alpha1/certificatesigningrequestapproval.go similarity index 79% rename from client/informers/externalversions/hypershift/v1beta1/certificatesigningrequestapproval.go rename to client/informers/externalversions/certificates/v1alpha1/certificatesigningrequestapproval.go index bd82a48460..98eda861a8 100644 --- a/client/informers/externalversions/hypershift/v1beta1/certificatesigningrequestapproval.go +++ b/client/informers/externalversions/certificates/v1alpha1/certificatesigningrequestapproval.go @@ -15,16 +15,16 @@ limitations under the License. */ // Code generated by informer-gen. DO NOT EDIT. -package v1beta1 +package v1alpha1 import ( "context" time "time" - hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" + certificatesv1alpha1 "github.com/openshift/hypershift/api/certificates/v1alpha1" clientset "github.com/openshift/hypershift/client/clientset/clientset" internalinterfaces "github.com/openshift/hypershift/client/informers/externalversions/internalinterfaces" - v1beta1 "github.com/openshift/hypershift/client/listers/hypershift/v1beta1" + v1alpha1 "github.com/openshift/hypershift/client/listers/certificates/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -35,7 +35,7 @@ import ( // CertificateSigningRequestApprovals. type CertificateSigningRequestApprovalInformer interface { Informer() cache.SharedIndexInformer - Lister() v1beta1.CertificateSigningRequestApprovalLister + Lister() v1alpha1.CertificateSigningRequestApprovalLister } type certificateSigningRequestApprovalInformer struct { @@ -61,16 +61,16 @@ func NewFilteredCertificateSigningRequestApprovalInformer(client clientset.Inter if tweakListOptions != nil { tweakListOptions(&options) } - return client.HypershiftV1beta1().CertificateSigningRequestApprovals(namespace).List(context.TODO(), options) + return client.CertificatesV1alpha1().CertificateSigningRequestApprovals(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.HypershiftV1beta1().CertificateSigningRequestApprovals(namespace).Watch(context.TODO(), options) + return client.CertificatesV1alpha1().CertificateSigningRequestApprovals(namespace).Watch(context.TODO(), options) }, }, - &hypershiftv1beta1.CertificateSigningRequestApproval{}, + &certificatesv1alpha1.CertificateSigningRequestApproval{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *certificateSigningRequestApprovalInformer) defaultInformer(client clien } func (f *certificateSigningRequestApprovalInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&hypershiftv1beta1.CertificateSigningRequestApproval{}, f.defaultInformer) + return f.factory.InformerFor(&certificatesv1alpha1.CertificateSigningRequestApproval{}, f.defaultInformer) } -func (f *certificateSigningRequestApprovalInformer) Lister() v1beta1.CertificateSigningRequestApprovalLister { - return v1beta1.NewCertificateSigningRequestApprovalLister(f.Informer().GetIndexer()) +func (f *certificateSigningRequestApprovalInformer) Lister() v1alpha1.CertificateSigningRequestApprovalLister { + return v1alpha1.NewCertificateSigningRequestApprovalLister(f.Informer().GetIndexer()) } diff --git a/client/informers/externalversions/certificates/v1alpha1/interface.go b/client/informers/externalversions/certificates/v1alpha1/interface.go new file mode 100644 index 0000000000..7fa31901aa --- /dev/null +++ b/client/informers/externalversions/certificates/v1alpha1/interface.go @@ -0,0 +1,44 @@ +/* + + +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 v1alpha1 + +import ( + internalinterfaces "github.com/openshift/hypershift/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // CertificateSigningRequestApprovals returns a CertificateSigningRequestApprovalInformer. + CertificateSigningRequestApprovals() CertificateSigningRequestApprovalInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// CertificateSigningRequestApprovals returns a CertificateSigningRequestApprovalInformer. +func (v *version) CertificateSigningRequestApprovals() CertificateSigningRequestApprovalInformer { + return &certificateSigningRequestApprovalInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/client/informers/externalversions/factory.go b/client/informers/externalversions/factory.go index 65084231e8..a7d28229b8 100644 --- a/client/informers/externalversions/factory.go +++ b/client/informers/externalversions/factory.go @@ -23,6 +23,7 @@ import ( time "time" clientset "github.com/openshift/hypershift/client/clientset/clientset" + certificates "github.com/openshift/hypershift/client/informers/externalversions/certificates" hypershift "github.com/openshift/hypershift/client/informers/externalversions/hypershift" internalinterfaces "github.com/openshift/hypershift/client/informers/externalversions/internalinterfaces" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -252,9 +253,14 @@ type SharedInformerFactory interface { // client. InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + Certificates() certificates.Interface Hypershift() hypershift.Interface } +func (f *sharedInformerFactory) Certificates() certificates.Interface { + return certificates.New(f, f.namespace, f.tweakListOptions) +} + func (f *sharedInformerFactory) Hypershift() hypershift.Interface { return hypershift.New(f, f.namespace, f.tweakListOptions) } diff --git a/client/informers/externalversions/generic.go b/client/informers/externalversions/generic.go index aaf0206b30..4aac6fa7e6 100644 --- a/client/informers/externalversions/generic.go +++ b/client/informers/externalversions/generic.go @@ -20,7 +20,8 @@ package externalversions import ( "fmt" - v1alpha1 "github.com/openshift/hypershift/api/hypershift/v1alpha1" + v1alpha1 "github.com/openshift/hypershift/api/certificates/v1alpha1" + hypershiftv1alpha1 "github.com/openshift/hypershift/api/hypershift/v1alpha1" v1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" @@ -52,15 +53,17 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=hypershift.openshift.io, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithResource("hostedclusters"): + // Group=certificates.hypershift.openshift.io, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithResource("certificatesigningrequestapprovals"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Certificates().V1alpha1().CertificateSigningRequestApprovals().Informer()}, nil + + // Group=hypershift.openshift.io, Version=v1alpha1 + case hypershiftv1alpha1.SchemeGroupVersion.WithResource("hostedclusters"): return &genericInformer{resource: resource.GroupResource(), informer: f.Hypershift().V1alpha1().HostedClusters().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("nodepools"): + case hypershiftv1alpha1.SchemeGroupVersion.WithResource("nodepools"): return &genericInformer{resource: resource.GroupResource(), informer: f.Hypershift().V1alpha1().NodePools().Informer()}, nil // Group=hypershift.openshift.io, Version=v1beta1 - case v1beta1.SchemeGroupVersion.WithResource("certificatesigningrequestapprovals"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Hypershift().V1beta1().CertificateSigningRequestApprovals().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("hostedclusters"): return &genericInformer{resource: resource.GroupResource(), informer: f.Hypershift().V1beta1().HostedClusters().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("hostedcontrolplanes"): diff --git a/client/informers/externalversions/hypershift/v1beta1/interface.go b/client/informers/externalversions/hypershift/v1beta1/interface.go index 9178b91e24..098e82000f 100644 --- a/client/informers/externalversions/hypershift/v1beta1/interface.go +++ b/client/informers/externalversions/hypershift/v1beta1/interface.go @@ -23,8 +23,6 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { - // CertificateSigningRequestApprovals returns a CertificateSigningRequestApprovalInformer. - CertificateSigningRequestApprovals() CertificateSigningRequestApprovalInformer // HostedClusters returns a HostedClusterInformer. HostedClusters() HostedClusterInformer // HostedControlPlanes returns a HostedControlPlaneInformer. @@ -44,11 +42,6 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// CertificateSigningRequestApprovals returns a CertificateSigningRequestApprovalInformer. -func (v *version) CertificateSigningRequestApprovals() CertificateSigningRequestApprovalInformer { - return &certificateSigningRequestApprovalInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // HostedClusters returns a HostedClusterInformer. func (v *version) HostedClusters() HostedClusterInformer { return &hostedClusterInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/client/listers/hypershift/v1beta1/certificatesigningrequestapproval.go b/client/listers/certificates/v1alpha1/certificatesigningrequestapproval.go similarity index 81% rename from client/listers/hypershift/v1beta1/certificatesigningrequestapproval.go rename to client/listers/certificates/v1alpha1/certificatesigningrequestapproval.go index 2a1ca77486..97f0325de1 100644 --- a/client/listers/hypershift/v1beta1/certificatesigningrequestapproval.go +++ b/client/listers/certificates/v1alpha1/certificatesigningrequestapproval.go @@ -15,10 +15,10 @@ limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. -package v1beta1 +package v1alpha1 import ( - v1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" + v1alpha1 "github.com/openshift/hypershift/api/certificates/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -29,7 +29,7 @@ import ( type CertificateSigningRequestApprovalLister interface { // List lists all CertificateSigningRequestApprovals in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.CertificateSigningRequestApproval, err error) + List(selector labels.Selector) (ret []*v1alpha1.CertificateSigningRequestApproval, err error) // CertificateSigningRequestApprovals returns an object that can list and get CertificateSigningRequestApprovals. CertificateSigningRequestApprovals(namespace string) CertificateSigningRequestApprovalNamespaceLister CertificateSigningRequestApprovalListerExpansion @@ -46,9 +46,9 @@ func NewCertificateSigningRequestApprovalLister(indexer cache.Indexer) Certifica } // List lists all CertificateSigningRequestApprovals in the indexer. -func (s *certificateSigningRequestApprovalLister) List(selector labels.Selector) (ret []*v1beta1.CertificateSigningRequestApproval, err error) { +func (s *certificateSigningRequestApprovalLister) List(selector labels.Selector) (ret []*v1alpha1.CertificateSigningRequestApproval, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.CertificateSigningRequestApproval)) + ret = append(ret, m.(*v1alpha1.CertificateSigningRequestApproval)) }) return ret, err } @@ -63,10 +63,10 @@ func (s *certificateSigningRequestApprovalLister) CertificateSigningRequestAppro type CertificateSigningRequestApprovalNamespaceLister interface { // List lists all CertificateSigningRequestApprovals in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.CertificateSigningRequestApproval, err error) + List(selector labels.Selector) (ret []*v1alpha1.CertificateSigningRequestApproval, err error) // Get retrieves the CertificateSigningRequestApproval from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1beta1.CertificateSigningRequestApproval, error) + Get(name string) (*v1alpha1.CertificateSigningRequestApproval, error) CertificateSigningRequestApprovalNamespaceListerExpansion } @@ -78,21 +78,21 @@ type certificateSigningRequestApprovalNamespaceLister struct { } // List lists all CertificateSigningRequestApprovals in the indexer for a given namespace. -func (s certificateSigningRequestApprovalNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.CertificateSigningRequestApproval, err error) { +func (s certificateSigningRequestApprovalNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.CertificateSigningRequestApproval, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.CertificateSigningRequestApproval)) + ret = append(ret, m.(*v1alpha1.CertificateSigningRequestApproval)) }) return ret, err } // Get retrieves the CertificateSigningRequestApproval from the indexer for a given namespace and name. -func (s certificateSigningRequestApprovalNamespaceLister) Get(name string) (*v1beta1.CertificateSigningRequestApproval, error) { +func (s certificateSigningRequestApprovalNamespaceLister) Get(name string) (*v1alpha1.CertificateSigningRequestApproval, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("certificatesigningrequestapproval"), name) + return nil, errors.NewNotFound(v1alpha1.Resource("certificatesigningrequestapproval"), name) } - return obj.(*v1beta1.CertificateSigningRequestApproval), nil + return obj.(*v1alpha1.CertificateSigningRequestApproval), nil } diff --git a/client/listers/certificates/v1alpha1/expansion_generated.go b/client/listers/certificates/v1alpha1/expansion_generated.go new file mode 100644 index 0000000000..166a1da0f7 --- /dev/null +++ b/client/listers/certificates/v1alpha1/expansion_generated.go @@ -0,0 +1,26 @@ +/* + + +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 lister-gen. DO NOT EDIT. + +package v1alpha1 + +// CertificateSigningRequestApprovalListerExpansion allows custom methods to be added to +// CertificateSigningRequestApprovalLister. +type CertificateSigningRequestApprovalListerExpansion interface{} + +// CertificateSigningRequestApprovalNamespaceListerExpansion allows custom methods to be added to +// CertificateSigningRequestApprovalNamespaceLister. +type CertificateSigningRequestApprovalNamespaceListerExpansion interface{} diff --git a/client/listers/hypershift/v1beta1/expansion_generated.go b/client/listers/hypershift/v1beta1/expansion_generated.go index 06d27550ca..41f055a9c4 100644 --- a/client/listers/hypershift/v1beta1/expansion_generated.go +++ b/client/listers/hypershift/v1beta1/expansion_generated.go @@ -17,14 +17,6 @@ limitations under the License. package v1beta1 -// CertificateSigningRequestApprovalListerExpansion allows custom methods to be added to -// CertificateSigningRequestApprovalLister. -type CertificateSigningRequestApprovalListerExpansion interface{} - -// CertificateSigningRequestApprovalNamespaceListerExpansion allows custom methods to be added to -// CertificateSigningRequestApprovalNamespaceLister. -type CertificateSigningRequestApprovalNamespaceListerExpansion interface{} - // HostedClusterListerExpansion allows custom methods to be added to // HostedClusterLister. type HostedClusterListerExpansion interface{} diff --git a/cmd/install/assets/hypershift-operator/hypershift.openshift.io_certificatesigningrequestapprovals.yaml b/cmd/install/assets/hypershift-operator/certificates.hypershift.openshift.io_certificatesigningrequestapprovals.yaml similarity index 92% rename from cmd/install/assets/hypershift-operator/hypershift.openshift.io_certificatesigningrequestapprovals.yaml rename to cmd/install/assets/hypershift-operator/certificates.hypershift.openshift.io_certificatesigningrequestapprovals.yaml index 4bd1d3f47d..8bdad748b2 100644 --- a/cmd/install/assets/hypershift-operator/hypershift.openshift.io_certificatesigningrequestapprovals.yaml +++ b/cmd/install/assets/hypershift-operator/certificates.hypershift.openshift.io_certificatesigningrequestapprovals.yaml @@ -4,9 +4,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.13.0 - name: certificatesigningrequestapprovals.hypershift.openshift.io + name: certificatesigningrequestapprovals.certificates.hypershift.openshift.io spec: - group: hypershift.openshift.io + group: certificates.hypershift.openshift.io names: kind: CertificateSigningRequestApproval listKind: CertificateSigningRequestApprovalList @@ -17,7 +17,7 @@ spec: singular: certificatesigningrequestapproval scope: Namespaced versions: - - name: v1beta1 + - name: v1alpha1 schema: openAPIV3Schema: description: CertificateSigningRequestApproval defines the desired state of diff --git a/cmd/install/assets/hypershift_operator.go b/cmd/install/assets/hypershift_operator.go index 8a1194043d..a685fc1b27 100644 --- a/cmd/install/assets/hypershift_operator.go +++ b/cmd/install/assets/hypershift_operator.go @@ -870,6 +870,11 @@ func (o HyperShiftOperatorClusterRole) Build() *rbacv1.ClusterRole { Resources: []string{rbacv1.ResourceAll}, Verbs: []string{rbacv1.VerbAll}, }, + { + APIGroups: []string{"certificates.hypershift.openshift.io"}, + Resources: []string{rbacv1.ResourceAll}, + Verbs: []string{rbacv1.VerbAll}, + }, { APIGroups: []string{"config.openshift.io"}, Resources: []string{rbacv1.ResourceAll}, diff --git a/control-plane-operator/controllers/hostedcontrolplane/pkioperator/reconcile.go b/control-plane-operator/controllers/hostedcontrolplane/pkioperator/reconcile.go index 52d89b90c7..3c5eecb815 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/pkioperator/reconcile.go +++ b/control-plane-operator/controllers/hostedcontrolplane/pkioperator/reconcile.go @@ -161,7 +161,7 @@ func ReconcileRole(role *rbacv1.Role, ownerRef config.OwnerRef) error { Verbs: []string{"get", "list", "watch", "create", "delete", "update", "patch"}, }, { // to approve certificate signing requests - APIGroups: []string{"hypershift.openshift.io"}, + APIGroups: []string{"certificates.hypershift.openshift.io"}, Resources: []string{"certificatesigningrequestapprovals"}, Verbs: []string{"get", "list", "watch"}, }, diff --git a/control-plane-operator/controllers/hostedcontrolplane/pkioperator/testdata/zz_fixture_TestReconcileControlPlanePKIOperatorRole.yaml b/control-plane-operator/controllers/hostedcontrolplane/pkioperator/testdata/zz_fixture_TestReconcileControlPlanePKIOperatorRole.yaml index 7a4130653b..d79ba17dd8 100644 --- a/control-plane-operator/controllers/hostedcontrolplane/pkioperator/testdata/zz_fixture_TestReconcileControlPlanePKIOperatorRole.yaml +++ b/control-plane-operator/controllers/hostedcontrolplane/pkioperator/testdata/zz_fixture_TestReconcileControlPlanePKIOperatorRole.yaml @@ -63,7 +63,7 @@ rules: - update - patch - apiGroups: - - hypershift.openshift.io + - certificates.hypershift.openshift.io resources: - certificatesigningrequestapprovals verbs: diff --git a/control-plane-pki-operator/certificatesigningrequestapprovalcontroller/certificatesigningrequestapprovalcontroller.go b/control-plane-pki-operator/certificatesigningrequestapprovalcontroller/certificatesigningrequestapprovalcontroller.go index 848d12865c..fde7a5f45b 100644 --- a/control-plane-pki-operator/certificatesigningrequestapprovalcontroller/certificatesigningrequestapprovalcontroller.go +++ b/control-plane-pki-operator/certificatesigningrequestapprovalcontroller/certificatesigningrequestapprovalcontroller.go @@ -4,6 +4,7 @@ import ( "context" "time" + certificatesv1alpha1 "github.com/openshift/hypershift/api/certificates/v1alpha1" hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" hypershiftinformers "github.com/openshift/hypershift/client/informers/externalversions" "github.com/openshift/hypershift/control-plane-pki-operator/certificates" @@ -25,7 +26,7 @@ type CertificateSigningRequestApprovalController struct { namespace, signerName string getCSR func(name string) (*certificatesv1.CertificateSigningRequest, error) - getCSRA func(namespace, name string) (*hypershiftv1beta1.CertificateSigningRequestApproval, error) + getCSRA func(namespace, name string) (*certificatesv1alpha1.CertificateSigningRequestApproval, error) } func NewCertificateSigningRequestApprovalController( @@ -43,12 +44,12 @@ func NewCertificateSigningRequestApprovalController( getCSR: func(name string) (*certificatesv1.CertificateSigningRequest, error) { return kubeInformersForNamespaces.InformersFor(corev1.NamespaceAll).Certificates().V1().CertificateSigningRequests().Lister().Get(name) }, - getCSRA: func(namespace, name string) (*hypershiftv1beta1.CertificateSigningRequestApproval, error) { - return hypershiftInformers.Hypershift().V1beta1().CertificateSigningRequestApprovals().Lister().CertificateSigningRequestApprovals(namespace).Get(name) + getCSRA: func(namespace, name string) (*certificatesv1alpha1.CertificateSigningRequestApproval, error) { + return hypershiftInformers.Certificates().V1alpha1().CertificateSigningRequestApprovals().Lister().CertificateSigningRequestApprovals(namespace).Get(name) }, } csrInformer := kubeInformersForNamespaces.InformersFor(corev1.NamespaceAll).Certificates().V1().CertificateSigningRequests().Informer() - csraInformer := hypershiftInformers.Hypershift().V1beta1().CertificateSigningRequestApprovals().Informer() + csraInformer := hypershiftInformers.Certificates().V1alpha1().CertificateSigningRequestApprovals().Informer() return factory.New(). WithInformersQueueKeysFunc(enqueueCertificateSigningRequest, csrInformer). diff --git a/control-plane-pki-operator/certificatesigningrequestapprovalcontroller/certificatesigningrequestapprovalcontroller_test.go b/control-plane-pki-operator/certificatesigningrequestapprovalcontroller/certificatesigningrequestapprovalcontroller_test.go index 87d16e1bbf..87083ee9b6 100644 --- a/control-plane-pki-operator/certificatesigningrequestapprovalcontroller/certificatesigningrequestapprovalcontroller_test.go +++ b/control-plane-pki-operator/certificatesigningrequestapprovalcontroller/certificatesigningrequestapprovalcontroller_test.go @@ -6,6 +6,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + certificatesv1alpha1 "github.com/openshift/hypershift/api/certificates/v1alpha1" certificatesv1 "k8s.io/api/certificates/v1" corev1 "k8s.io/api/core/v1" @@ -22,7 +23,7 @@ func TestCertificateSigningRequestApprovalController_processCertificateSigningRe name string signerName string getCSR func(name string) (*certificatesv1.CertificateSigningRequest, error) - getCSRA func(namespace, name string) (*hypershiftv1beta1.CertificateSigningRequestApproval, error) + getCSRA func(namespace, name string) (*certificatesv1alpha1.CertificateSigningRequestApproval, error) expectedCSR *certificatesv1.CertificateSigningRequest expectedErr bool }{ @@ -34,7 +35,7 @@ func TestCertificateSigningRequestApprovalController_processCertificateSigningRe getCSR: func(name string) (*certificatesv1.CertificateSigningRequest, error) { return nil, apierrors.NewNotFound(certificatesv1.SchemeGroupVersion.WithResource("certificatesigningrequests").GroupResource(), name) }, - getCSRA: func(namespace, name string) (*hypershiftv1beta1.CertificateSigningRequestApproval, error) { + getCSRA: func(namespace, name string) (*certificatesv1alpha1.CertificateSigningRequestApproval, error) { return nil, apierrors.NewNotFound(hypershiftv1beta1.SchemeGroupVersion.WithResource("certificatesigningrequestapprovals").GroupResource(), name) }, expectedErr: false, // nothing to be done @@ -57,11 +58,11 @@ func TestCertificateSigningRequestApprovalController_processCertificateSigningRe }, }, nil }, - getCSRA: func(namespace, name string) (*hypershiftv1beta1.CertificateSigningRequestApproval, error) { + getCSRA: func(namespace, name string) (*certificatesv1alpha1.CertificateSigningRequestApproval, error) { if namespace != "test-ns" || name != "test-csr" { return nil, apierrors.NewNotFound(hypershiftv1beta1.SchemeGroupVersion.WithResource("certificatesigningrequestapprovals").GroupResource(), name) } - return &hypershiftv1beta1.CertificateSigningRequestApproval{ + return &certificatesv1alpha1.CertificateSigningRequestApproval{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, @@ -91,11 +92,11 @@ func TestCertificateSigningRequestApprovalController_processCertificateSigningRe }, }, nil }, - getCSRA: func(namespace, name string) (*hypershiftv1beta1.CertificateSigningRequestApproval, error) { + getCSRA: func(namespace, name string) (*certificatesv1alpha1.CertificateSigningRequestApproval, error) { if namespace != "test-ns" || name != "test-csr" { return nil, apierrors.NewNotFound(hypershiftv1beta1.SchemeGroupVersion.WithResource("certificatesigningrequestapprovals").GroupResource(), name) } - return &hypershiftv1beta1.CertificateSigningRequestApproval{ + return &certificatesv1alpha1.CertificateSigningRequestApproval{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, @@ -125,11 +126,11 @@ func TestCertificateSigningRequestApprovalController_processCertificateSigningRe }, }, nil }, - getCSRA: func(namespace, name string) (*hypershiftv1beta1.CertificateSigningRequestApproval, error) { + getCSRA: func(namespace, name string) (*certificatesv1alpha1.CertificateSigningRequestApproval, error) { if namespace != "test-ns" || name != "test-csr" { return nil, apierrors.NewNotFound(hypershiftv1beta1.SchemeGroupVersion.WithResource("certificatesigningrequestapprovals").GroupResource(), name) } - return &hypershiftv1beta1.CertificateSigningRequestApproval{ + return &certificatesv1alpha1.CertificateSigningRequestApproval{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, @@ -154,7 +155,7 @@ func TestCertificateSigningRequestApprovalController_processCertificateSigningRe }, }, nil }, - getCSRA: func(namespace, name string) (*hypershiftv1beta1.CertificateSigningRequestApproval, error) { + getCSRA: func(namespace, name string) (*certificatesv1alpha1.CertificateSigningRequestApproval, error) { return nil, apierrors.NewNotFound(hypershiftv1beta1.SchemeGroupVersion.WithResource("certificatesigningrequestapprovals").GroupResource(), name) }, }, @@ -176,7 +177,7 @@ func TestCertificateSigningRequestApprovalController_processCertificateSigningRe }, }, nil }, - getCSRA: func(namespace, name string) (*hypershiftv1beta1.CertificateSigningRequestApproval, error) { + getCSRA: func(namespace, name string) (*certificatesv1alpha1.CertificateSigningRequestApproval, error) { return nil, apierrors.NewForbidden(hypershiftv1beta1.SchemeGroupVersion.WithResource("certificatesigningrequestapprovals").GroupResource(), name, errors.New("oops")) }, expectedErr: true, @@ -199,11 +200,11 @@ func TestCertificateSigningRequestApprovalController_processCertificateSigningRe }, }, nil }, - getCSRA: func(namespace, name string) (*hypershiftv1beta1.CertificateSigningRequestApproval, error) { + getCSRA: func(namespace, name string) (*certificatesv1alpha1.CertificateSigningRequestApproval, error) { if namespace != "test-ns" || name != "test-csr" { return nil, apierrors.NewNotFound(hypershiftv1beta1.SchemeGroupVersion.WithResource("certificatesigningrequestapprovals").GroupResource(), name) } - return &hypershiftv1beta1.CertificateSigningRequestApproval{ + return &certificatesv1alpha1.CertificateSigningRequestApproval{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, diff --git a/docs/content/reference/api.md b/docs/content/reference/api.md index 80459e2a63..362d689b74 100644 --- a/docs/content/reference/api.md +++ b/docs/content/reference/api.md @@ -21,79 +21,6 @@ OpenShift clusters at scale.

worker nodes and their kubelets, and the infrastructure on which they run). This enables “hosted control plane as a service” use cases.

-##CertificateSigningRequestApproval { #hypershift.openshift.io/v1beta1.CertificateSigningRequestApproval } -

-

CertificateSigningRequestApproval defines the desired state of CertificateSigningRequestApproval

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
-apiVersion
-string
- -hypershift.openshift.io/v1beta1 - -
-kind
-string -
CertificateSigningRequestApproval
-metadata
- - -Kubernetes meta/v1.ObjectMeta - - -
-Refer to the Kubernetes API documentation for the fields of the -metadata field. -
-spec
- - -CertificateSigningRequestApprovalSpec - - -
-
-
- -
-
-status
- - -CertificateSigningRequestApprovalStatus - - -
-
##HostedCluster { #hypershift.openshift.io/v1beta1.HostedCluster }

HostedCluster is the primary representation of a HyperShift cluster and encapsulates @@ -2467,22 +2394,6 @@ string

-###CertificateSigningRequestApprovalSpec { #hypershift.openshift.io/v1beta1.CertificateSigningRequestApprovalSpec } -

-(Appears on: -CertificateSigningRequestApproval) -

-

-

CertificateSigningRequestApprovalSpec defines the desired state of CertificateSigningRequestApproval

-

-###CertificateSigningRequestApprovalStatus { #hypershift.openshift.io/v1beta1.CertificateSigningRequestApprovalStatus } -

-(Appears on: -CertificateSigningRequestApproval) -

-

-

CertificateSigningRequestApprovalStatus defines the observed state of CertificateSigningRequestApproval

-

###ClusterAutoscaling { #hypershift.openshift.io/v1beta1.ClusterAutoscaling }

(Appears on: diff --git a/hack/app-sre/saas_template.yaml b/hack/app-sre/saas_template.yaml index b6d972fdd5..69841402b2 100644 --- a/hack/app-sre/saas_template.yaml +++ b/hack/app-sre/saas_template.yaml @@ -60,6 +60,12 @@ objects: - '*' verbs: - '*' + - apiGroups: + - certificates.hypershift.openshift.io + resources: + - '*' + verbs: + - '*' - apiGroups: - config.openshift.io resources: @@ -36638,6 +36644,61 @@ objects: plural: "" conditions: null storedVersions: null +- apiVersion: apiextensions.k8s.io/v1 + kind: CustomResourceDefinition + metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + creationTimestamp: null + name: certificatesigningrequestapprovals.certificates.hypershift.openshift.io + spec: + group: certificates.hypershift.openshift.io + names: + kind: CertificateSigningRequestApproval + listKind: CertificateSigningRequestApprovalList + plural: certificatesigningrequestapprovals + shortNames: + - csra + - csras + singular: certificatesigningrequestapproval + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: CertificateSigningRequestApproval defines the desired state + of CertificateSigningRequestApproval + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource + this object represents. Servers may infer this from the endpoint the + client submits requests to. Cannot be updated. In CamelCase. More + info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: CertificateSigningRequestApprovalSpec defines the desired + state of CertificateSigningRequestApproval + type: object + status: + description: CertificateSigningRequestApprovalStatus defines the observed + state of CertificateSigningRequestApproval + type: object + type: object + served: true + storage: true + status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null - apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -37007,73 +37068,6 @@ objects: plural: "" conditions: null storedVersions: null -- apiVersion: apiextensions.k8s.io/v1 - kind: CustomResourceDefinition - metadata: - annotations: - service.beta.openshift.io/inject-cabundle: "true" - creationTimestamp: null - name: certificatesigningrequestapprovals.hypershift.openshift.io - spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - name: operator - namespace: ${NAMESPACE} - path: /convert - port: 443 - conversionReviewVersions: - - v1beta1 - - v1alpha1 - group: hypershift.openshift.io - names: - kind: CertificateSigningRequestApproval - listKind: CertificateSigningRequestApprovalList - plural: certificatesigningrequestapprovals - shortNames: - - csra - - csras - singular: certificatesigningrequestapproval - scope: Namespaced - versions: - - name: v1beta1 - schema: - openAPIV3Schema: - description: CertificateSigningRequestApproval defines the desired state - of CertificateSigningRequestApproval - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource - this object represents. Servers may infer this from the endpoint the - client submits requests to. Cannot be updated. In CamelCase. More - info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: CertificateSigningRequestApprovalSpec defines the desired - state of CertificateSigningRequestApproval - type: object - status: - description: CertificateSigningRequestApprovalStatus defines the observed - state of CertificateSigningRequestApproval - type: object - type: object - served: true - storage: true - status: - acceptedNames: - kind: "" - plural: "" - conditions: null - storedVersions: null - apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go index c41c456a01..88c57eb2cd 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go @@ -2712,6 +2712,11 @@ func reconcileControlPlaneOperatorRole(role *rbacv1.Role, enableCVOManagementClu Resources: []string{"*"}, Verbs: []string{"*"}, }, + { + APIGroups: []string{"certificates.hypershift.openshift.io"}, + Resources: []string{"*"}, + Verbs: []string{"*"}, + }, { APIGroups: []string{ "bootstrap.cluster.x-k8s.io", diff --git a/test/e2e/create_cluster_test.go b/test/e2e/create_cluster_test.go index 24fe28537b..fcbf3a5b86 100644 --- a/test/e2e/create_cluster_test.go +++ b/test/e2e/create_cluster_test.go @@ -12,7 +12,7 @@ import ( . "github.com/onsi/gomega" hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1" - hypershiftv1beta1applyconfigurations "github.com/openshift/hypershift/client/applyconfiguration/hypershift/v1beta1" + certificatesv1alpha1applyconfigurations "github.com/openshift/hypershift/client/applyconfiguration/certificates/v1alpha1" hypershiftclient "github.com/openshift/hypershift/client/clientset/clientset" "github.com/openshift/hypershift/cmd/cluster/core" "github.com/openshift/hypershift/control-plane-pki-operator/certificates" @@ -134,8 +134,8 @@ func TestCreateCluster(t *testing.T) { } t.Logf("creating CSRA %s/%s to trigger automatic approval of the CSR", csrName, csrName) - csraCfg := hypershiftv1beta1applyconfigurations.CertificateSigningRequestApproval(hostedControlPlaneNamespace, csrName) - if _, err := hypershiftClient.HypershiftV1beta1().CertificateSigningRequestApprovals(hostedControlPlaneNamespace).Apply(ctx, csraCfg, metav1.ApplyOptions{FieldManager: "e2e-test"}); err != nil { + csraCfg := certificatesv1alpha1applyconfigurations.CertificateSigningRequestApproval(hostedControlPlaneNamespace, csrName) + if _, err := hypershiftClient.CertificatesV1alpha1().CertificateSigningRequestApprovals(hostedControlPlaneNamespace).Apply(ctx, csraCfg, metav1.ApplyOptions{FieldManager: "e2e-test"}); err != nil { t.Fatalf("failed to create CSRA: %v", err) } From 63537e84cf54fd685076e5ce51d63e12a8561063 Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Wed, 24 Jan 2024 14:33:38 -0700 Subject: [PATCH 2/2] api: re-add the v1beta1 CSRA Signed-off-by: Steve Kuznetsov --- ...certificatesigningrequestapproval_types.go | 34 +++ .../v1beta1/zz_generated.deepcopy.go | 89 ++++++ .../certificatesigningrequestapproval.go | 219 +++++++++++++++ client/applyconfiguration/utils.go | 2 + .../certificatesigningrequestapproval.go | 255 ++++++++++++++++++ .../fake_certificatesigningrequestapproval.go | 188 +++++++++++++ .../v1beta1/fake/fake_hypershift_client.go | 4 + .../hypershift/v1beta1/generated_expansion.go | 2 + .../hypershift/v1beta1/hypershift_client.go | 5 + client/informers/externalversions/generic.go | 2 + .../certificatesigningrequestapproval.go | 89 ++++++ .../hypershift/v1beta1/interface.go | 7 + .../certificatesigningrequestapproval.go | 98 +++++++ .../hypershift/v1beta1/expansion_generated.go | 8 + ...io_certificatesigningrequestapprovals.yaml | 48 ++++ docs/content/reference/api.md | 89 ++++++ hack/app-sre/saas_template.yaml | 67 +++++ 17 files changed, 1206 insertions(+) create mode 100644 api/hypershift/v1beta1/certificatesigningrequestapproval_types.go create mode 100644 client/applyconfiguration/hypershift/v1beta1/certificatesigningrequestapproval.go create mode 100644 client/clientset/clientset/typed/hypershift/v1beta1/certificatesigningrequestapproval.go create mode 100644 client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_certificatesigningrequestapproval.go create mode 100644 client/informers/externalversions/hypershift/v1beta1/certificatesigningrequestapproval.go create mode 100644 client/listers/hypershift/v1beta1/certificatesigningrequestapproval.go create mode 100644 cmd/install/assets/hypershift-operator/hypershift.openshift.io_certificatesigningrequestapprovals.yaml diff --git a/api/hypershift/v1beta1/certificatesigningrequestapproval_types.go b/api/hypershift/v1beta1/certificatesigningrequestapproval_types.go new file mode 100644 index 0000000000..00d7ce48d7 --- /dev/null +++ b/api/hypershift/v1beta1/certificatesigningrequestapproval_types.go @@ -0,0 +1,34 @@ +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +kubebuilder:resource:path=certificatesigningrequestapprovals,shortName=csra;csras,scope=Namespaced +// +kubebuilder:object:root=true +// +kubebuilder:storageversion + +// CertificateSigningRequestApproval defines the desired state of CertificateSigningRequestApproval +type CertificateSigningRequestApproval struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec CertificateSigningRequestApprovalSpec `json:"spec,omitempty"` + Status CertificateSigningRequestApprovalStatus `json:"status,omitempty"` +} + +// CertificateSigningRequestApprovalSpec defines the desired state of CertificateSigningRequestApproval +type CertificateSigningRequestApprovalSpec struct{} + +// CertificateSigningRequestApprovalStatus defines the observed state of CertificateSigningRequestApproval +type CertificateSigningRequestApprovalStatus struct{} + +// +kubebuilder:object:root=true + +// CertificateSigningRequestApprovalList contains a list of CertificateSigningRequestApprovals. +type CertificateSigningRequestApprovalList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []CertificateSigningRequestApproval `json:"items"` +} diff --git a/api/hypershift/v1beta1/zz_generated.deepcopy.go b/api/hypershift/v1beta1/zz_generated.deepcopy.go index 4c531fc17b..32bab9b619 100644 --- a/api/hypershift/v1beta1/zz_generated.deepcopy.go +++ b/api/hypershift/v1beta1/zz_generated.deepcopy.go @@ -533,6 +533,95 @@ func (in *AzurePlatformSpec) DeepCopy() *AzurePlatformSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateSigningRequestApproval) DeepCopyInto(out *CertificateSigningRequestApproval) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestApproval. +func (in *CertificateSigningRequestApproval) DeepCopy() *CertificateSigningRequestApproval { + if in == nil { + return nil + } + out := new(CertificateSigningRequestApproval) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CertificateSigningRequestApproval) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateSigningRequestApprovalList) DeepCopyInto(out *CertificateSigningRequestApprovalList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CertificateSigningRequestApproval, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestApprovalList. +func (in *CertificateSigningRequestApprovalList) DeepCopy() *CertificateSigningRequestApprovalList { + if in == nil { + return nil + } + out := new(CertificateSigningRequestApprovalList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CertificateSigningRequestApprovalList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateSigningRequestApprovalSpec) DeepCopyInto(out *CertificateSigningRequestApprovalSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestApprovalSpec. +func (in *CertificateSigningRequestApprovalSpec) DeepCopy() *CertificateSigningRequestApprovalSpec { + if in == nil { + return nil + } + out := new(CertificateSigningRequestApprovalSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateSigningRequestApprovalStatus) DeepCopyInto(out *CertificateSigningRequestApprovalStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateSigningRequestApprovalStatus. +func (in *CertificateSigningRequestApprovalStatus) DeepCopy() *CertificateSigningRequestApprovalStatus { + if in == nil { + return nil + } + out := new(CertificateSigningRequestApprovalStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterAutoscaling) DeepCopyInto(out *ClusterAutoscaling) { *out = *in diff --git a/client/applyconfiguration/hypershift/v1beta1/certificatesigningrequestapproval.go b/client/applyconfiguration/hypershift/v1beta1/certificatesigningrequestapproval.go new file mode 100644 index 0000000000..5798fbf9ad --- /dev/null +++ b/client/applyconfiguration/hypershift/v1beta1/certificatesigningrequestapproval.go @@ -0,0 +1,219 @@ +/* + + +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 v1beta1 + +import ( + v1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// CertificateSigningRequestApprovalApplyConfiguration represents an declarative configuration of the CertificateSigningRequestApproval type for use +// with apply. +type CertificateSigningRequestApprovalApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *v1beta1.CertificateSigningRequestApprovalSpec `json:"spec,omitempty"` + Status *v1beta1.CertificateSigningRequestApprovalStatus `json:"status,omitempty"` +} + +// CertificateSigningRequestApproval constructs an declarative configuration of the CertificateSigningRequestApproval type for use with +// apply. +func CertificateSigningRequestApproval(name, namespace string) *CertificateSigningRequestApprovalApplyConfiguration { + b := &CertificateSigningRequestApprovalApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("CertificateSigningRequestApproval") + b.WithAPIVersion("hypershift.openshift.io/v1beta1") + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithKind(value string) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithAPIVersion(value string) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithName(value string) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithGenerateName(value string) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithNamespace(value string) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithUID(value types.UID) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithResourceVersion(value string) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithGeneration(value int64) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithLabels(entries map[string]string) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithAnnotations(entries map[string]string) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithFinalizers(values ...string) *CertificateSigningRequestApprovalApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *CertificateSigningRequestApprovalApplyConfiguration) 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 *CertificateSigningRequestApprovalApplyConfiguration) WithSpec(value v1beta1.CertificateSigningRequestApprovalSpec) *CertificateSigningRequestApprovalApplyConfiguration { + 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 *CertificateSigningRequestApprovalApplyConfiguration) WithStatus(value v1beta1.CertificateSigningRequestApprovalStatus) *CertificateSigningRequestApprovalApplyConfiguration { + b.Status = &value + return b +} diff --git a/client/applyconfiguration/utils.go b/client/applyconfiguration/utils.go index d893783041..6e69f1b481 100644 --- a/client/applyconfiguration/utils.go +++ b/client/applyconfiguration/utils.go @@ -248,6 +248,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &hypershiftv1beta1.AzureNodePoolPlatformApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("AzurePlatformSpec"): return &hypershiftv1beta1.AzurePlatformSpecApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequestApproval"): + return &hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ClusterAutoscaling"): return &hypershiftv1beta1.ClusterAutoscalingApplyConfiguration{} case v1beta1.SchemeGroupVersion.WithKind("ClusterConfiguration"): diff --git a/client/clientset/clientset/typed/hypershift/v1beta1/certificatesigningrequestapproval.go b/client/clientset/clientset/typed/hypershift/v1beta1/certificatesigningrequestapproval.go new file mode 100644 index 0000000000..313ecdd31c --- /dev/null +++ b/client/clientset/clientset/typed/hypershift/v1beta1/certificatesigningrequestapproval.go @@ -0,0 +1,255 @@ +/* + + +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 client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" + hypershiftv1beta1 "github.com/openshift/hypershift/client/applyconfiguration/hypershift/v1beta1" + scheme "github.com/openshift/hypershift/client/clientset/clientset/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// CertificateSigningRequestApprovalsGetter has a method to return a CertificateSigningRequestApprovalInterface. +// A group's client should implement this interface. +type CertificateSigningRequestApprovalsGetter interface { + CertificateSigningRequestApprovals(namespace string) CertificateSigningRequestApprovalInterface +} + +// CertificateSigningRequestApprovalInterface has methods to work with CertificateSigningRequestApproval resources. +type CertificateSigningRequestApprovalInterface interface { + Create(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.CreateOptions) (*v1beta1.CertificateSigningRequestApproval, error) + Update(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequestApproval, error) + UpdateStatus(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequestApproval, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CertificateSigningRequestApproval, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CertificateSigningRequestApprovalList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequestApproval, err error) + Apply(ctx context.Context, certificateSigningRequestApproval *hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) + ApplyStatus(ctx context.Context, certificateSigningRequestApproval *hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) + CertificateSigningRequestApprovalExpansion +} + +// certificateSigningRequestApprovals implements CertificateSigningRequestApprovalInterface +type certificateSigningRequestApprovals struct { + client rest.Interface + ns string +} + +// newCertificateSigningRequestApprovals returns a CertificateSigningRequestApprovals +func newCertificateSigningRequestApprovals(c *HypershiftV1beta1Client, namespace string) *certificateSigningRequestApprovals { + return &certificateSigningRequestApprovals{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the certificateSigningRequestApproval, and returns the corresponding certificateSigningRequestApproval object, and an error if there is any. +func (c *certificateSigningRequestApprovals) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { + result = &v1beta1.CertificateSigningRequestApproval{} + err = c.client.Get(). + Namespace(c.ns). + Resource("certificatesigningrequestapprovals"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CertificateSigningRequestApprovals that match those selectors. +func (c *certificateSigningRequestApprovals) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestApprovalList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.CertificateSigningRequestApprovalList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("certificatesigningrequestapprovals"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested certificateSigningRequestApprovals. +func (c *certificateSigningRequestApprovals) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("certificatesigningrequestapprovals"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a certificateSigningRequestApproval and creates it. Returns the server's representation of the certificateSigningRequestApproval, and an error, if there is any. +func (c *certificateSigningRequestApprovals) Create(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.CreateOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { + result = &v1beta1.CertificateSigningRequestApproval{} + err = c.client.Post(). + Namespace(c.ns). + Resource("certificatesigningrequestapprovals"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(certificateSigningRequestApproval). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a certificateSigningRequestApproval and updates it. Returns the server's representation of the certificateSigningRequestApproval, and an error, if there is any. +func (c *certificateSigningRequestApprovals) Update(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { + result = &v1beta1.CertificateSigningRequestApproval{} + err = c.client.Put(). + Namespace(c.ns). + Resource("certificatesigningrequestapprovals"). + Name(certificateSigningRequestApproval.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(certificateSigningRequestApproval). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *certificateSigningRequestApprovals) UpdateStatus(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { + result = &v1beta1.CertificateSigningRequestApproval{} + err = c.client.Put(). + Namespace(c.ns). + Resource("certificatesigningrequestapprovals"). + Name(certificateSigningRequestApproval.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(certificateSigningRequestApproval). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the certificateSigningRequestApproval and deletes it. Returns an error if one occurs. +func (c *certificateSigningRequestApprovals) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("certificatesigningrequestapprovals"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *certificateSigningRequestApprovals) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("certificatesigningrequestapprovals"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched certificateSigningRequestApproval. +func (c *certificateSigningRequestApprovals) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequestApproval, err error) { + result = &v1beta1.CertificateSigningRequestApproval{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("certificatesigningrequestapprovals"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequestApproval. +func (c *certificateSigningRequestApprovals) Apply(ctx context.Context, certificateSigningRequestApproval *hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { + if certificateSigningRequestApproval == nil { + return nil, fmt.Errorf("certificateSigningRequestApproval provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(certificateSigningRequestApproval) + if err != nil { + return nil, err + } + name := certificateSigningRequestApproval.Name + if name == nil { + return nil, fmt.Errorf("certificateSigningRequestApproval.Name must be provided to Apply") + } + result = &v1beta1.CertificateSigningRequestApproval{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("certificatesigningrequestapprovals"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *certificateSigningRequestApprovals) ApplyStatus(ctx context.Context, certificateSigningRequestApproval *hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { + if certificateSigningRequestApproval == nil { + return nil, fmt.Errorf("certificateSigningRequestApproval provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(certificateSigningRequestApproval) + if err != nil { + return nil, err + } + + name := certificateSigningRequestApproval.Name + if name == nil { + return nil, fmt.Errorf("certificateSigningRequestApproval.Name must be provided to Apply") + } + + result = &v1beta1.CertificateSigningRequestApproval{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("certificatesigningrequestapprovals"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_certificatesigningrequestapproval.go b/client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_certificatesigningrequestapproval.go new file mode 100644 index 0000000000..6d9e62e34d --- /dev/null +++ b/client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_certificatesigningrequestapproval.go @@ -0,0 +1,188 @@ +/* + + +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 client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" + hypershiftv1beta1 "github.com/openshift/hypershift/client/applyconfiguration/hypershift/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeCertificateSigningRequestApprovals implements CertificateSigningRequestApprovalInterface +type FakeCertificateSigningRequestApprovals struct { + Fake *FakeHypershiftV1beta1 + ns string +} + +var certificatesigningrequestapprovalsResource = v1beta1.SchemeGroupVersion.WithResource("certificatesigningrequestapprovals") + +var certificatesigningrequestapprovalsKind = v1beta1.SchemeGroupVersion.WithKind("CertificateSigningRequestApproval") + +// Get takes name of the certificateSigningRequestApproval, and returns the corresponding certificateSigningRequestApproval object, and an error if there is any. +func (c *FakeCertificateSigningRequestApprovals) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(certificatesigningrequestapprovalsResource, c.ns, name), &v1beta1.CertificateSigningRequestApproval{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CertificateSigningRequestApproval), err +} + +// List takes label and field selectors, and returns the list of CertificateSigningRequestApprovals that match those selectors. +func (c *FakeCertificateSigningRequestApprovals) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestApprovalList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(certificatesigningrequestapprovalsResource, certificatesigningrequestapprovalsKind, c.ns, opts), &v1beta1.CertificateSigningRequestApprovalList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.CertificateSigningRequestApprovalList{ListMeta: obj.(*v1beta1.CertificateSigningRequestApprovalList).ListMeta} + for _, item := range obj.(*v1beta1.CertificateSigningRequestApprovalList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested certificateSigningRequestApprovals. +func (c *FakeCertificateSigningRequestApprovals) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(certificatesigningrequestapprovalsResource, c.ns, opts)) + +} + +// Create takes the representation of a certificateSigningRequestApproval and creates it. Returns the server's representation of the certificateSigningRequestApproval, and an error, if there is any. +func (c *FakeCertificateSigningRequestApprovals) Create(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.CreateOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(certificatesigningrequestapprovalsResource, c.ns, certificateSigningRequestApproval), &v1beta1.CertificateSigningRequestApproval{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CertificateSigningRequestApproval), err +} + +// Update takes the representation of a certificateSigningRequestApproval and updates it. Returns the server's representation of the certificateSigningRequestApproval, and an error, if there is any. +func (c *FakeCertificateSigningRequestApprovals) Update(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(certificatesigningrequestapprovalsResource, c.ns, certificateSigningRequestApproval), &v1beta1.CertificateSigningRequestApproval{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CertificateSigningRequestApproval), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeCertificateSigningRequestApprovals) UpdateStatus(ctx context.Context, certificateSigningRequestApproval *v1beta1.CertificateSigningRequestApproval, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequestApproval, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(certificatesigningrequestapprovalsResource, "status", c.ns, certificateSigningRequestApproval), &v1beta1.CertificateSigningRequestApproval{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CertificateSigningRequestApproval), err +} + +// Delete takes name of the certificateSigningRequestApproval and deletes it. Returns an error if one occurs. +func (c *FakeCertificateSigningRequestApprovals) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(certificatesigningrequestapprovalsResource, c.ns, name, opts), &v1beta1.CertificateSigningRequestApproval{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCertificateSigningRequestApprovals) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(certificatesigningrequestapprovalsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.CertificateSigningRequestApprovalList{}) + return err +} + +// Patch applies the patch and returns the patched certificateSigningRequestApproval. +func (c *FakeCertificateSigningRequestApprovals) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequestApproval, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(certificatesigningrequestapprovalsResource, c.ns, name, pt, data, subresources...), &v1beta1.CertificateSigningRequestApproval{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CertificateSigningRequestApproval), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequestApproval. +func (c *FakeCertificateSigningRequestApprovals) Apply(ctx context.Context, certificateSigningRequestApproval *hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { + if certificateSigningRequestApproval == nil { + return nil, fmt.Errorf("certificateSigningRequestApproval provided to Apply must not be nil") + } + data, err := json.Marshal(certificateSigningRequestApproval) + if err != nil { + return nil, err + } + name := certificateSigningRequestApproval.Name + if name == nil { + return nil, fmt.Errorf("certificateSigningRequestApproval.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(certificatesigningrequestapprovalsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.CertificateSigningRequestApproval{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CertificateSigningRequestApproval), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeCertificateSigningRequestApprovals) ApplyStatus(ctx context.Context, certificateSigningRequestApproval *hypershiftv1beta1.CertificateSigningRequestApprovalApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequestApproval, err error) { + if certificateSigningRequestApproval == nil { + return nil, fmt.Errorf("certificateSigningRequestApproval provided to Apply must not be nil") + } + data, err := json.Marshal(certificateSigningRequestApproval) + if err != nil { + return nil, err + } + name := certificateSigningRequestApproval.Name + if name == nil { + return nil, fmt.Errorf("certificateSigningRequestApproval.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(certificatesigningrequestapprovalsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.CertificateSigningRequestApproval{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.CertificateSigningRequestApproval), err +} diff --git a/client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_hypershift_client.go b/client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_hypershift_client.go index 6d0b9d23a2..c5d32a5901 100644 --- a/client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_hypershift_client.go +++ b/client/clientset/clientset/typed/hypershift/v1beta1/fake/fake_hypershift_client.go @@ -27,6 +27,10 @@ type FakeHypershiftV1beta1 struct { *testing.Fake } +func (c *FakeHypershiftV1beta1) CertificateSigningRequestApprovals(namespace string) v1beta1.CertificateSigningRequestApprovalInterface { + return &FakeCertificateSigningRequestApprovals{c, namespace} +} + func (c *FakeHypershiftV1beta1) HostedClusters(namespace string) v1beta1.HostedClusterInterface { return &FakeHostedClusters{c, namespace} } diff --git a/client/clientset/clientset/typed/hypershift/v1beta1/generated_expansion.go b/client/clientset/clientset/typed/hypershift/v1beta1/generated_expansion.go index 29c529638c..33cbdad7ac 100644 --- a/client/clientset/clientset/typed/hypershift/v1beta1/generated_expansion.go +++ b/client/clientset/clientset/typed/hypershift/v1beta1/generated_expansion.go @@ -17,6 +17,8 @@ limitations under the License. package v1beta1 +type CertificateSigningRequestApprovalExpansion interface{} + type HostedClusterExpansion interface{} type HostedControlPlaneExpansion interface{} diff --git a/client/clientset/clientset/typed/hypershift/v1beta1/hypershift_client.go b/client/clientset/clientset/typed/hypershift/v1beta1/hypershift_client.go index dfcdaf022e..7ce2da0f94 100644 --- a/client/clientset/clientset/typed/hypershift/v1beta1/hypershift_client.go +++ b/client/clientset/clientset/typed/hypershift/v1beta1/hypershift_client.go @@ -27,6 +27,7 @@ import ( type HypershiftV1beta1Interface interface { RESTClient() rest.Interface + CertificateSigningRequestApprovalsGetter HostedClustersGetter HostedControlPlanesGetter NodePoolsGetter @@ -37,6 +38,10 @@ type HypershiftV1beta1Client struct { restClient rest.Interface } +func (c *HypershiftV1beta1Client) CertificateSigningRequestApprovals(namespace string) CertificateSigningRequestApprovalInterface { + return newCertificateSigningRequestApprovals(c, namespace) +} + func (c *HypershiftV1beta1Client) HostedClusters(namespace string) HostedClusterInterface { return newHostedClusters(c, namespace) } diff --git a/client/informers/externalversions/generic.go b/client/informers/externalversions/generic.go index 4aac6fa7e6..9c7736e989 100644 --- a/client/informers/externalversions/generic.go +++ b/client/informers/externalversions/generic.go @@ -64,6 +64,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Hypershift().V1alpha1().NodePools().Informer()}, nil // Group=hypershift.openshift.io, Version=v1beta1 + case v1beta1.SchemeGroupVersion.WithResource("certificatesigningrequestapprovals"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Hypershift().V1beta1().CertificateSigningRequestApprovals().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("hostedclusters"): return &genericInformer{resource: resource.GroupResource(), informer: f.Hypershift().V1beta1().HostedClusters().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("hostedcontrolplanes"): diff --git a/client/informers/externalversions/hypershift/v1beta1/certificatesigningrequestapproval.go b/client/informers/externalversions/hypershift/v1beta1/certificatesigningrequestapproval.go new file mode 100644 index 0000000000..bd82a48460 --- /dev/null +++ b/client/informers/externalversions/hypershift/v1beta1/certificatesigningrequestapproval.go @@ -0,0 +1,89 @@ +/* + + +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 v1beta1 + +import ( + "context" + time "time" + + hypershiftv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" + clientset "github.com/openshift/hypershift/client/clientset/clientset" + internalinterfaces "github.com/openshift/hypershift/client/informers/externalversions/internalinterfaces" + v1beta1 "github.com/openshift/hypershift/client/listers/hypershift/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// CertificateSigningRequestApprovalInformer provides access to a shared informer and lister for +// CertificateSigningRequestApprovals. +type CertificateSigningRequestApprovalInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.CertificateSigningRequestApprovalLister +} + +type certificateSigningRequestApprovalInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewCertificateSigningRequestApprovalInformer constructs a new informer for CertificateSigningRequestApproval 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 NewCertificateSigningRequestApprovalInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredCertificateSigningRequestApprovalInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredCertificateSigningRequestApprovalInformer constructs a new informer for CertificateSigningRequestApproval 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 NewFilteredCertificateSigningRequestApprovalInformer(client clientset.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.HypershiftV1beta1().CertificateSigningRequestApprovals(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.HypershiftV1beta1().CertificateSigningRequestApprovals(namespace).Watch(context.TODO(), options) + }, + }, + &hypershiftv1beta1.CertificateSigningRequestApproval{}, + resyncPeriod, + indexers, + ) +} + +func (f *certificateSigningRequestApprovalInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredCertificateSigningRequestApprovalInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *certificateSigningRequestApprovalInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&hypershiftv1beta1.CertificateSigningRequestApproval{}, f.defaultInformer) +} + +func (f *certificateSigningRequestApprovalInformer) Lister() v1beta1.CertificateSigningRequestApprovalLister { + return v1beta1.NewCertificateSigningRequestApprovalLister(f.Informer().GetIndexer()) +} diff --git a/client/informers/externalversions/hypershift/v1beta1/interface.go b/client/informers/externalversions/hypershift/v1beta1/interface.go index 098e82000f..9178b91e24 100644 --- a/client/informers/externalversions/hypershift/v1beta1/interface.go +++ b/client/informers/externalversions/hypershift/v1beta1/interface.go @@ -23,6 +23,8 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // CertificateSigningRequestApprovals returns a CertificateSigningRequestApprovalInformer. + CertificateSigningRequestApprovals() CertificateSigningRequestApprovalInformer // HostedClusters returns a HostedClusterInformer. HostedClusters() HostedClusterInformer // HostedControlPlanes returns a HostedControlPlaneInformer. @@ -42,6 +44,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// CertificateSigningRequestApprovals returns a CertificateSigningRequestApprovalInformer. +func (v *version) CertificateSigningRequestApprovals() CertificateSigningRequestApprovalInformer { + return &certificateSigningRequestApprovalInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + // HostedClusters returns a HostedClusterInformer. func (v *version) HostedClusters() HostedClusterInformer { return &hostedClusterInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/client/listers/hypershift/v1beta1/certificatesigningrequestapproval.go b/client/listers/hypershift/v1beta1/certificatesigningrequestapproval.go new file mode 100644 index 0000000000..2a1ca77486 --- /dev/null +++ b/client/listers/hypershift/v1beta1/certificatesigningrequestapproval.go @@ -0,0 +1,98 @@ +/* + + +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 lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// CertificateSigningRequestApprovalLister helps list CertificateSigningRequestApprovals. +// All objects returned here must be treated as read-only. +type CertificateSigningRequestApprovalLister interface { + // List lists all CertificateSigningRequestApprovals in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.CertificateSigningRequestApproval, err error) + // CertificateSigningRequestApprovals returns an object that can list and get CertificateSigningRequestApprovals. + CertificateSigningRequestApprovals(namespace string) CertificateSigningRequestApprovalNamespaceLister + CertificateSigningRequestApprovalListerExpansion +} + +// certificateSigningRequestApprovalLister implements the CertificateSigningRequestApprovalLister interface. +type certificateSigningRequestApprovalLister struct { + indexer cache.Indexer +} + +// NewCertificateSigningRequestApprovalLister returns a new CertificateSigningRequestApprovalLister. +func NewCertificateSigningRequestApprovalLister(indexer cache.Indexer) CertificateSigningRequestApprovalLister { + return &certificateSigningRequestApprovalLister{indexer: indexer} +} + +// List lists all CertificateSigningRequestApprovals in the indexer. +func (s *certificateSigningRequestApprovalLister) List(selector labels.Selector) (ret []*v1beta1.CertificateSigningRequestApproval, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.CertificateSigningRequestApproval)) + }) + return ret, err +} + +// CertificateSigningRequestApprovals returns an object that can list and get CertificateSigningRequestApprovals. +func (s *certificateSigningRequestApprovalLister) CertificateSigningRequestApprovals(namespace string) CertificateSigningRequestApprovalNamespaceLister { + return certificateSigningRequestApprovalNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// CertificateSigningRequestApprovalNamespaceLister helps list and get CertificateSigningRequestApprovals. +// All objects returned here must be treated as read-only. +type CertificateSigningRequestApprovalNamespaceLister interface { + // List lists all CertificateSigningRequestApprovals in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.CertificateSigningRequestApproval, err error) + // Get retrieves the CertificateSigningRequestApproval from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.CertificateSigningRequestApproval, error) + CertificateSigningRequestApprovalNamespaceListerExpansion +} + +// certificateSigningRequestApprovalNamespaceLister implements the CertificateSigningRequestApprovalNamespaceLister +// interface. +type certificateSigningRequestApprovalNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all CertificateSigningRequestApprovals in the indexer for a given namespace. +func (s certificateSigningRequestApprovalNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.CertificateSigningRequestApproval, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.CertificateSigningRequestApproval)) + }) + return ret, err +} + +// Get retrieves the CertificateSigningRequestApproval from the indexer for a given namespace and name. +func (s certificateSigningRequestApprovalNamespaceLister) Get(name string) (*v1beta1.CertificateSigningRequestApproval, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("certificatesigningrequestapproval"), name) + } + return obj.(*v1beta1.CertificateSigningRequestApproval), nil +} diff --git a/client/listers/hypershift/v1beta1/expansion_generated.go b/client/listers/hypershift/v1beta1/expansion_generated.go index 41f055a9c4..06d27550ca 100644 --- a/client/listers/hypershift/v1beta1/expansion_generated.go +++ b/client/listers/hypershift/v1beta1/expansion_generated.go @@ -17,6 +17,14 @@ limitations under the License. package v1beta1 +// CertificateSigningRequestApprovalListerExpansion allows custom methods to be added to +// CertificateSigningRequestApprovalLister. +type CertificateSigningRequestApprovalListerExpansion interface{} + +// CertificateSigningRequestApprovalNamespaceListerExpansion allows custom methods to be added to +// CertificateSigningRequestApprovalNamespaceLister. +type CertificateSigningRequestApprovalNamespaceListerExpansion interface{} + // HostedClusterListerExpansion allows custom methods to be added to // HostedClusterLister. type HostedClusterListerExpansion interface{} diff --git a/cmd/install/assets/hypershift-operator/hypershift.openshift.io_certificatesigningrequestapprovals.yaml b/cmd/install/assets/hypershift-operator/hypershift.openshift.io_certificatesigningrequestapprovals.yaml new file mode 100644 index 0000000000..4bd1d3f47d --- /dev/null +++ b/cmd/install/assets/hypershift-operator/hypershift.openshift.io_certificatesigningrequestapprovals.yaml @@ -0,0 +1,48 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: certificatesigningrequestapprovals.hypershift.openshift.io +spec: + group: hypershift.openshift.io + names: + kind: CertificateSigningRequestApproval + listKind: CertificateSigningRequestApprovalList + plural: certificatesigningrequestapprovals + shortNames: + - csra + - csras + singular: certificatesigningrequestapproval + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: CertificateSigningRequestApproval defines the desired state of + CertificateSigningRequestApproval + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: CertificateSigningRequestApprovalSpec defines the desired + state of CertificateSigningRequestApproval + type: object + status: + description: CertificateSigningRequestApprovalStatus defines the observed + state of CertificateSigningRequestApproval + type: object + type: object + served: true + storage: true diff --git a/docs/content/reference/api.md b/docs/content/reference/api.md index 362d689b74..80459e2a63 100644 --- a/docs/content/reference/api.md +++ b/docs/content/reference/api.md @@ -21,6 +21,79 @@ OpenShift clusters at scale.

worker nodes and their kubelets, and the infrastructure on which they run). This enables “hosted control plane as a service” use cases.

+##CertificateSigningRequestApproval { #hypershift.openshift.io/v1beta1.CertificateSigningRequestApproval } +

+

CertificateSigningRequestApproval defines the desired state of CertificateSigningRequestApproval

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldDescription
+apiVersion
+string
+ +hypershift.openshift.io/v1beta1 + +
+kind
+string +
CertificateSigningRequestApproval
+metadata
+ + +Kubernetes meta/v1.ObjectMeta + + +
+Refer to the Kubernetes API documentation for the fields of the +metadata field. +
+spec
+ + +CertificateSigningRequestApprovalSpec + + +
+
+
+ +
+
+status
+ + +CertificateSigningRequestApprovalStatus + + +
+
##HostedCluster { #hypershift.openshift.io/v1beta1.HostedCluster }

HostedCluster is the primary representation of a HyperShift cluster and encapsulates @@ -2394,6 +2467,22 @@ string

+###CertificateSigningRequestApprovalSpec { #hypershift.openshift.io/v1beta1.CertificateSigningRequestApprovalSpec } +

+(Appears on: +CertificateSigningRequestApproval) +

+

+

CertificateSigningRequestApprovalSpec defines the desired state of CertificateSigningRequestApproval

+

+###CertificateSigningRequestApprovalStatus { #hypershift.openshift.io/v1beta1.CertificateSigningRequestApprovalStatus } +

+(Appears on: +CertificateSigningRequestApproval) +

+

+

CertificateSigningRequestApprovalStatus defines the observed state of CertificateSigningRequestApproval

+

###ClusterAutoscaling { #hypershift.openshift.io/v1beta1.ClusterAutoscaling }

(Appears on: diff --git a/hack/app-sre/saas_template.yaml b/hack/app-sre/saas_template.yaml index 69841402b2..db17905c1f 100644 --- a/hack/app-sre/saas_template.yaml +++ b/hack/app-sre/saas_template.yaml @@ -37068,6 +37068,73 @@ objects: plural: "" conditions: null storedVersions: null +- apiVersion: apiextensions.k8s.io/v1 + kind: CustomResourceDefinition + metadata: + annotations: + service.beta.openshift.io/inject-cabundle: "true" + creationTimestamp: null + name: certificatesigningrequestapprovals.hypershift.openshift.io + spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + name: operator + namespace: ${NAMESPACE} + path: /convert + port: 443 + conversionReviewVersions: + - v1beta1 + - v1alpha1 + group: hypershift.openshift.io + names: + kind: CertificateSigningRequestApproval + listKind: CertificateSigningRequestApprovalList + plural: certificatesigningrequestapprovals + shortNames: + - csra + - csras + singular: certificatesigningrequestapproval + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: CertificateSigningRequestApproval defines the desired state + of CertificateSigningRequestApproval + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource + this object represents. Servers may infer this from the endpoint the + client submits requests to. Cannot be updated. In CamelCase. More + info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: CertificateSigningRequestApprovalSpec defines the desired + state of CertificateSigningRequestApproval + type: object + status: + description: CertificateSigningRequestApprovalStatus defines the observed + state of CertificateSigningRequestApproval + type: object + type: object + served: true + storage: true + status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null - apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: