Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: OpenStackMachine: add OpenStackServerRef to Status #2403

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions api/v1beta1/openstackmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ type OpenStackMachineStatus struct {
FailureMessage *string `json:"failureMessage,omitempty"`

Conditions clusterv1.Conditions `json:"conditions,omitempty"`

// OpenStackServerRef is a reference to the OpenStackServer object that
// is associated with this OpenStackMachine.
// +optional
OpenStackServerRef *corev1.TypedLocalObjectReference `json:"openStackServerRef,omitempty"`
}

// +genclient
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

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

8 changes: 7 additions & 1 deletion cmd/models-schema/zz_generated.openapi.go

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

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

8 changes: 8 additions & 0 deletions controllers/openstackmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,14 @@ func (r *OpenStackMachineReconciler) reconcileNormal(ctx context.Context, scope
return ctrl.Result{}, err
}

if machineServer != nil {
openStackMachine.Status.OpenStackServerRef = &corev1.TypedLocalObjectReference{
APIGroup: &infrav1alpha1.SchemeGroupVersion.Group,
Kind: machineServer.Kind,
Name: machineServer.Name,
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want an else == nil, then we set openStackMachine.Status.OpenStackServerRef to nil too?


computeService, err := compute.NewService(scope)
if err != nil {
return ctrl.Result{}, err
Expand Down
13 changes: 13 additions & 0 deletions docs/book/src/api/v1beta1/api.md

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

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

3 changes: 3 additions & 0 deletions pkg/generated/applyconfiguration/internal/internal.go

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