Skip to content

Commit b0ad3b6

Browse files
committed
add new LinodeClusterTemplate and LinodeMachineTemplate types
1 parent fb2b611 commit b0ad3b6

18 files changed

+783
-0
lines changed

PROJECT

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,18 @@ resources:
2626
kind: LinodeMachine
2727
path: github.com/linode/cluster-api-provider-linode/api/v1alpha1
2828
version: v1alpha1
29+
- api:
30+
crdVersion: v1
31+
namespaced: true
32+
domain: cluster.x-k8s.io
33+
kind: LinodeClusterTemplate
34+
path: github.com/linode/cluster-api-provider-linode/api/v1alpha1
35+
version: v1alpha1
36+
- api:
37+
crdVersion: v1
38+
namespaced: true
39+
domain: cluster.x-k8s.io
40+
kind: LinodeMachineTemplate
41+
path: github.com/linode/cluster-api-provider-linode/api/v1alpha1
42+
version: v1alpha1
2943
version: "3"
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
Copyright 2023 Akamai Technologies, Inc.
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 v1alpha1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// LinodeClusterTemplateSpec defines the desired state of LinodeClusterTemplate
24+
type LinodeClusterTemplateSpec struct {
25+
Template LinodeClusterTemplateResource `json:"template"`
26+
}
27+
28+
// LinodeClusterTemplateResource describes the data needed to create a LinodeCluster from a template.
29+
type LinodeClusterTemplateResource struct {
30+
Spec LinodeClusterSpec `json:"spec"`
31+
}
32+
33+
// +kubebuilder:object:root=true
34+
// +kubebuilder:resource:path=linodeclustertemplates,scope=Namespaced,categories=cluster-api,shortName=lct
35+
36+
// LinodeClusterTemplate is the Schema for the linodeclustertemplates API
37+
type LinodeClusterTemplate struct {
38+
metav1.TypeMeta `json:",inline"`
39+
metav1.ObjectMeta `json:"metadata,omitempty"`
40+
41+
Spec LinodeClusterTemplateSpec `json:"spec,omitempty"`
42+
}
43+
44+
//+kubebuilder:object:root=true
45+
46+
// LinodeClusterTemplateList contains a list of LinodeClusterTemplate
47+
type LinodeClusterTemplateList struct {
48+
metav1.TypeMeta `json:",inline"`
49+
metav1.ListMeta `json:"metadata,omitempty"`
50+
Items []LinodeClusterTemplate `json:"items"`
51+
}
52+
53+
func init() {
54+
SchemeBuilder.Register(&LinodeClusterTemplate{}, &LinodeClusterTemplateList{})
55+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
Copyright 2023 Akamai Technologies, Inc.
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 v1alpha1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// LinodeMachineTemplateSpec defines the desired state of LinodeMachineTemplate
24+
type LinodeMachineTemplateSpec struct {
25+
Template LinodeMachineTemplateResource `json:"template"`
26+
}
27+
28+
// LinodeMachineTemplateResource describes the data needed to create a LinodeMachine from a template.
29+
type LinodeMachineTemplateResource struct {
30+
Spec LinodeMachineSpec `json:"spec"`
31+
}
32+
33+
// +kubebuilder:object:root=true
34+
// +kubebuilder:resource:path=linodemachinetemplates,scope=Namespaced,categories=cluster-api,shortName=lmt
35+
36+
// LinodeMachineTemplate is the Schema for the linodemachinetemplates API
37+
type LinodeMachineTemplate struct {
38+
metav1.TypeMeta `json:",inline"`
39+
metav1.ObjectMeta `json:"metadata,omitempty"`
40+
41+
Spec LinodeMachineTemplateSpec `json:"spec,omitempty"`
42+
}
43+
44+
//+kubebuilder:object:root=true
45+
46+
// LinodeMachineTemplateList contains a list of LinodeMachineTemplate
47+
type LinodeMachineTemplateList struct {
48+
metav1.TypeMeta `json:",inline"`
49+
metav1.ListMeta `json:"metadata,omitempty"`
50+
Items []LinodeMachineTemplate `json:"items"`
51+
}
52+
53+
func init() {
54+
SchemeBuilder.Register(&LinodeMachineTemplate{}, &LinodeMachineTemplateList{})
55+
}

api/v1alpha1/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)