Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
mkdir -p coverprofiles
make test
- name: Push to coveralls.io
continue-on-error: true
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |-
Expand Down
10 changes: 6 additions & 4 deletions api/v1alpha1/condition_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ limitations under the License.

package v1alpha1

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

// Conditions and condition Reasons for the KubevirtMachine object

const (
// VMProvisionedCondition documents the status of the provisioning of the VM
// generated by a KubevirtMachine.
VMProvisionedCondition = "VMProvisioned"
VMProvisionedCondition clusterv1.ConditionType = "VMProvisioned"

// WaitingForClusterInfrastructureReason (Severity=Info) documents a KubevirtMachine waiting for the cluster
// infrastructure to be ready before starting to create the container that provides the KubevirtMachine
Expand All @@ -37,15 +39,15 @@ const (
VMCreateFailedReason = "VMCreateFailed"

// VMLiveMigratableCondition documents whether the VM is live-migratable or not
VMLiveMigratableCondition = "VMLiveMigratable"
VMLiveMigratableCondition clusterv1.ConditionType = "VMLiveMigratable"
)

const (
// BootstrapExecSucceededCondition provides an observation of the KubevirtMachine bootstrap process.
// It is set based on successful execution of bootstrap commands and on the existence of
// the /run/cluster-api/bootstrap-success.complete file.
// The condition gets generated after VMProvisionedCondition is True.
BootstrapExecSucceededCondition = "BootstrapExecSucceeded"
BootstrapExecSucceededCondition clusterv1.ConditionType = "BootstrapExecSucceeded"

// BootstrappingReason documents (Severity=Info) a KubevirtMachine currently executing the bootstrap
// script that creates the Kubernetes node on the newly provisioned machine infrastructure.
Expand All @@ -61,7 +63,7 @@ const (

const (
// LoadBalancerAvailableCondition documents the availability of the service that implements the cluster load balancer.
LoadBalancerAvailableCondition = "LoadBalancerAvailable"
LoadBalancerAvailableCondition clusterv1.ConditionType = "LoadBalancerAvailable"

// LoadBalancerProvisioningFailedReason (Severity=Warning) documents a KubevirtCluster controller detecting
// an error while provisioning the service that provides the cluster load balancer; those kind of
Expand Down
10 changes: 5 additions & 5 deletions api/v1alpha1/kubevirtcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint SA1019
)

const (
Expand Down Expand Up @@ -74,11 +74,11 @@ type KubevirtClusterStatus struct {

// FailureDomains don't mean much in CAPD since it's all local, but we can see how the rest of cluster API
// will use this if we populate it.
FailureDomains []clusterv1.FailureDomain `json:"failureDomains,omitempty"`
FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"`

// Conditions defines current service state of the KubevirtCluster.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
Conditions []clusterv1.Condition `json:"conditions,omitempty"`
}

// APIEndpoint represents a reachable Kubernetes API endpoint.
Expand Down Expand Up @@ -140,11 +140,11 @@ type KubevirtCluster struct {
Status KubevirtClusterStatus `json:"status,omitempty"`
}

func (c *KubevirtCluster) GetConditions() []metav1.Condition {
func (c *KubevirtCluster) GetConditions() clusterv1.Conditions {
return c.Status.Conditions
}

func (c *KubevirtCluster) SetConditions(conditions []metav1.Condition) {
func (c *KubevirtCluster) SetConditions(conditions clusterv1.Conditions) {
c.Status.Conditions = conditions
}

Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/kubevirtclustertemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint SA1019
)

// KubevirtClusterTemplateResource describes the data needed to create a KubevirtCluster from a template.
Expand Down
11 changes: 6 additions & 5 deletions api/v1alpha1/kubevirtmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubevirtv1 "kubevirt.io/api/core/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint SA1019
"sigs.k8s.io/cluster-api/errors" //nolint SA1019
)

const (
Expand Down Expand Up @@ -84,7 +85,7 @@ type KubevirtMachineStatus struct {

// Conditions defines current service state of the KubevirtMachine.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
Conditions clusterv1.Conditions `json:"conditions,omitempty"`

// NodeUpdated denotes that the ProviderID is updated on Node of this KubevirtMachine
// +optional
Expand All @@ -107,7 +108,7 @@ type KubevirtMachineStatus struct {
// can be added as events to the Machine object and/or logged in the
// controller's output.
// +optional
FailureReason string `json:"failureReason,omitempty"`
FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"`

// FailureMessage will be set in the event that there is a terminal problem
// reconciling the Machine and will contain a more verbose string suitable
Expand Down Expand Up @@ -145,11 +146,11 @@ type KubevirtMachine struct {
Status KubevirtMachineStatus `json:"status,omitempty"`
}

func (c *KubevirtMachine) GetConditions() []metav1.Condition {
func (c *KubevirtMachine) GetConditions() clusterv1.Conditions {
return c.Status.Conditions
}

func (c *KubevirtMachine) SetConditions(conditions []metav1.Condition) {
func (c *KubevirtMachine) SetConditions(conditions clusterv1.Conditions) {
c.Status.Conditions = conditions
}

Expand Down
21 changes: 13 additions & 8 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -190,67 +190,59 @@ spec:
conditions:
description: Conditions defines current service state of the KubevirtCluster.
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
description: Condition defines an observation of a Cluster API resource
operational state.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
This should be when the underlying condition changed. If that is not known, then using the time when
the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
This field may be empty.
maxLength: 10240
minLength: 1
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
reason is the reason for the condition's last transition in CamelCase.
The specific API may choose whether or not this field is considered a guaranteed API.
This field may be empty.
maxLength: 256
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
severity:
description: |-
severity provides an explicit classification of Reason code, so the users or machines can immediately
understand the current situation and act accordingly.
The Severity field MUST be set only when Status=False.
maxLength: 32
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
can be useful (see .node.status.conditions), the ability to deconflict is important.
maxLength: 256
minLength: 1
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
failureDomains:
description: |-
FailureDomains don't mean much in CAPD since it's all local, but we can see how the rest of cluster API
will use this if we populate it.
items:
additionalProperties:
description: |-
FailureDomain is the Schema for Cluster API failure domains.
FailureDomainSpec is the Schema for Cluster API failure domains.
It allows controllers to understand how many failure domains a cluster can optionally span across.
properties:
attributes:
Expand All @@ -263,15 +255,11 @@ spec:
description: controlPlane determines if this failure domain
is suitable for use by control plane machines.
type: boolean
name:
description: name is the name of the failure domain.
maxLength: 256
minLength: 1
type: string
required:
- name
type: object
type: array
description: |-
FailureDomains don't mean much in CAPD since it's all local, but we can see how the rest of cluster API
will use this if we populate it.
type: object
ready:
default: false
description: Ready denotes that the infrastructure is ready.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ spec:

In future versions, controller-tools@v2 might allow overriding the type and validation for embedded
types. When that happens, this hack should be revisited.
minProperties: 1
properties:
annotations:
additionalProperties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4513,56 +4513,51 @@ spec:
conditions:
description: Conditions defines current service state of the KubevirtMachine.
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
description: Condition defines an observation of a Cluster API resource
operational state.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
This should be when the underlying condition changed. If that is not known, then using the time when
the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
This field may be empty.
maxLength: 10240
minLength: 1
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
reason is the reason for the condition's last transition in CamelCase.
The specific API may choose whether or not this field is considered a guaranteed API.
This field may be empty.
maxLength: 256
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
severity:
description: |-
severity provides an explicit classification of Reason code, so the users or machines can immediately
understand the current situation and act accordingly.
The Severity field MUST be set only when Status=False.
maxLength: 32
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
can be useful (see .node.status.conditions), the ability to deconflict is important.
maxLength: 256
minLength: 1
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
Expand Down
Loading
Loading