Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add v1 api version #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hack/boilerplate.go.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Volcano Authors.
Copyright 2022 The Volcano Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ SCRIPT_ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)
# instead of the $GOPATH directly. For normal projects this can be dropped.
bash ${SCRIPT_ROOT}/hack/generate-groups.sh "deepcopy,client,informer,lister" \
volcano.sh/apis/pkg/client volcano.sh/apis/pkg/apis \
"batch:v1alpha1 bus:v1alpha1 scheduling:v1beta1 nodeinfo:v1alpha1 flow:v1alpha1" \
"batch:v1alpha1 bus:v1alpha1 scheduling:v1beta1 nodeinfo:v1alpha1 flow:v1alpha1 batch:v1 bus:v1 scheduling:v1" \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt

echo "--------------------"

bash ${SCRIPT_ROOT}/hack/generate-internal-groups.sh "deepcopy,conversion" \
volcano.sh/apis/pkg/apis/ volcano.sh/apis/pkg/apis volcano.sh/apis/pkg/apis \
"scheduling:v1beta1" \
"scheduling:v1beta1 scheduling:v1" \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt

21 changes: 21 additions & 0 deletions pkg/apis/batch/v1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Copyright 2022 The Volcano 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 contains API Schema definitions for the batch v1 API group
// +kubebuilder:object:generate=true
// +groupName=batch.volcano.sh
// +k8s:deepcopy-gen=package
package v1
46 changes: 46 additions & 0 deletions pkg/apis/batch/v1/labels.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright 2022 The Volcano 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

const (
// TaskSpecKey task spec key used in pod annotation
TaskSpecKey = "volcano.sh/task-spec"
// JobNameKey job name key used in pod annotation / labels
JobNameKey = "volcano.sh/job-name"
// QueueNameKey queue name key used in pod annotation / labels
QueueNameKey = "volcano.sh/queue-name"
// JobNamespaceKey job namespace key
JobNamespaceKey = "volcano.sh/job-namespace"
// DefaultTaskSpec default task spec value
DefaultTaskSpec = "default"
// JobVersion job version key used in pod annotation
JobVersion = "volcano.sh/job-version"
// JobTypeKey job type key used in labels
JobTypeKey = "volcano.sh/job-type"
// PodgroupNamePrefix podgroup name prefix
PodgroupNamePrefix = "podgroup-"
// PodTemplateKey type specify a equivalence pod class
PodTemplateKey = "volcano.sh/template-uid"
// JobForwardingKey job forwarding key used in job annotation
JobForwardingKey = "volcano.sh/job-forwarding"
// ForwardClusterKey cluster key used in pod annotation
ForwardClusterKey = "volcano.sh/forward-cluster"
// OrginalNameKey annotation key for resource name
OrginalNameKey = "volcano.sh/burst-name"
// BurstToSiloClusterAnnotation labels key for resource only in silo cluster
BurstToSiloClusterAnnotation = "volcano.sh/silo-resource"
)
52 changes: 52 additions & 0 deletions pkg/apis/batch/v1/register.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
Copyright 2022 The Volcano 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 (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)

var (
// SchemeBuilder points to a list of functions added to Scheme.
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
// AddToScheme applies all the stored functions to the scheme.
AddToScheme = SchemeBuilder.AddToScheme
)

// GroupName is the group name used in this package.
const GroupName = "batch.volcano.sh"

// SchemeGroupVersion is the group version used to register these objects.
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}

// Resource takes an unqualified resource and returns a Group-qualified GroupResource.
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}

// addKnownTypes adds the set of types defined in this package to the supplied scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&Job{},
&JobList{},
)

metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
Loading