Skip to content

Commit 1fc2ffd

Browse files
feat(api): add ProviderConfig (#45)
* feat: add `ProviderConfig` Co-authored-by: Valentin Gerlach <[email protected]> * chore: upgrade openmcp-operator to 0.9.1 * docs: add more comments * feat: install CRDs via `init` command line argument * feat: release v0.0.3 --------- Co-authored-by: Valentin Gerlach <[email protected]>
1 parent 282a269 commit 1fc2ffd

File tree

10 files changed

+264
-220
lines changed

10 files changed

+264
-220
lines changed

Taskfile.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 3
33
vars:
44
NESTED_MODULES: api
55
API_DIRS: '{{.ROOT_DIR}}/api/v1alpha1/...'
6-
MANIFEST_OUT: '{{.ROOT_DIR}}/config/crd/bases'
6+
MANIFEST_OUT: '{{.ROOT_DIR}}/api/crds/manifests'
77
CODE_DIRS: '{{.ROOT_DIR}}/cmd/... {{.ROOT_DIR}}/internal/... {{.ROOT_DIR}}/api/v1alpha1/...'
88
COMPONENTS: 'cluster-provider-kind'
99
REPO_NAME: 'https://github.com/openmcp-project/cluster-provider-kind'

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.0.2-dev
1+
v0.0.3

api/crds/crds.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package crds
2+
3+
import (
4+
"embed"
5+
6+
apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
7+
8+
crdutil "github.com/openmcp-project/controller-utils/pkg/crds"
9+
)
10+
11+
//go:embed manifests
12+
var crdFiles embed.FS
13+
14+
func CRDs() ([]*apiextv1.CustomResourceDefinition, error) {
15+
return crdutil.CRDsFromFileSystem(crdFiles, "manifests")
16+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.18.0
7+
labels:
8+
openmcp.cloud/cluster: platform
9+
name: providerconfigs.kind.clusters.openmcp.cloud
10+
spec:
11+
group: kind.clusters.openmcp.cloud
12+
names:
13+
kind: ProviderConfig
14+
listKind: ProviderConfigList
15+
plural: providerconfigs
16+
singular: providerconfig
17+
scope: Cluster
18+
versions:
19+
- name: v1alpha1
20+
schema:
21+
openAPIV3Schema:
22+
description: ProviderConfig is the Schema for the ProviderConfig API.
23+
properties:
24+
apiVersion:
25+
description: |-
26+
APIVersion defines the versioned schema of this representation of an object.
27+
Servers should convert recognized schemas to the latest internal value, and
28+
may reject unrecognized values.
29+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
30+
type: string
31+
kind:
32+
description: |-
33+
Kind is a string value representing the REST resource this object represents.
34+
Servers may infer this from the endpoint the client submits requests to.
35+
Cannot be updated.
36+
In CamelCase.
37+
More 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: ProviderConfigSpec defines the desired state of ProviderConfig
43+
type: object
44+
status:
45+
description: ProviderConfigStatus defines the observed state of ProviderConfig
46+
type: object
47+
type: object
48+
served: true
49+
storage: true
50+
subresources:
51+
status: {}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package v1alpha1
2+
3+
import (
4+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5+
)
6+
7+
// ProviderConfigSpec defines the desired state of ProviderConfig
8+
type ProviderConfigSpec struct{}
9+
10+
// ProviderConfigStatus defines the observed state of ProviderConfig
11+
type ProviderConfigStatus struct{}
12+
13+
// ProviderConfig is the Schema for the ProviderConfig API.
14+
// +kubebuilder:object:root=true
15+
// +kubebuilder:subresource:status
16+
// +kubebuilder:resource:scope=Cluster
17+
// +kubebuilder:metadata:labels="openmcp.cloud/cluster=platform"
18+
type ProviderConfig struct {
19+
metav1.TypeMeta `json:",inline"`
20+
metav1.ObjectMeta `json:"metadata,omitempty"`
21+
22+
Spec ProviderConfigSpec `json:"spec,omitempty"`
23+
Status ProviderConfigStatus `json:"status,omitempty"`
24+
}
25+
26+
// +kubebuilder:object:root=true
27+
28+
// ProviderConfigList contains a list of ProviderConfig resources.
29+
type ProviderConfigList struct {
30+
metav1.TypeMeta `json:",inline"`
31+
metav1.ListMeta `json:"metadata,omitempty"`
32+
Items []ProviderConfig `json:"items"`
33+
}
34+
35+
func init() {
36+
SchemeBuilder.Register(&ProviderConfig{}, &ProviderConfigList{})
37+
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 98 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/cluster-provider-kind/embedded/crds/kind.clusters.openmcp.cloud_clusters.yaml

Lines changed: 0 additions & 144 deletions
This file was deleted.

0 commit comments

Comments
 (0)