diff --git a/CHANGELOG.md b/CHANGELOG.md index e361ce20..abe554ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Changelog for Cass Operator, new PRs should update the `main / unreleased` secti * [CHANGE] [#618](https://github.com/k8ssandra/cass-operator/issues/618) Update dependencies to support controller-runtime 0.17.2, modify required parts. * [ENHANCEMENT] [#628](https://github.com/k8ssandra/cass-operator/issues/628) Replace pod task can replace any node, including those that have crashed * [ENHANCEMENT] [#532](https://github.com/k8ssandra/cass-operator/issues/532) Instead of rejecting updates/creates with deprecated fields, return kubectl warnings. +* [ENHANCEMENT] [#637](https://github.com/k8ssandra/cass-operator/issues/637) Expand nodeStatuses to include IPs and racks. ## v1.19.1 diff --git a/apis/cassandra/v1beta1/cassandradatacenter_types.go b/apis/cassandra/v1beta1/cassandradatacenter_types.go index e2d17732..9caa5be4 100644 --- a/apis/cassandra/v1beta1/cassandradatacenter_types.go +++ b/apis/cassandra/v1beta1/cassandradatacenter_types.go @@ -369,6 +369,8 @@ type Rack struct { type CassandraNodeStatus struct { HostID string `json:"hostID,omitempty"` + Ip string `json:"ip,omitempty"` + Rack string `json:"rack,omitempty"` } type CassandraStatusMap map[string]CassandraNodeStatus diff --git a/config/crd/bases/cassandra.datastax.com_cassandradatacenters.yaml b/config/crd/bases/cassandra.datastax.com_cassandradatacenters.yaml index b3d4eb5c..6e48424e 100644 --- a/config/crd/bases/cassandra.datastax.com_cassandradatacenters.yaml +++ b/config/crd/bases/cassandra.datastax.com_cassandradatacenters.yaml @@ -11218,6 +11218,10 @@ spec: properties: hostID: type: string + ip: + type: string + rack: + type: string type: object type: object observedGeneration: diff --git a/pkg/reconciliation/reconcile_racks.go b/pkg/reconciliation/reconcile_racks.go index 56804e76..6f250cac 100644 --- a/pkg/reconciliation/reconcile_racks.go +++ b/pkg/reconciliation/reconcile_racks.go @@ -1003,6 +1003,8 @@ func (rc *ReconciliationContext) UpdateCassandraNodeStatus(force bool) error { if nodeStatus.HostID == "" { logger.Info("Failed to find host ID", "pod", pod.Name) } + nodeStatus.Ip = ip + nodeStatus.Rack = pod.Labels[api.RackLabel] } } }