Skip to content

Commit 942d124

Browse files
maboehmtimebertt
andauthored
[GEP-28] Report Machine.status.addresses when running without target cluster (#1012)
Co-authored-by: Tim Ebert <[email protected]>
1 parent 954ab83 commit 942d124

File tree

17 files changed

+211
-36
lines changed

17 files changed

+211
-36
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ COPY . .
77
RUN --mount=type=cache,target="/root/.cache/go-build" .ci/build
88

99
############# base #############
10-
FROM gcr.io/distroless/static-debian12:nonroot as base
10+
FROM gcr.io/distroless/static-debian12:nonroot AS base
1111
WORKDIR /
1212

1313
############# machine-controller-manager #############

docs/documents/apis.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,8 +1543,8 @@ newest MachineSet.</p>
15431543
</td>
15441544
<td>
15451545
<em>
1546-
<a href="#machine.sapcloud.io/v1alpha1.*github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1.MachineSummary">
1547-
[]*github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1.MachineSummary
1546+
<a href="#machine.sapcloud.io/v1alpha1.*../../pkg/apis/machine/v1alpha1.MachineSummary">
1547+
[]*../../pkg/apis/machine/v1alpha1.MachineSummary
15481548
</a>
15491549
</em>
15501550
</td>
@@ -1988,8 +1988,8 @@ LastOperation
19881988
</td>
19891989
<td>
19901990
<em>
1991-
<a href="#machine.sapcloud.io/v1alpha1.[]github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1.MachineSummary">
1992-
[]github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1.MachineSummary
1991+
<a href="#machine.sapcloud.io/v1alpha1.[]../../pkg/apis/machine/v1alpha1.MachineSummary">
1992+
[]../../pkg/apis/machine/v1alpha1.MachineSummary
19931993
</a>
19941994
</em>
19951995
</td>
@@ -2121,6 +2121,23 @@ MachineConfiguration
21212121
<tbody>
21222122
<tr>
21232123
<td>
2124+
<code>addresses</code>
2125+
</td>
2126+
<td>
2127+
<em>
2128+
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#nodeaddress-v1-core">
2129+
[]Kubernetes core/v1.NodeAddress
2130+
</a>
2131+
</em>
2132+
</td>
2133+
<td>
2134+
<em>(Optional)</em>
2135+
<p>Addresses of this machines. This field is only present if the MCM provider runs without a target cluster and may
2136+
be used by clients to determine how to connect to the machine, instead of the <code>Node.status.addresses</code> field.</p>
2137+
</td>
2138+
</tr>
2139+
<tr>
2140+
<td>
21242141
<code>conditions</code>
21252142
</td>
21262143
<td>

kubernetes/crds/machine.sapcloud.io_machines.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,25 @@ spec:
224224
status:
225225
description: Status contains fields depicting the status
226226
properties:
227+
addresses:
228+
description: |-
229+
Addresses of this machines. This field is only present if the MCM provider runs without a target cluster and may
230+
be used by clients to determine how to connect to the machine, instead of the `Node.status.addresses` field.
231+
items:
232+
description: NodeAddress contains information for the node's address.
233+
properties:
234+
address:
235+
description: The node address.
236+
type: string
237+
type:
238+
description: Node address type, one of Hostname, ExternalIP
239+
or InternalIP.
240+
type: string
241+
required:
242+
- address
243+
- type
244+
type: object
245+
type: array
227246
conditions:
228247
description: Conditions of this machine, same as node
229248
items:

pkg/apis/machine/types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ type CurrentStatus struct {
162162

163163
// MachineStatus holds the most recently observed status of Machine.
164164
type MachineStatus struct {
165+
// Addresses of this machines. This field is only present if the MCM provider runs without a target cluster and may
166+
// be used by clients to determine how to connect to the machine, instead of the `Node.status.addresses` field.
167+
Addresses []corev1.NodeAddress
168+
165169
// Conditions of this machine, same as node
166170
Conditions []corev1.NodeCondition
167171

pkg/apis/machine/v1alpha1/machine_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ type NodeTemplateSpec struct {
9292

9393
// MachineStatus holds the most recently observed status of Machine.
9494
type MachineStatus struct {
95+
// Addresses of this machines. This field is only present if the MCM provider runs without a target cluster and may
96+
// be used by clients to determine how to connect to the machine, instead of the `Node.status.addresses` field.
97+
// +optional
98+
Addresses []corev1.NodeAddress `json:"addresses,omitempty"`
99+
95100
// Conditions of this machine, same as node
96101
Conditions []corev1.NodeCondition `json:"conditions,omitempty"`
97102

pkg/apis/machine/v1alpha1/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.

pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go

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

pkg/apis/machine/zz_generated.deepcopy.go

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

pkg/openapi/api_violations.report

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
API rule violation: list_type_missing,github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1,MachineDeploymentStatus,Conditions
22
API rule violation: list_type_missing,github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1,MachineDeploymentStatus,FailedMachines
33
API rule violation: list_type_missing,github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1,MachineSetStatus,Conditions
4+
API rule violation: list_type_missing,github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1,MachineStatus,Addresses
45
API rule violation: list_type_missing,github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1,MachineStatus,Conditions
56
API rule violation: names_match,github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1,MachineConfiguration,MachineCreationTimeout
67
API rule violation: names_match,github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1,MachineConfiguration,MachineDrainTimeout

pkg/openapi/openapi_generated.go

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)