cluster: introduce Machine.Inactive flag #38

Merged
amery merged 3 commits from pr-amery-dns-ignore into main 1 year ago
amery commented 1 year ago
Owner

reflected on disk as none on a file named region

these machines won't be included in the regional or zonal aliases

reflected on disk as `none` on a file named `region` these machines won't be included in the regional or zonal aliases
amery added 3 commits 1 year ago
1580c09746 cluster: add Machine.ReadLines() shortcut
851274954e cluster: introduce Machine.Inactive flag
amery requested review from karasz 1 year ago
karasz requested changes 1 year ago
karasz left a comment
Owner

see comments

see comments
ID int
Name string `json:"-" yaml:"-"`
Inactive bool `json:"inactive,omitempty" yaml:"inactive,omitempty"`
karasz commented 1 year ago
Owner

Please name the field Active

Please name the field `Active`
amery commented 1 year ago
Poster
Owner

Active breaks zero-value rules, everything would become inactive by default

`Active` breaks zero-value rules, everything would become inactive by default
func (m *Machine) Active() bool {
return !m.Inactive
}
karasz commented 1 year ago
Owner
func (m *Machine) IsActive() bool {
	return m.Active
}
```go func (m *Machine) IsActive() bool { return m.Active }
amery marked this conversation as resolved
for _, r := range data {
switch r {
case "none":
m.Inactive = true
karasz commented 1 year ago
Owner

please see above s/Inactive/Active/ and switch logic.

please see above s/Inactive/Active/ and switch logic.
z.ForEachMachine(func(p *Machine) bool {
term = fn(p)
if p.Active() {
karasz commented 1 year ago
Owner
if p.IsActive() {
...
```go if p.IsActive() { ... ```
amery marked this conversation as resolved
Poster
Owner

@karasz it's currently called Inactive to deal with the zero value. Active by default, otherwise indicated.

@karasz it's currently called Inactive to deal with the zero value. Active by default, otherwise indicated.
amery added 2 commits 1 year ago
892d849740 cluster: introduce Machine.Inactive flag
Poster
Owner

Machine.Active() renamed to Machine.IsActive()

`Machine.Active()` renamed to `Machine.IsActive()`
amery requested review from karasz 1 year ago
karasz approved these changes 1 year ago
karasz left a comment
Owner

LGTM

LGTM
amery merged commit a910bba406 into main 1 year ago
amery deleted branch pr-amery-dns-ignore 1 year ago

Reviewers

karasz approved these changes 1 year ago
The pull request has been merged as a910bba406.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.