Skip to content

Commit a035e67

Browse files
committed
Add crd only chart, that installs CRDs unconditionally
not happy with that, but it seems that's the preferable way currently. Chart is auto-version on every CRD changed and pushed to ghcr.
1 parent 800d17e commit a035e67

5 files changed

Lines changed: 838 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Helm CRD OCI Package GHCR
5+
"on":
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- 'charts/openstack-hypervisor-operator/crds/**'
11+
workflow_dispatch: {}
12+
permissions:
13+
contents: read
14+
packages: write
15+
jobs:
16+
build-and-push-helm-crd-package:
17+
name: Build and publish Helm CRD Chart OCI
18+
runs-on: large_runner_16core_64gb
19+
steps:
20+
- name: Check out code
21+
uses: actions/checkout@v6
22+
with:
23+
fetch-depth: 0
24+
fetch-tags: true
25+
- name: Install Helm
26+
uses: azure/setup-helm@v4
27+
- name: Sync CRDs from main chart
28+
run: |
29+
cp charts/openstack-hypervisor-operator/crds/*.yaml charts/openstack-hypervisor-operator-crd/templates/
30+
- name: Lint Helm Chart
31+
run: helm lint charts/openstack-hypervisor-operator-crd
32+
- name: Package Helm Chart
33+
run: |
34+
# Use run number to auto-increment version on each CRD change
35+
VERSION="1.0.${{ github.run_number }}"
36+
echo "Running helm package with version $VERSION"
37+
helm package charts/openstack-hypervisor-operator-crd --destination ./chart --version "$VERSION"
38+
- name: Log in to the Container registry
39+
uses: docker/login-action@v4
40+
with:
41+
password: ${{ secrets.GITHUB_TOKEN }}
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
- name: Push Helm Chart to ghcr.io
45+
run: helm push ./chart/*.tgz oci://ghcr.io/${{ github.repository_owner }}/charts
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Patterns to ignore when building packages.
2+
.DS_Store
3+
*.swp
4+
*.bak
5+
*.tmp
6+
*~
7+
.git
8+
.gitignore
9+
.bzr
10+
.bzrignore
11+
.hg
12+
.hgignore
13+
.svn
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: openstack-hypervisor-operator-crd
3+
description: CRDs for the OpenStack Hypervisor Operator
4+
appVersion: latest
5+
version: 1.0.0
6+
type: application
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.19.0
7+
name: evictions.kvm.cloud.sap
8+
spec:
9+
group: kvm.cloud.sap
10+
names:
11+
kind: Eviction
12+
listKind: EvictionList
13+
plural: evictions
14+
shortNames:
15+
- evi
16+
singular: eviction
17+
scope: Cluster
18+
versions:
19+
- additionalPrinterColumns:
20+
- jsonPath: .spec.hypervisor
21+
name: Hypervisor
22+
type: string
23+
- jsonPath: .spec.reason
24+
name: Reason
25+
type: string
26+
- jsonPath: .status.conditions[?(@.type=="Evicting")].reason
27+
name: State
28+
type: string
29+
- jsonPath: .metadata.creationTimestamp
30+
name: Created
31+
type: date
32+
name: v1
33+
schema:
34+
openAPIV3Schema:
35+
description: Eviction is the Schema for the evictions API
36+
properties:
37+
apiVersion:
38+
description: |-
39+
APIVersion defines the versioned schema of this representation of an object.
40+
Servers should convert recognized schemas to the latest internal value, and
41+
may reject unrecognized values.
42+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
43+
type: string
44+
kind:
45+
description: |-
46+
Kind is a string value representing the REST resource this object represents.
47+
Servers may infer this from the endpoint the client submits requests to.
48+
Cannot be updated.
49+
In CamelCase.
50+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
51+
type: string
52+
metadata:
53+
type: object
54+
spec:
55+
description: EvictionSpec defines the desired state of Eviction
56+
properties:
57+
hypervisor:
58+
description: Name of hypervisor to evict
59+
minLength: 1
60+
type: string
61+
x-kubernetes-validations:
62+
- message: Value is immutable
63+
rule: self == oldSelf
64+
reason:
65+
description: Reason for eviction, always required
66+
minLength: 1
67+
type: string
68+
required:
69+
- hypervisor
70+
- reason
71+
type: object
72+
status:
73+
description: EvictionStatus defines the observed state of Eviction
74+
properties:
75+
conditions:
76+
description: Conditions is an array of current conditions
77+
items:
78+
description: Condition contains details for one aspect of the current
79+
state of this API Resource.
80+
properties:
81+
lastTransitionTime:
82+
description: |-
83+
lastTransitionTime is the last time the condition transitioned from one status to another.
84+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
85+
format: date-time
86+
type: string
87+
message:
88+
description: |-
89+
message is a human readable message indicating details about the transition.
90+
This may be an empty string.
91+
maxLength: 32768
92+
type: string
93+
observedGeneration:
94+
description: |-
95+
observedGeneration represents the .metadata.generation that the condition was set based upon.
96+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
97+
with respect to the current state of the instance.
98+
format: int64
99+
minimum: 0
100+
type: integer
101+
reason:
102+
description: |-
103+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
104+
Producers of specific condition types may define expected values and meanings for this field,
105+
and whether the values are considered a guaranteed API.
106+
The value should be a CamelCase string.
107+
This field may not be empty.
108+
maxLength: 1024
109+
minLength: 1
110+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
111+
type: string
112+
status:
113+
description: status of the condition, one of True, False, Unknown.
114+
enum:
115+
- "True"
116+
- "False"
117+
- Unknown
118+
type: string
119+
type:
120+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
121+
maxLength: 316
122+
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])$
123+
type: string
124+
required:
125+
- lastTransitionTime
126+
- message
127+
- reason
128+
- status
129+
- type
130+
type: object
131+
type: array
132+
hypervisorServiceId:
133+
type: string
134+
outstandingInstances:
135+
items:
136+
type: string
137+
type: array
138+
outstandingRamMb:
139+
default: 0
140+
format: int64
141+
type: integer
142+
type: object
143+
type: object
144+
served: true
145+
storage: true
146+
subresources:
147+
status: {}

0 commit comments

Comments
 (0)