Skip to content

Commit

Permalink
Expand nodeStatuses to include IPs and racks (fixes #637)
Browse files Browse the repository at this point in the history
  • Loading branch information
olim7t committed Apr 19, 2024
1 parent e598ce3 commit e673a75
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions apis/cassandra/v1beta1/cassandradatacenter_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11218,6 +11218,10 @@ spec:
properties:
hostID:
type: string
ip:
type: string
rack:
type: string
type: object
type: object
observedGeneration:
Expand Down
2 changes: 2 additions & 0 deletions pkg/reconciliation/reconcile_racks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
}
Expand Down

0 comments on commit e673a75

Please sign in to comment.