cluster: introduce Machine.Inactive flag #38

Merged
amery merged 3 commits from pr-amery-dns-ignore into main 8 months ago
amery commented 8 months 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 8 months ago
1580c09746 cluster: add Machine.ReadLines() shortcut
851274954e cluster: introduce Machine.Inactive flag
amery requested review from karasz 8 months ago
karasz requested changes 8 months ago
karasz left a comment
Owner

see comments

see comments
ID int
Name string `json:"-" yaml:"-"`
Inactive bool `json:"inactive,omitempty" yaml:"inactive,omitempty"`
Owner

Please name the field Active

Please name the field `Active`
amery commented 8 months 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
}
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
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() {
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 8 months 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 8 months ago
karasz approved these changes 8 months ago
karasz left a comment
Owner

LGTM

LGTM
amery merged commit a910bba406 into main 8 months ago
amery deleted branch pr-amery-dns-ignore 8 months ago

Reviewers

karasz approved these changes 8 months 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.