Skip to content

Commit 061466d

Browse files
committed
add missing CRD for volcano-sh/volcano
Signed-off-by: Sebastian Hoß <seb@xn--ho-hia.de>
1 parent 0b52c09 commit 061466d

File tree

10 files changed

+425
-0
lines changed

10 files changed

+425
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# SPDX-FileCopyrightText: The kube-custom-resources-rs Authors
2+
# SPDX-License-Identifier: 0BSD
3+
4+
name: Release topology_volcano_sh
5+
on:
6+
schedule:
7+
- cron: 13 20 * * SUN
8+
workflow_dispatch:
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- id: checkout
16+
name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- id: commits
21+
name: Count Commits
22+
run: echo "count=$(git rev-list --count HEAD --since='last Sunday' -- custom-resources/topology_volcano_sh)" >> $GITHUB_OUTPUT
23+
- id: release
24+
name: Create Release Version
25+
if: steps.commits.outputs.count > 0
26+
run: echo "version=1.$(date --utc +'%Y%m%d').$(date --utc +'%-H%M%S')" >> $GITHUB_OUTPUT
27+
- name: Set up Rust
28+
if: steps.commits.outputs.count > 0
29+
uses: dtolnay/rust-toolchain@stable
30+
- name: Install cargo-workspaces
31+
uses: taiki-e/install-action@v2
32+
with:
33+
tool: cargo-edit
34+
- name: Cargo Version
35+
if: steps.commits.outputs.count > 0
36+
run: cargo set-version --package kcr_topology_volcano_sh ${{ steps.release.outputs.version }}
37+
- name: Publish to crates.io
38+
if: steps.commits.outputs.count > 0
39+
run: >
40+
cargo publish
41+
--allow-dirty
42+
--token ${{ secrets.CRATES_IO_TOKEN }}
43+
--package kcr_topology_volcano_sh
44+
--jobs 1
45+
--no-verify
46+
env:
47+
RUSTFLAGS: "-A warnings"
48+
- id: mail
49+
name: Send Mail
50+
if: steps.commits.outputs.count > 0
51+
uses: dawidd6/action-send-mail@v5
52+
with:
53+
server_address: ${{ secrets.MAIL_SERVER }}
54+
server_port: ${{ secrets.MAIL_PORT }}
55+
username: ${{ secrets.MAIL_USERNAME }}
56+
password: ${{ secrets.MAIL_PASSWORD }}
57+
subject: ${{ github.event.repository.name }}/topology_volcano_sh version ${{ steps.release.outputs.version }} published
58+
body: See ${{ steps.create_release.outputs.url }} for details.
59+
to: ${{ secrets.MAIL_RECIPIENT }}
60+
from: ${{ secrets.MAIL_SENDER }}
61+
- id: matrix
62+
name: Send Matrix Message
63+
if: steps.commits.outputs.count > 0
64+
uses: s3krit/matrix-message-action@v0.0.3
65+
with:
66+
room_id: ${{ secrets.MATRIX_ROOM_ID }}
67+
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
68+
message: ${{ github.event.repository.name }}/topology_volcano_sh version [${{ steps.release.outputs.version }}](${{ steps.create_release.outputs.url }}) published
69+
server: ${{ secrets.MATRIX_SERVER }}

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ members = [
385385
"custom-resources/theketch_io",
386386
"custom-resources/tinkerbell_org",
387387
"custom-resources/topology_node_k8s_io",
388+
"custom-resources/topology_volcano_sh",
388389
"custom-resources/topolvm_cybozu_com",
389390
"custom-resources/trace_kubeblocks_io",
390391
"custom-resources/traefik_io",

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ The following groups are available:
425425
- [theketch.io](https://crates.io/crates/kcr_theketch_io)
426426
- [tinkerbell.org](https://crates.io/crates/kcr_tinkerbell_org)
427427
- [topology.node.k8s.io](https://crates.io/crates/kcr_topology_node_k8s_io)
428+
- [topology.volcano.sh](https://crates.io/crates/kcr_topology_volcano_sh)
428429
- [topolvm.cybozu.com](https://crates.io/crates/kcr_topolvm_cybozu_com)
429430
- [trace.kubeblocks.io](https://crates.io/crates/kcr_trace_kubeblocks_io)
430431
- [traefik.io](https://crates.io/crates/kcr_traefik_io)

code-generator/src/catalog.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3818,6 +3818,7 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[
38183818
"https://github.com/volcano-sh/volcano/blob/master/config/crd/volcano/bases/nodeinfo.volcano.sh_numatopologies.yaml",
38193819
"https://github.com/volcano-sh/volcano/blob/master/config/crd/volcano/bases/scheduling.volcano.sh_podgroups.yaml",
38203820
"https://github.com/volcano-sh/volcano/blob/master/config/crd/volcano/bases/scheduling.volcano.sh_queues.yaml",
3821+
"https://github.com/volcano-sh/volcano/blob/master/config/crd/volcano/bases/topology.volcano.sh_hypernodes.yaml",
38213822
"https://github.com/volcano-sh/volcano/blob/master/config/crd/jobflow/bases/flow.volcano.sh_jobflows.yaml",
38223823
"https://github.com/volcano-sh/volcano/blob/master/config/crd/jobflow/bases/flow.volcano.sh_jobtemplates.yaml",
38233824
],
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
apiVersion: "apiextensions.k8s.io/v1"
2+
kind: "CustomResourceDefinition"
3+
metadata:
4+
annotations:
5+
controller-gen.kubebuilder.io/version: "v0.17.0"
6+
name: "hypernodes.topology.volcano.sh"
7+
spec:
8+
group: "topology.volcano.sh"
9+
names:
10+
kind: "HyperNode"
11+
listKind: "HyperNodeList"
12+
plural: "hypernodes"
13+
shortNames:
14+
- "hn"
15+
singular: "hypernode"
16+
scope: "Cluster"
17+
versions:
18+
- additionalPrinterColumns:
19+
- jsonPath: ".spec.tier"
20+
name: "Tier"
21+
type: "string"
22+
- jsonPath: ".status.nodeCount"
23+
name: "NodeCount"
24+
type: "integer"
25+
- jsonPath: ".metadata.creationTimestamp"
26+
name: "Age"
27+
type: "date"
28+
name: "v1alpha1"
29+
schema:
30+
openAPIV3Schema:
31+
description: "HyperNode represents a collection of nodes sharing similar network topology or performance characteristics."
32+
properties:
33+
apiVersion:
34+
description: "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources"
35+
type: "string"
36+
kind:
37+
description: "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
38+
type: "string"
39+
metadata:
40+
type: "object"
41+
spec:
42+
description: "Spec defines the desired configuration of the HyperNode."
43+
properties:
44+
members:
45+
description: "Members defines a list of node groups or individual nodes included in the HyperNode."
46+
items:
47+
description: "MemberSpec represents a specific node or a hyperNodes in the hyperNode."
48+
properties:
49+
selector:
50+
description: "Selector defines the selection rules for this member."
51+
properties:
52+
exactMatch:
53+
description: "ExactMatch defines the exact match criteria."
54+
properties:
55+
name:
56+
description: "Name specifies the exact name of the node to match."
57+
type: "string"
58+
type: "object"
59+
labelMatch:
60+
description: "LabelMatch defines the labels match criteria (only take effect when Member Type is \"Node\")."
61+
properties:
62+
matchExpressions:
63+
description: "matchExpressions is a list of label selector requirements. The requirements are ANDed."
64+
items:
65+
description: "A label selector requirement is a selector that contains values, a key, and an operator that\nrelates the key and values."
66+
properties:
67+
key:
68+
description: "key is the label key that the selector applies to."
69+
type: "string"
70+
operator:
71+
description: "operator represents a key's relationship to a set of values.\nValid operators are In, NotIn, Exists and DoesNotExist."
72+
type: "string"
73+
values:
74+
description: "values is an array of string values. If the operator is In or NotIn,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. This array is replaced during a strategic\nmerge patch."
75+
items:
76+
type: "string"
77+
type: "array"
78+
x-kubernetes-list-type: "atomic"
79+
required:
80+
- "key"
81+
- "operator"
82+
type: "object"
83+
type: "array"
84+
x-kubernetes-list-type: "atomic"
85+
matchLabels:
86+
additionalProperties:
87+
type: "string"
88+
description: "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels\nmap is equivalent to an element of matchExpressions, whose key field is \"key\", the\noperator is \"In\", and the values array contains only \"value\". The requirements are ANDed."
89+
type: "object"
90+
type: "object"
91+
x-kubernetes-map-type: "atomic"
92+
regexMatch:
93+
description: "RegexMatch defines the regex match criteria."
94+
properties:
95+
pattern:
96+
description: "Pattern defines the regex pattern to match node names."
97+
type: "string"
98+
type: "object"
99+
type: "object"
100+
x-kubernetes-validations:
101+
- message: "Either ExactMatch or RegexMatch or LabelMatch must be specified"
102+
rule: "has(self.exactMatch) || has(self.regexMatch) || has(self.labelMatch)"
103+
- message: "Only one of ExactMatch, RegexMatch, or LabelMatch can be specified"
104+
rule: "(has(self.exactMatch) ? 1 : 0) + (has(self.regexMatch) ? 1 : 0) + (has(self.labelMatch) ? 1 : 0) <= 1"
105+
type:
106+
description: "Type specifies the member type."
107+
enum:
108+
- "Node"
109+
- "HyperNode"
110+
type: "string"
111+
required:
112+
- "type"
113+
type: "object"
114+
type: "array"
115+
tier:
116+
description: "Tier categorizes the performance level of the HyperNode."
117+
type: "integer"
118+
required:
119+
- "tier"
120+
type: "object"
121+
status:
122+
description: "Status provides the current state of the HyperNode."
123+
properties:
124+
conditions:
125+
description: "Conditions provide details about the current state of the HyperNode."
126+
items:
127+
description: "Condition contains details for one aspect of the current state of this API Resource."
128+
properties:
129+
lastTransitionTime:
130+
description: "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable."
131+
format: "date-time"
132+
type: "string"
133+
message:
134+
description: "message is a human readable message indicating details about the transition.\nThis may be an empty string."
135+
maxLength: 32768
136+
type: "string"
137+
observedGeneration:
138+
description: "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance."
139+
format: "int64"
140+
minimum: 0.0
141+
type: "integer"
142+
reason:
143+
description: "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty."
144+
maxLength: 1024
145+
minLength: 1
146+
pattern: "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$"
147+
type: "string"
148+
status:
149+
description: "status of the condition, one of True, False, Unknown."
150+
enum:
151+
- "True"
152+
- "False"
153+
- "Unknown"
154+
type: "string"
155+
type:
156+
description: "type of condition in CamelCase or in foo.example.com/CamelCase."
157+
maxLength: 316
158+
pattern: "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$"
159+
type: "string"
160+
required:
161+
- "lastTransitionTime"
162+
- "message"
163+
- "reason"
164+
- "status"
165+
- "type"
166+
type: "object"
167+
type: "array"
168+
nodeCount:
169+
description: "NodeCount is the total number of nodes currently in the HyperNode."
170+
format: "int64"
171+
minimum: 0.0
172+
type: "integer"
173+
type: "object"
174+
type: "object"
175+
served: true
176+
storage: true
177+
subresources:
178+
status: {}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SPDX-FileCopyrightText: The kube-custom-resources-rs Authors
2+
# SPDX-License-Identifier: 0BSD
3+
4+
[package]
5+
name = "kcr_topology_volcano_sh"
6+
version = "0.0.0"
7+
edition.workspace = true
8+
authors.workspace = true
9+
description.workspace = true
10+
homepage.workspace = true
11+
readme = "README.md"
12+
keywords.workspace = true
13+
categories.workspace = true
14+
license.workspace = true
15+
repository.workspace = true
16+
17+
[dependencies]
18+
schemars = { version = "~0" }
19+
serde = { version = "~1" }
20+
serde_json = { version = "~1" }
21+
k8s-openapi = { version = "~0" }
22+
kube = { version = "~1", default-features = false, features = ["derive"] }
23+
24+
[dev-dependencies]
25+
k8s-openapi = { version = "~0", features = ["v1_33"] }
26+
27+
[package.metadata.docs.rs]
28+
features = ["k8s-openapi/v1_33"]
29+
30+
[features]
31+
default = ["v1alpha1"]
32+
v1alpha1 = []
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!--
2+
SPDX-FileCopyrightText: The kube-custom-resources-rs Authors
3+
SPDX-License-Identifier: 0BSD
4+
-->
5+
6+
# topology.volcano.sh
7+
8+
This crate contains [kube-rs](https://kube.rs/) compatible bindings for Kubernetes [custom resources](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/) of the `topology.volcano.sh` group. Each binding is generated with [kopium](https://github.com/kube-rs/kopium), updated and released weekly.
9+
10+
This crate is part of [kube-custom-resources-rs](https://github.com/metio/kube-custom-resources-rs).
11+
12+
## Available Custom Resources
13+
14+
### topology.volcano.sh/v1alpha1
15+
- `HyperNode`
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*!
2+
This crate contains [kube-rs](https://kube.rs/) compatible bindings for Kubernetes [custom resources](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/) for the `topology.volcano.sh` group. Each binding is generated with [kopium](https://github.com/kube-rs/kopium), updated and released weekly.
3+
4+
# Available Custom Resources
5+
6+
## topology.volcano.sh/v1alpha1
7+
- `HyperNode`
8+
*/
9+
#[cfg(feature = "v1alpha1")]
10+
pub mod v1alpha1;

0 commit comments

Comments
 (0)