Skip to content

Commit e91d60b

Browse files
committed
feat: Conditions for OpenStackMachine
1 parent 96ee54a commit e91d60b

14 files changed

+344
-4
lines changed

api/v1alpha3/openstackmachine_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package v1alpha3
1919
import (
2020
corev1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
2223
"sigs.k8s.io/cluster-api/errors"
2324
)
2425

@@ -125,6 +126,8 @@ type OpenStackMachineStatus struct {
125126
// controller's output.
126127
// +optional
127128
FailureMessage *string `json:"errorMessage,omitempty"`
129+
130+
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
128131
}
129132

130133
// +kubebuilder:object:root=true

api/v1alpha3/zz_generated.conversion.go

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

api/v1alpha3/zz_generated.deepcopy.go

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

api/v1alpha4/openstackmachine_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package v1alpha4
1919
import (
2020
corev1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
2223
"sigs.k8s.io/cluster-api/errors"
2324
)
2425

@@ -125,6 +126,8 @@ type OpenStackMachineStatus struct {
125126
// controller's output.
126127
// +optional
127128
FailureMessage *string `json:"errorMessage,omitempty"`
129+
130+
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
128131
}
129132

130133
// +kubebuilder:object:root=true

api/v1alpha4/zz_generated.conversion.go

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

api/v1alpha4/zz_generated.deepcopy.go

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

api/v1alpha5/openstackmachine_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package v1alpha5
1919
import (
2020
corev1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
2223
"sigs.k8s.io/cluster-api/errors"
2324
)
2425

@@ -129,6 +130,8 @@ type OpenStackMachineStatus struct {
129130
// controller's output.
130131
// +optional
131132
FailureMessage *string `json:"failureMessage,omitempty"`
133+
134+
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
132135
}
133136

134137
// +kubebuilder:object:root=true

api/v1alpha5/zz_generated.conversion.go

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

api/v1alpha5/zz_generated.deepcopy.go

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

api/v1alpha6/conditions_consts.go

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
Copyright 2022 The Kubernetes Authors.
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 v1alpha6
18+
19+
import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
20+
21+
const (
22+
// InstanceReadyCondition reports on current status of the OpenStack instance. Ready indicates the instance is in a Running state.
23+
InstanceReadyCondition clusterv1.ConditionType = "InstanceReady"
24+
25+
// WaitingForClusterInfrastructureReason used when machine is waiting for cluster infrastructure to be ready before proceeding.
26+
WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure"
27+
// WaitingForBootstrapDataReason used when machine is waiting for bootstrap data to be ready before proceeding.
28+
WaitingForBootstrapDataReason = "WaitingForBootstrapData"
29+
// InvalidMachineSpecReason used when the machine spec is invalid.
30+
InvalidMachineSpecReason = "InvalidMachineSpec"
31+
// InstanceCreateFailedReason used when creating the instance failed.
32+
InstanceCreateFailedReason = "InstanceCreateFailed"
33+
// InstanceNotFoundReason used when the instance couldn't be retrieved.
34+
InstanceNotFoundReason = "InstanceNotFound"
35+
// InstanceStateErrorReason used when the instance is in error state.
36+
InstanceStateErrorReason = "InstanceStateError"
37+
// InstanceDeletedReason used when the instance is in a deleted state.
38+
InstanceDeletedReason = "InstanceDeleted"
39+
// InstanceNotReadyReason used when the instance is in a pending state.
40+
InstanceNotReadyReason = "InstanceNotReady"
41+
// InstanceDeleteFailedReason used when deleting the instance failed.
42+
InstanceDeleteFailedReason = "InstanceDeleteFailed"
43+
)
44+
45+
const (
46+
// APIServerIngressReadyCondition reports on the current status of the network ingress (Loadbalancer, Floating IP) for Control Plane machines. Ready indicates that the instance can receive requests.
47+
APIServerIngressReadyCondition clusterv1.ConditionType = "APIServerIngressReadyCondition"
48+
49+
// LoadBalancerMemberErrorReason used when the instance could not be added as a loadbalancer member.
50+
LoadBalancerMemberErrorReason = "LoadBalancerMemberError"
51+
// FloatingIPErrorReason used when the floating ip could not be created or attached.
52+
FloatingIPErrorReason = "FloatingIPError"
53+
)

0 commit comments

Comments
 (0)