Skip to content

Commit

Permalink
fix(api): ready should not be required as a status field
Browse files Browse the repository at this point in the history
  • Loading branch information
hrak committed Jul 12, 2024
1 parent d5a6d36 commit bd67555
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 41 deletions.
3 changes: 2 additions & 1 deletion api/v1beta3/cloudstackaffinitygroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ type CloudStackAffinityGroupSpec struct {
ID string `json:"id,omitempty"`

// FailureDomainName -- the name of the FailureDomain the machine is placed in.
// +optional
//+optional
FailureDomainName string `json:"failureDomainName,omitempty"`
}

// CloudStackAffinityGroupStatus defines the observed state of CloudStackAffinityGroup
type CloudStackAffinityGroupStatus struct {
// Reflects the readiness of the CS Affinity Group.
//+optional
Ready bool `json:"ready"`
}

Expand Down
3 changes: 2 additions & 1 deletion api/v1beta3/cloudstackcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ type CloudStackClusterSpec struct {
type CloudStackClusterStatus struct {
// CAPI recognizes failure domains as a method to spread machines.
// CAPC sets failure domains to indicate functioning CloudStackFailureDomains.
// +optional
//+optional
FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"`

// Reflects the readiness of the CS cluster.
//+optional
Ready bool `json:"ready"`
}

Expand Down
9 changes: 5 additions & 4 deletions api/v1beta3/cloudstackfailuredomain_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ const (

type Network struct {
// Cloudstack Network ID the cluster is built in.
// +optional
//+optional
ID string `json:"id,omitempty"`

// Cloudstack Network Type the cluster is built in.
// +optional
//+optional
Type string `json:"type,omitempty"`

// Cloudstack Network Name the cluster is built in.
Expand Down Expand Up @@ -82,11 +82,11 @@ type CloudStackFailureDomainSpec struct {
Zone CloudStackZoneSpec `json:"zone"`

// CloudStack account.
// +optional
//+optional
Account string `json:"account,omitempty"`

// CloudStack domain.
// +optional
//+optional
Domain string `json:"domain,omitempty"`

// Apache CloudStack Endpoint secret reference.
Expand All @@ -96,6 +96,7 @@ type CloudStackFailureDomainSpec struct {
// CloudStackFailureDomainStatus defines the observed state of CloudStackFailureDomain
type CloudStackFailureDomainStatus struct {
// Reflects the readiness of the CloudStack Failure Domain.
//+optional
Ready bool `json:"ready"`
}

Expand Down
1 change: 1 addition & 0 deletions api/v1beta3/cloudstackisolatednetwork_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type CloudStackIsolatedNetworkStatus struct {
LBRuleID string `json:"loadBalancerRuleID,omitempty"`

// Ready indicates the readiness of this provider resource.
//+optional
Ready bool `json:"ready"`
}

Expand Down
31 changes: 16 additions & 15 deletions api/v1beta3/cloudstackmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,42 +54,42 @@ type CloudStackMachineSpec struct {
Template CloudStackResourceIdentifier `json:"template"`

// CloudStack disk offering to use.
// +optional
//+optional
DiskOffering *CloudStackResourceDiskOffering `json:"diskOffering,omitempty"`

// CloudStack ssh key to use.
// +optional
//+optional
SSHKey string `json:"sshKey"`

// Optional details map for deployVirtualMachine
Details map[string]string `json:"details,omitempty"`

// Optional affinitygroupids for deployVirtualMachine
// +optional
//+optional
AffinityGroupIDs []string `json:"affinityGroupIDs,omitempty"`

// Mutually exclusive parameter with AffinityGroupIDs.
// Defaults to `no`. Can be `pro` or `anti`. Will create an affinity group per machine set.
// +optional
//+optional
Affinity string `json:"affinity,omitempty"`

// Mutually exclusive parameter with AffinityGroupIDs.
// Is a reference to a CloudStack affinity group CRD.
// +optional
//+optional
AffinityGroupRef *corev1.ObjectReference `json:"cloudstackAffinityRef,omitempty"`

// The CS specific unique identifier. Of the form: fmt.Sprintf("cloudstack:///%s", CS Machine ID)
// +optional
//+optional
ProviderID *string `json:"providerID,omitempty"`

// FailureDomainName -- the name of the FailureDomain the machine is placed in.
// +optional
//+optional
FailureDomainName string `json:"failureDomainName,omitempty"`

// UncompressedUserData specifies whether the user data is gzip-compressed.
// cloud-init has built-in support for gzip-compressed user data, ignition does not
//
// +optional
//+optional
UncompressedUserData *bool `json:"uncompressedUserData,omitempty"`
}

Expand All @@ -99,18 +99,18 @@ func (c *CloudStackMachine) CompressUserdata() bool {

type CloudStackResourceIdentifier struct {
// Cloudstack resource ID.
// +optional
//+optional
ID string `json:"id,omitempty"`

// Cloudstack resource Name
// +optional
//+optional
Name string `json:"name,omitempty"`
}

type CloudStackResourceDiskOffering struct {
CloudStackResourceIdentifier `json:",inline"`
// Desired disk size. Used if disk offering is customizable as indicated by the ACS field 'Custom Disk Size'.
// +optional
//+optional
CustomSize int64 `json:"customSizeInGB"`
// mount point the data disk uses to mount. The actual partition, mkfs and mount are done by cloud-init generated by kubeadmConfig.
MountPath string `json:"mountPath"`
Expand All @@ -128,22 +128,23 @@ type CloudStackMachineStatus struct {
Addresses []corev1.NodeAddress `json:"addresses,omitempty"`

// InstanceState is the state of the CloudStack instance for this machine.
// +optional
//+optional
InstanceState string `json:"instanceState,omitempty"`

// InstanceStateLastUpdated is the time the instance state was last updated.
// +optional
//+optional
InstanceStateLastUpdated metav1.Time `json:"instanceStateLastUpdated,omitempty"`

// Ready indicates the readiness of the provider resource.
//+optional
Ready bool `json:"ready"`

// Status indicates the status of the provider resource.
// +optional
//+optional
Status *string `json:"status,omitempty"`

// Reason indicates the reason of status failure
// +optional
//+optional
Reason *string `json:"reason,omitempty"`
}

Expand Down
1 change: 1 addition & 0 deletions api/v1beta3/cloudstackmachinestatechecker_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type CloudStackMachineStateCheckerSpec struct {
// CloudStackMachineStateCheckerStatus defines the observed state of CloudStackMachineStateChecker
type CloudStackMachineStateCheckerStatus struct {
// Reflects the readiness of the Machine State Checker.
//+optional
Ready bool `json:"ready"`
}

Expand Down
2 changes: 1 addition & 1 deletion api/v1beta3/cloudstackmachinetemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
type CloudStackMachineTemplateResource struct {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
//+optional
ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"`

// Spec is the specification of a desired behavior of the machine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ spec:
ready:
description: Reflects the readiness of the CS Affinity Group.
type: boolean
required:
- ready
type: object
type: object
served: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,6 @@ spec:
ready:
description: Reflects the readiness of the CS cluster.
type: boolean
required:
- ready
type: object
type: object
served: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ spec:
ready:
description: Reflects the readiness of the CloudStack Failure Domain.
type: boolean
required:
- ready
type: object
required:
- spec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,6 @@ spec:
ready:
description: Ready indicates the readiness of this provider resource.
type: boolean
required:
- ready
type: object
type: object
served: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,6 @@ spec:
status:
description: Status indicates the status of the provider resource.
type: string
required:
- ready
type: object
type: object
served: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ spec:
ready:
description: Reflects the readiness of the Machine State Checker.
type: boolean
required:
- ready
type: object
type: object
served: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.0
controller-gen.kubebuilder.io/version: v0.14.0
name: cloudstackmachineowners.fakes.infrastructure.cluster.x-k8s.io
spec:
group: fakes.infrastructure.cluster.x-k8s.io
Expand All @@ -21,14 +21,19 @@ spec:
(machineset, etcdadmcluster, kubeadmcontrolplane)
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down

0 comments on commit bd67555

Please sign in to comment.