Skip to content
Closed
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
11 changes: 11 additions & 0 deletions operator/v1/0000_20_etcd-operator_01.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ spec:
description: latestAvailableRevisionReason describe the detailed reason
for the most recent deployment
type: string
leader:
description: leader describes the etcd member which is currently the
leader. This field is a hint and shouldn't be considered authoritative.
type: object
properties:
name:
description: name is the etcd leader member name, if available.
type: string
node:
description: node is the etcd leader member node, if available.
type: string
nodeStatuses:
description: nodeStatuses track the deployment values and errors across
individual nodes
Expand Down
12 changes: 12 additions & 0 deletions operator/v1/types_etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ type EtcdSpec struct {

type EtcdStatus struct {
StaticPodOperatorStatus `json:",inline"`

// leader describes the etcd member which is currently the leader. This field
// is a hint and shouldn't be considered authoritative.
Leader LeaderStatus `json:"leader"`
}

// leaderStatus describes the etcd leader member details.
type LeaderStatus struct {
// name is the etcd leader member name, if available.
Name string `json:"name,omitempty"`
// node is the etcd leader member node, if available.
Node string `json:"node,omitempty"`
Copy link
Member

@cgwalters cgwalters Jul 15, 2020

Choose a reason for hiding this comment

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

Shouldn't this be e.g. NodeRef *corev1.ObjectReference ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be e.g. NodeRef *corev1.ObjectReference ?

No. We encourage the creation of specific reference types. See the reasoning in https://github.com/kubernetes/api/blob/master/core/v1/types.go#L5172-L5186

@cgwalters

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see. Hmm. So, since there's nothing more we care about here to a node than its name, does that argue for keeping it as a string?

}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
17 changes: 17 additions & 0 deletions operator/v1/zz_generated.deepcopy.go

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