Skip to content

Commit cdedf3c

Browse files
65278wikkyk
andcommitted
v1alpha2
Co-authored-by: Vic Kerr <[email protected]>
1 parent ba0b1ad commit cdedf3c

File tree

65 files changed

+7035
-949
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+7035
-949
lines changed

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ linters:
117117
- examples$
118118
issues:
119119
max-issues-per-linter: 0
120-
max-same-issues: 0
121120
formatters:
122121
enable:
123122
- gofmt

PROJECT

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,33 @@ resources:
5050
kind: ProxmoxClusterTemplate
5151
path: github.com/ionos-cloud/cluster-api-provider-proxmox/api/v1alpha1
5252
version: v1alpha1
53+
- api:
54+
crdVersion: v1
55+
namespaced: true
56+
domain: cluster.x-k8s.io
57+
group: infrastructure
58+
kind: ProxmoxMachine
59+
path: github.com/ionos-cloud/cluster-api-provider-proxmox/api/v1alpha2
60+
version: v1alpha2
61+
- api:
62+
crdVersion: v1
63+
namespaced: true
64+
controller: true
65+
domain: cluster.x-k8s.io
66+
group: infrastructure
67+
kind: ProxmoxCluster
68+
path: github.com/ionos-cloud/cluster-api-provider-proxmox/api/v1alpha2
69+
version: v1alpha2
70+
webhooks:
71+
defaulting: true
72+
validation: true
73+
webhookVersion: v2
74+
- api:
75+
crdVersion: v1
76+
namespaced: true
77+
domain: cluster.x-k8s.io
78+
group: infrastructure
79+
kind: ProxmoxMachineTemplate
80+
path: github.com/ionos-cloud/cluster-api-provider-proxmox/api/v1alpha2
81+
version: v1alpha2
5382
version: "3"

api/v1alpha2/conditions_consts.go

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
Copyright 2023 IONOS Cloud.
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 v1alpha2
18+
19+
import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
20+
21+
const (
22+
// VMProvisionedCondition documents the status of the provisioning of a ProxmoxMachine and its underlying ProxmoxVM.
23+
VMProvisionedCondition clusterv1.ConditionType = "VMProvisioned"
24+
25+
// VMProvisionFailedReason used for failures during instance provisioning.
26+
VMProvisionFailedReason = "VMProvisionFailed"
27+
28+
// VMTerminatedReason used when vm is being terminated.
29+
VMTerminatedReason = "VMTerminated"
30+
31+
// WaitingForClusterInfrastructureReason (Severity=Info) documents a ProxmoxMachine waiting for the cluster
32+
// infrastructure to be ready before starting the provisioning process.
33+
//
34+
// NOTE: This reason does not apply to ProxmoxVM (this state happens before the ProxmoxVM is actually created).
35+
WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure"
36+
37+
// WaitingForBootstrapDataReason (Severity=Info) documents a ProxmoxMachine waiting for the bootstrap
38+
// script to be ready before starting the provisioning process.
39+
//
40+
// NOTE: This reason does not apply to ProxmoxVM (this state happens before the ProxmoxVM is actually created).
41+
WaitingForBootstrapDataReason = "WaitingForBootstrapData"
42+
43+
// WaitingForStaticIPAllocationReason (Severity=Info) documents a ProxmoxVM waiting for the allocation of
44+
// a static IP address.
45+
WaitingForStaticIPAllocationReason = "WaitingForStaticIPAllocation"
46+
47+
// CloningReason documents (Severity=Info) a ProxmoxMachine/ProxmoxVM currently executing the clone operation.
48+
CloningReason = "Cloning"
49+
50+
// CloningFailedReason (Severity=Warning) documents a ProxmoxMachine/ProxmoxVM controller detecting
51+
// an error while provisioning; those kind of errors are usually transient and failed provisioning
52+
// are automatically re-tried by the controller.
53+
CloningFailedReason = "CloningFailed"
54+
55+
// PoweringOnReason documents (Severity=Info) a ProxmoxMachine/ProxmoxVM currently executing the power on sequence.
56+
PoweringOnReason = "PoweringOn"
57+
58+
// PoweringOnFailedReason (Severity=Warning) documents a ProxmoxMachine/ProxmoxVM controller detecting
59+
// an error while powering on; those kind of errors are usually transient and failed provisioning
60+
// are automatically re-tried by the controller.
61+
PoweringOnFailedReason = "PoweringOnFailed"
62+
63+
// VMProvisionStarted used for starting vm provisioning.
64+
VMProvisionStarted = "VMProvisionStarted"
65+
66+
// TaskFailure (Severity=Warning) documents a ProxmoxMachine/Proxmox task failure; the reconcile look will automatically
67+
// retry the operation, but a user intervention might be required to fix the problem.
68+
TaskFailure = "TaskFailure"
69+
70+
// WaitingForNetworkAddressesReason (Severity=Info) documents a ProxmoxMachine waiting for the the machine network
71+
// settings to be reported after machine being powered on.
72+
//
73+
// NOTE: This reason does not apply to ProxmoxVM (this state happens after the ProxmoxVM is in ready state).
74+
WaitingForNetworkAddressesReason = "WaitingForNetworkAddresses"
75+
76+
// NotFoundReason (Severity=Warning) documents the ProxmoxVM not found.
77+
NotFoundReason = "NotFound"
78+
79+
// UnknownReason (Severity=Warning) documents the ProxmoxVM Unknown.
80+
UnknownReason = "Unknown"
81+
82+
// MissingControlPlaneEndpointReason (Severity=Warning) documents the missing Control Plane endpoint when Cluster is backed by an externally managed Control Plane.
83+
MissingControlPlaneEndpointReason = "MissingControlPlaneEndpoint"
84+
)
85+
86+
const (
87+
// ProxmoxClusterReady documents the status of ProxmoxCluster and its underlying resources.
88+
ProxmoxClusterReady clusterv1.ConditionType = "ClusterReady"
89+
90+
// ProxmoxUnreachableReason (Severity=Error) documents a controller detecting
91+
// issues with Proxmox reachability.
92+
ProxmoxUnreachableReason = "ProxmoxUnreachable"
93+
)

api/v1alpha2/groupversion_info.go

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
Copyright 2023-2024 IONOS Cloud.
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 v1alpha2 contains API Schema definitions for the infrastructure v1alpha2 API group
18+
// +kubebuilder:object:generate=true
19+
// +groupName=infrastructure.cluster.x-k8s.io
20+
package v1alpha2
21+
22+
import (
23+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24+
"k8s.io/apimachinery/pkg/runtime"
25+
"k8s.io/apimachinery/pkg/runtime/schema"
26+
"sigs.k8s.io/controller-runtime/pkg/scheme"
27+
)
28+
29+
var (
30+
// GroupVersion is group version used to register these objects
31+
GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha2"}
32+
33+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
34+
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
35+
36+
// AddToScheme adds the types in this group-version to the given scheme.
37+
AddToScheme = SchemeBuilder.AddToScheme
38+
39+
// In order to reduce dependencies for API package consumers, CAPI has diverged from the default kubebuilder scheme builder.
40+
// This new pattern may also be useful for reducing dependencies in provider API packages.
41+
// For more information see the implementers guide.
42+
// https://main.cluster-api.sigs.k8s.io/developer/providers/implementers-guide/create_api#registering-apis-in-the-scheme
43+
objectTypes = []runtime.Object{}
44+
)
45+
46+
func addKnownTypes(scheme *runtime.Scheme) error {
47+
scheme.AddKnownTypes(GroupVersion, objectTypes...)
48+
metav1.AddToGroupVersion(scheme, GroupVersion)
49+
return nil
50+
}

0 commit comments

Comments
 (0)