Skip to content

Commit 062ae57

Browse files
committed
upgrade api version
Signed-off-by: lucming <[email protected]>
1 parent 12d8edc commit 062ae57

File tree

151 files changed

+6059
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+6059
-99
lines changed

hack/boilerplate.go.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2021 The Volcano Authors.
2+
Copyright 2022 The Volcano Authors.
33

44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

hack/update-codegen.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ SCRIPT_ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)
2828
# instead of the $GOPATH directly. For normal projects this can be dropped.
2929
bash ${SCRIPT_ROOT}/hack/generate-groups.sh "deepcopy,client,informer,lister" \
3030
volcano.sh/apis/pkg/client volcano.sh/apis/pkg/apis \
31-
"batch:v1alpha1 bus:v1alpha1 scheduling:v1beta1 nodeinfo:v1alpha1 flow:v1alpha1" \
31+
"batch:v1alpha1 bus:v1alpha1 scheduling:v1beta1 nodeinfo:v1alpha1 flow:v1alpha1 batch:v1 bus:v1 scheduling:v1" \
3232
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt
3333

3434
echo "--------------------"
3535

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

pkg/apis/batch/v1/doc.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
Copyright 2022 The Volcano Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package v1 contains API Schema definitions for the batch v1 API group
18+
// +kubebuilder:object:generate=true
19+
// +groupName=batch.volcano.sh
20+
// +k8s:deepcopy-gen=package
21+
package v1

pkg/apis/batch/v1/labels.go

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
Copyright 2022 The Volcano Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1
18+
19+
const (
20+
// TaskSpecKey task spec key used in pod annotation
21+
TaskSpecKey = "volcano.sh/task-spec"
22+
// JobNameKey job name key used in pod annotation / labels
23+
JobNameKey = "volcano.sh/job-name"
24+
// QueueNameKey queue name key used in pod annotation / labels
25+
QueueNameKey = "volcano.sh/queue-name"
26+
// JobNamespaceKey job namespace key
27+
JobNamespaceKey = "volcano.sh/job-namespace"
28+
// DefaultTaskSpec default task spec value
29+
DefaultTaskSpec = "default"
30+
// JobVersion job version key used in pod annotation
31+
JobVersion = "volcano.sh/job-version"
32+
// JobTypeKey job type key used in labels
33+
JobTypeKey = "volcano.sh/job-type"
34+
// PodgroupNamePrefix podgroup name prefix
35+
PodgroupNamePrefix = "podgroup-"
36+
// PodTemplateKey type specify a equivalence pod class
37+
PodTemplateKey = "volcano.sh/template-uid"
38+
// JobForwardingKey job forwarding key used in job annotation
39+
JobForwardingKey = "volcano.sh/job-forwarding"
40+
// ForwardClusterKey cluster key used in pod annotation
41+
ForwardClusterKey = "volcano.sh/forward-cluster"
42+
// OrginalNameKey annotation key for resource name
43+
OrginalNameKey = "volcano.sh/burst-name"
44+
// BurstToSiloClusterAnnotation labels key for resource only in silo cluster
45+
BurstToSiloClusterAnnotation = "volcano.sh/silo-resource"
46+
)

pkg/apis/batch/v1/register.go

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
Copyright 2022 The Volcano Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
"k8s.io/apimachinery/pkg/runtime"
22+
"k8s.io/apimachinery/pkg/runtime/schema"
23+
)
24+
25+
var (
26+
// SchemeBuilder points to a list of functions added to Scheme.
27+
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
28+
// AddToScheme applies all the stored functions to the scheme.
29+
AddToScheme = SchemeBuilder.AddToScheme
30+
)
31+
32+
// GroupName is the group name used in this package.
33+
const GroupName = "batch.volcano.sh"
34+
35+
// SchemeGroupVersion is the group version used to register these objects.
36+
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
37+
38+
// Resource takes an unqualified resource and returns a Group-qualified GroupResource.
39+
func Resource(resource string) schema.GroupResource {
40+
return SchemeGroupVersion.WithResource(resource).GroupResource()
41+
}
42+
43+
// addKnownTypes adds the set of types defined in this package to the supplied scheme.
44+
func addKnownTypes(scheme *runtime.Scheme) error {
45+
scheme.AddKnownTypes(SchemeGroupVersion,
46+
&Job{},
47+
&JobList{},
48+
)
49+
50+
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
51+
return nil
52+
}

0 commit comments

Comments
 (0)