Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit f1daad8

Browse files
committed
Generate Cluster and Machine resources
1 parent 5dca365 commit f1daad8

26 files changed

+889
-0
lines changed

PROJECT

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,23 @@ layout:
77
- go.kubebuilder.io/v3
88
projectName: cluster-api-provider-scaleway
99
repo: github.com/Tomy2e/cluster-api-provider-scaleway
10+
resources:
11+
- api:
12+
crdVersion: v1
13+
namespaced: true
14+
controller: true
15+
domain: cluster.x-k8s.io
16+
group: infrastructure
17+
kind: ScalewayCluster
18+
path: github.com/Tomy2e/cluster-api-provider-scaleway/api/v1beta1
19+
version: v1beta1
20+
- api:
21+
crdVersion: v1
22+
namespaced: true
23+
controller: true
24+
domain: cluster.x-k8s.io
25+
group: infrastructure
26+
kind: ScalewayMachine
27+
path: github.com/Tomy2e/cluster-api-provider-scaleway/api/v1beta1
28+
version: v1beta1
1029
version: "3"

api/v1beta1/groupversion_info.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Package v1beta1 contains API Schema definitions for the infrastructure v1beta1 API group
2+
// +kubebuilder:object:generate=true
3+
// +groupName=infrastructure.cluster.x-k8s.io
4+
package v1beta1
5+
6+
import (
7+
"k8s.io/apimachinery/pkg/runtime/schema"
8+
"sigs.k8s.io/controller-runtime/pkg/scheme"
9+
)
10+
11+
var (
12+
// GroupVersion is group version used to register these objects
13+
GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta1"}
14+
15+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
16+
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
17+
18+
// AddToScheme adds the types in this group-version to the given scheme.
19+
AddToScheme = SchemeBuilder.AddToScheme
20+
)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package v1beta1
2+
3+
import (
4+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5+
)
6+
7+
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
8+
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
9+
10+
// ScalewayClusterSpec defines the desired state of ScalewayCluster
11+
type ScalewayClusterSpec struct {
12+
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
13+
// Important: Run "make" to regenerate code after modifying this file
14+
15+
// Foo is an example field of ScalewayCluster. Edit scalewaycluster_types.go to remove/update
16+
Foo string `json:"foo,omitempty"`
17+
}
18+
19+
// ScalewayClusterStatus defines the observed state of ScalewayCluster
20+
type ScalewayClusterStatus struct {
21+
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
22+
// Important: Run "make" to regenerate code after modifying this file
23+
}
24+
25+
//+kubebuilder:object:root=true
26+
//+kubebuilder:subresource:status
27+
28+
// ScalewayCluster is the Schema for the scalewayclusters API
29+
type ScalewayCluster struct {
30+
metav1.TypeMeta `json:",inline"`
31+
metav1.ObjectMeta `json:"metadata,omitempty"`
32+
33+
Spec ScalewayClusterSpec `json:"spec,omitempty"`
34+
Status ScalewayClusterStatus `json:"status,omitempty"`
35+
}
36+
37+
//+kubebuilder:object:root=true
38+
39+
// ScalewayClusterList contains a list of ScalewayCluster
40+
type ScalewayClusterList struct {
41+
metav1.TypeMeta `json:",inline"`
42+
metav1.ListMeta `json:"metadata,omitempty"`
43+
Items []ScalewayCluster `json:"items"`
44+
}
45+
46+
func init() {
47+
SchemeBuilder.Register(&ScalewayCluster{}, &ScalewayClusterList{})
48+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package v1beta1
2+
3+
import (
4+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5+
)
6+
7+
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
8+
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
9+
10+
// ScalewayMachineSpec defines the desired state of ScalewayMachine
11+
type ScalewayMachineSpec struct {
12+
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
13+
// Important: Run "make" to regenerate code after modifying this file
14+
15+
// Foo is an example field of ScalewayMachine. Edit scalewaymachine_types.go to remove/update
16+
Foo string `json:"foo,omitempty"`
17+
}
18+
19+
// ScalewayMachineStatus defines the observed state of ScalewayMachine
20+
type ScalewayMachineStatus struct {
21+
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
22+
// Important: Run "make" to regenerate code after modifying this file
23+
}
24+
25+
//+kubebuilder:object:root=true
26+
//+kubebuilder:subresource:status
27+
28+
// ScalewayMachine is the Schema for the scalewaymachines API
29+
type ScalewayMachine struct {
30+
metav1.TypeMeta `json:",inline"`
31+
metav1.ObjectMeta `json:"metadata,omitempty"`
32+
33+
Spec ScalewayMachineSpec `json:"spec,omitempty"`
34+
Status ScalewayMachineStatus `json:"status,omitempty"`
35+
}
36+
37+
//+kubebuilder:object:root=true
38+
39+
// ScalewayMachineList contains a list of ScalewayMachine
40+
type ScalewayMachineList struct {
41+
metav1.TypeMeta `json:",inline"`
42+
metav1.ListMeta `json:"metadata,omitempty"`
43+
Items []ScalewayMachine `json:"items"`
44+
}
45+
46+
func init() {
47+
SchemeBuilder.Register(&ScalewayMachine{}, &ScalewayMachineList{})
48+
}

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 188 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.11.1
7+
creationTimestamp: null
8+
name: scalewayclusters.infrastructure.cluster.x-k8s.io
9+
spec:
10+
group: infrastructure.cluster.x-k8s.io
11+
names:
12+
kind: ScalewayCluster
13+
listKind: ScalewayClusterList
14+
plural: scalewayclusters
15+
singular: scalewaycluster
16+
scope: Namespaced
17+
versions:
18+
- name: v1beta1
19+
schema:
20+
openAPIV3Schema:
21+
description: ScalewayCluster is the Schema for the scalewayclusters API
22+
properties:
23+
apiVersion:
24+
description: 'APIVersion defines the versioned schema of this representation
25+
of an object. Servers should convert recognized schemas to the latest
26+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
27+
type: string
28+
kind:
29+
description: 'Kind is a string value representing the REST resource this
30+
object represents. Servers may infer this from the endpoint the client
31+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
32+
type: string
33+
metadata:
34+
type: object
35+
spec:
36+
description: ScalewayClusterSpec defines the desired state of ScalewayCluster
37+
properties:
38+
foo:
39+
description: Foo is an example field of ScalewayCluster. Edit scalewaycluster_types.go
40+
to remove/update
41+
type: string
42+
type: object
43+
status:
44+
description: ScalewayClusterStatus defines the observed state of ScalewayCluster
45+
type: object
46+
type: object
47+
served: true
48+
storage: true
49+
subresources:
50+
status: {}

0 commit comments

Comments
 (0)