From 22d5ddee92d4df9e167929550b610f7bfa1980d6 Mon Sep 17 00:00:00 2001 From: Varsha Date: Mon, 14 Oct 2024 08:14:17 -0700 Subject: [PATCH] [v2alpha] Move GV related codebase (#2281) Move GV related codebase in v2alpha Signed-off-by: Varsha Prasad Narsing --- pkg/apis/kubeflow.org/v1/groupversion_info.go | 8 ++++++ pkg/apis/kubeflow.org/v1/register.go | 27 ------------------- .../v2alpha1/groupversion_info.go | 5 ++++ pkg/apis/kubeflow.org/v2alpha1/register.go | 24 ----------------- 4 files changed, 13 insertions(+), 51 deletions(-) delete mode 100644 pkg/apis/kubeflow.org/v1/register.go delete mode 100644 pkg/apis/kubeflow.org/v2alpha1/register.go diff --git a/pkg/apis/kubeflow.org/v1/groupversion_info.go b/pkg/apis/kubeflow.org/v1/groupversion_info.go index 20180ad596..8d3e2aaae0 100644 --- a/pkg/apis/kubeflow.org/v1/groupversion_info.go +++ b/pkg/apis/kubeflow.org/v1/groupversion_info.go @@ -35,4 +35,12 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme + + // SchemeGroupVersion is group version used to register these objects. + SchemeGroupVersion = GroupVersion ) + +// Resource takes an unqualified resource and returns a Group-qualified GroupResource. +func Resource(resource string) schema.GroupResource { + return GroupVersion.WithResource(resource).GroupResource() +} diff --git a/pkg/apis/kubeflow.org/v1/register.go b/pkg/apis/kubeflow.org/v1/register.go deleted file mode 100644 index cad0586100..0000000000 --- a/pkg/apis/kubeflow.org/v1/register.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2018 The Kubeflow Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package v1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// SchemeGroupVersion is group version used to register these objects. -var SchemeGroupVersion = GroupVersion - -// Resource takes an unqualified resource and returns a Group-qualified GroupResource. -func Resource(resource string) schema.GroupResource { - return GroupVersion.WithResource(resource).GroupResource() -} diff --git a/pkg/apis/kubeflow.org/v2alpha1/groupversion_info.go b/pkg/apis/kubeflow.org/v2alpha1/groupversion_info.go index a4cc2fd7d5..d6a4656b97 100644 --- a/pkg/apis/kubeflow.org/v2alpha1/groupversion_info.go +++ b/pkg/apis/kubeflow.org/v2alpha1/groupversion_info.go @@ -37,3 +37,8 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme ) + +// Resource takes an unqualified resource and returns a Group-qualified GroupResource. +func Resource(resource string) schema.GroupResource { + return GroupVersion.WithResource(resource).GroupResource() +} diff --git a/pkg/apis/kubeflow.org/v2alpha1/register.go b/pkg/apis/kubeflow.org/v2alpha1/register.go deleted file mode 100644 index 9d8659b757..0000000000 --- a/pkg/apis/kubeflow.org/v2alpha1/register.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2024 The Kubeflow Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package v2alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// Resource takes an unqualified resource and returns a Group-qualified GroupResource. -func Resource(resource string) schema.GroupResource { - return GroupVersion.WithResource(resource).GroupResource() -}