Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
233b491
v1alpha2
65278 Oct 14, 2024
a0e8c31
cmd/main_test: s/v1alpha1/v1alpha2/g
wikkyk Aug 11, 2025
2b78211
readme: compat table for CAPMOX v1alpha2 and CAPI v1beta2
wikkyk Aug 11, 2025
aaf8eb0
delint
wikkyk Aug 12, 2025
2852b95
delint 2
wikkyk Aug 12, 2025
6880893
api/v1alpha1: remove storageversion
wikkyk Aug 12, 2025
d69fe82
api/v1alpha2: tests
wikkyk Aug 12, 2025
878025d
vmservice: fix TestReconcileBootstrapData_UpdateStatus
wikkyk Aug 13, 2025
ff884b3
vmservice: disable failing tests for now
wikkyk Aug 14, 2025
a192b48
cloudinit/network: fix render
wikkyk Aug 19, 2025
dea8436
ignition/network: fix render
wikkyk Aug 19, 2025
a85c404
vmservice, webhook: disable failing tests
wikkyk Aug 19, 2025
b3224e6
golangci: add kube-api-linter
wikkyk Aug 20, 2025
608e30b
golangci: exclude v1alpha1 from kubeapilinter
wikkyk Aug 21, 2025
faf4619
golangci: gocritic --fix
wikkyk Aug 25, 2025
eda5a94
golangci: only run KAL on api/v1alpha2
wikkyk Sep 3, 2025
4ba4987
lint
wikkyk Sep 16, 2025
e8ee3e5
kubeapilinter
wikkyk Aug 27, 2025
b83ba53
re-enable tests
wikkyk Nov 3, 2025
ff3755b
v1alpha2/proxmoxcluster_types_test: re-enable all tests
wikkyk Nov 4, 2025
13d818d
.github/workflow/lint: bump golangci-lint to v2.6.0
wikkyk Nov 4, 2025
3bca746
hack/tools: bump go to 1.24.6
wikkyk Nov 5, 2025
93c1263
re-enable more tests
wikkyk Nov 5, 2025
bccb790
TestReconcileBootstrapDataMissingNetworkConfig
wikkyk Nov 6, 2025
9f55591
make api pkg import consistent
wikkyk Nov 6, 2025
b32fed2
tweak TestGetCommonInterfaceConfig
wikkyk Nov 6, 2025
bf4533b
internal/service/vmservice/ip_test.go: add result testing for test dr…
65278 Nov 13, 2025
63915d5
WIP: use fieldSelectors to find IP Addresses per machine
65278 Nov 19, 2025
4e66b5d
WIP: fix ip_test.go into a working state
65278 Nov 20, 2025
bea26c0
WIP: vmservice/ip.go: cleanup
65278 Nov 20, 2025
092bcac
WIP vmservice/ip_test.go: fix/cleanup all enabled tests
65278 Nov 20, 2025
80bf134
TestReconcileIPAddresses_MultipleDevices
wikkyk Nov 21, 2025
c0a53ee
WIP: vmservice/ip_test.go: correctly requeue machine when creating ip…
65278 Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ jobs:
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: build kube-api-linter
run: go -C hack/tools build -buildmode=plugin -o ${{ github.workspace }}/bin/kube-api-linter.so sigs.k8s.io/kube-api-linter/pkg/plugin
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.1.6
version: v2.6.0
install-mode: goinstall
args: '--timeout 10m'

yamllint:
Expand Down
10 changes: 9 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ linters:
- govet
- importas
- ineffassign
- kubeapilinter
- loggercheck
- misspell
- nakedret
Expand All @@ -31,6 +32,11 @@ linters:
- unused
- whitespace
settings:
custom:
kubeapilinter:
path: bin/kube-api-linter.so
description: Kube API LInter lints Kube like APIs based on API conventions and best practices.
original-url: sigs.k8s.io/kube-api-linter
importas:
alias:
- pkg: k8s.io/api/(\w+)/(v[\w\d]+)
Expand Down Expand Up @@ -108,6 +114,9 @@ linters:
- linters:
- revive
text: 'var-naming: avoid meaningless package names'
- path-except: api/v1alpha2
linters:
- kubeapilinter
paths:
- zz_generated.*\.go$
- .*conversion.*\.go$
Expand All @@ -117,7 +126,6 @@ linters:
- examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gofmt
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ vet: ## Run go vet against code.

.PHONY: lint
lint: ## Run lint.
go -C $(TOOLS_DIR) build -buildmode=plugin -o $(LOCALBIN)/kube-api-linter.so sigs.k8s.io/kube-api-linter/pkg/plugin
go run -modfile ./hack/tools/go.mod github.com/golangci/golangci-lint/v2/cmd/golangci-lint run

# Package names to test
Expand Down
29 changes: 29 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,33 @@ resources:
kind: ProxmoxClusterTemplate
path: github.com/ionos-cloud/cluster-api-provider-proxmox/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: cluster.x-k8s.io
group: infrastructure
kind: ProxmoxMachine
path: github.com/ionos-cloud/cluster-api-provider-proxmox/api/v1alpha2
version: v1alpha2
- api:
crdVersion: v1
namespaced: true
controller: true
domain: cluster.x-k8s.io
group: infrastructure
kind: ProxmoxCluster
path: github.com/ionos-cloud/cluster-api-provider-proxmox/api/v1alpha2
version: v1alpha2
webhooks:
defaulting: true
validation: true
webhookVersion: v2
- api:
crdVersion: v1
namespaced: true
domain: cluster.x-k8s.io
group: infrastructure
kind: ProxmoxMachineTemplate
path: github.com/ionos-cloud/cluster-api-provider-proxmox/api/v1alpha2
version: v1alpha2
version: "3"
30 changes: 21 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,27 @@ Check out the [quickstart guide](./docs/Usage.md#quick-start) for launching a cl
## Compatibility with Cluster API and Kubernetes Versions
This provider's versions are compatible with the following versions of Cluster API:

| | Cluster API v1beta1 (v1.4) | Cluster API v1beta1 (v1.5) | Cluster API v1beta1 (v1.6) | Cluster API v1beta1 (v1.7) | Cluster API v1beta1 (v1.8) | Cluster API v1beta1 (v1.9) |
|------------------------|:--------------------------:|:--------------------------:|:--------------------------:|:--------------------------:|:--------------------------:|:--------------------------:|
| CAPMOX v1alpha1 (v0.1) | ✓ | ✓ | ☓ | ☓ | ☓ | ☓ |
| CAPMOX v1alpha1 (v0.2) | ☓ | ✓ | ✓ | ☓ | ☓ | ☓ |
| CAPMOX v1alpha1 (v0.3) | ☓ | ✓ | ✓ | ✓ | ☓ | ☓ |
| CAPMOX v1alpha1 (v0.4) | ☓ | ✓ | ✓ | ✓ | ☓ | ☓ |
| CAPMOX v1alpha1 (v0.5) | ☓ | ☓ | ✓ | ✓ | ☓ | ☓ |
| CAPMOX v1alpha1 (v0.6) | ☓ | ☓ | ☓ | ✓ | ✓ | ☓ |
| CAPMOX v1alpha1 (v0.7) | ☓ | ☓ | ☓ | ☓ | ✓ | ✓ |
### CAPMOX v1alpha2 (current)

Cluster API v1beta2

| | CAPI v1.11 |
|-------------|:----------:|
| CAPMOX v0.8 | ✓ |

### CAPMOX v1alpha1 (obsolete)

Cluster API v1beta1

| | CAPI v1.4 | CAPI v1.5 | CAPI v1.6 | CAPI v1.7 | CAPI v1.8 | CAPI v1.9 | CAPI v1.10 |
|-------------|:---------:|:---------:|:---------:|:---------:|:---------:|:---------:|:----------:|
| CAPMOX v0.1 | ✓ | ✓ | ☓ | ☓ | ☓ | ☓ | ☓ |
| CAPMOX v0.2 | ☓ | ✓ | ✓ | ☓ | ☓ | ☓ | ☓ |
| CAPMOX v0.3 | ☓ | ✓ | ✓ | ✓ | ☓ | ☓ | ☓ |
| CAPMOX v0.4 | ☓ | ✓ | ✓ | ✓ | ☓ | ☓ | ☓ |
| CAPMOX v0.5 | ☓ | ☓ | ✓ | ✓ | ☓ | ☓ | ☓ |
| CAPMOX v0.6 | ☓ | ☓ | ☓ | ✓ | ✓ | ☓ | ☓ |
| CAPMOX v0.7 | ☓ | ☓ | ☓ | ☓ | ✓ | ✓ | ✓ |

(See [Kubernetes support matrix](https://cluster-api.sigs.k8s.io/reference/versions.html) of Cluster API versions).

Expand Down
1 change: 0 additions & 1 deletion api/v1alpha1/proxmoxclustertemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ type ProxmoxClusterTemplateResource struct {
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=proxmoxclustertemplates,scope=Namespaced,categories=cluster-api,shortName=pct
// +kubebuilder:storageversion

// ProxmoxClusterTemplate is the Schema for the proxmoxclustertemplates API.
type ProxmoxClusterTemplate struct {
Expand Down
1 change: 0 additions & 1 deletion api/v1alpha1/proxmoxmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ type MetadataSettings struct {
}

// +kubebuilder:object:root=true
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=proxmoxmachines,scope=Namespaced,categories=cluster-api;proxmox,shortName=moxm
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this ProxmoxMachine belongs"
Expand Down
1 change: 0 additions & 1 deletion api/v1alpha1/proxmoxmachinetemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type ProxmoxMachineTemplateSpec struct {

// +kubebuilder:object:root=true
// +kubebuilder:resource:path=proxmoxmachinetemplates,scope=Namespaced,categories=cluster-api,shortName=pmt
// +kubebuilder:storageversion

// ProxmoxMachineTemplate is the Schema for the proxmoxmachinetemplates API.
type ProxmoxMachineTemplate struct {
Expand Down
93 changes: 93 additions & 0 deletions api/v1alpha2/conditions_consts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
Copyright 2023 IONOS Cloud.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha2

import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"

const (
// VMProvisionedCondition documents the status of the provisioning of a ProxmoxMachine and its underlying ProxmoxVM.
VMProvisionedCondition clusterv1.ConditionType = "VMProvisioned"

// VMProvisionFailedReason used for failures during instance provisioning.
VMProvisionFailedReason = "VMProvisionFailed"

// VMTerminatedReason used when vm is being terminated.
VMTerminatedReason = "VMTerminated"

// WaitingForClusterInfrastructureReason (Severity=Info) documents a ProxmoxMachine waiting for the cluster
// infrastructure to be ready before starting the provisioning process.
//
// NOTE: This reason does not apply to ProxmoxVM (this state happens before the ProxmoxVM is actually created).
WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure"

// WaitingForBootstrapDataReason (Severity=Info) documents a ProxmoxMachine waiting for the bootstrap
// script to be ready before starting the provisioning process.
//
// NOTE: This reason does not apply to ProxmoxVM (this state happens before the ProxmoxVM is actually created).
WaitingForBootstrapDataReason = "WaitingForBootstrapData"

// WaitingForStaticIPAllocationReason (Severity=Info) documents a ProxmoxVM waiting for the allocation of
// a static IP address.
WaitingForStaticIPAllocationReason = "WaitingForStaticIPAllocation"

// CloningReason documents (Severity=Info) a ProxmoxMachine/ProxmoxVM currently executing the clone operation.
CloningReason = "Cloning"

// CloningFailedReason (Severity=Warning) documents a ProxmoxMachine/ProxmoxVM controller detecting
// an error while provisioning; those kind of errors are usually transient and failed provisioning
// are automatically re-tried by the controller.
CloningFailedReason = "CloningFailed"

// PoweringOnReason documents (Severity=Info) a ProxmoxMachine/ProxmoxVM currently executing the power on sequence.
PoweringOnReason = "PoweringOn"

// PoweringOnFailedReason (Severity=Warning) documents a ProxmoxMachine/ProxmoxVM controller detecting
// an error while powering on; those kind of errors are usually transient and failed provisioning
// are automatically re-tried by the controller.
PoweringOnFailedReason = "PoweringOnFailed"

// VMProvisionStarted used for starting vm provisioning.
VMProvisionStarted = "VMProvisionStarted"

// TaskFailure (Severity=Warning) documents a ProxmoxMachine/Proxmox task failure; the reconcile look will automatically
// retry the operation, but a user intervention might be required to fix the problem.
TaskFailure = "TaskFailure"

// WaitingForNetworkAddressesReason (Severity=Info) documents a ProxmoxMachine waiting for the the machine network
// settings to be reported after machine being powered on.
//
// NOTE: This reason does not apply to ProxmoxVM (this state happens after the ProxmoxVM is in ready state).
WaitingForNetworkAddressesReason = "WaitingForNetworkAddresses"

// NotFoundReason (Severity=Warning) documents the ProxmoxVM not found.
NotFoundReason = "NotFound"

// UnknownReason (Severity=Warning) documents the ProxmoxVM Unknown.
UnknownReason = "Unknown"

// MissingControlPlaneEndpointReason (Severity=Warning) documents the missing Control Plane endpoint when Cluster is backed by an externally managed Control Plane.
MissingControlPlaneEndpointReason = "MissingControlPlaneEndpoint"
)

const (
// ProxmoxClusterReady documents the status of ProxmoxCluster and its underlying resources.
ProxmoxClusterReady clusterv1.ConditionType = "ClusterReady"

// ProxmoxUnreachableReason (Severity=Error) documents a controller detecting
// issues with Proxmox reachability.
ProxmoxUnreachableReason = "ProxmoxUnreachable"
)
49 changes: 49 additions & 0 deletions api/v1alpha2/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
Copyright 2023-2024 IONOS Cloud.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha2 contains API Schema definitions for the infrastructure v1alpha2 API group
// +kubebuilder:object:generate=true
// +groupName=infrastructure.cluster.x-k8s.io
package v1alpha2

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)

var (
// GroupVersion is group version used to register these objects.
GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha2"}

// schemeBuilder is used to add go types to the GroupVersionKind scheme.
schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = schemeBuilder.AddToScheme

// In order to reduce dependencies for API package consumers, CAPI has diverged from the default kubebuilder scheme builder.
// This new pattern may also be useful for reducing dependencies in provider API packages.
// For more information see the implementers guide.
// https://main.cluster-api.sigs.k8s.io/developer/providers/implementers-guide/create_api#registering-apis-in-the-scheme
objectTypes = []runtime.Object{}
)

func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(GroupVersion, objectTypes...)
metav1.AddToGroupVersion(scheme, GroupVersion)
return nil
}
Loading
Loading