ipn: remove the last traces of Prefs.AllowSingleHosts

We stopped reading this field nearly two years ago, with a TODO comment
to remove it sometime in 2025.

It is now 2026.

Updates #12058

Change-Id: I8ddf1c2e4c3c428e8d45a6491d3899368ec52c30
Signed-off-by: Alex Chan <alexc@tailscale.com>
This commit is contained in:
Alex Chan
2026-06-26 15:31:38 +01:00
committed by Alex Chan
parent e21fd6b77a
commit 8379d5955f
8 changed files with 2 additions and 67 deletions
@@ -61,7 +61,6 @@ var _PrefsCloneNeedsRegeneration = Prefs(struct {
PostureChecking prefs.Item[bool]
NetfilterKind prefs.Item[string]
DriveShares prefs.StructList[*drive.Share]
AllowSingleHosts prefs.Item[marshalAsTrueInJSON]
Persist *persist.Persist
}{})
@@ -145,7 +145,6 @@ func (v PrefsView) NetfilterKind() prefs.Item[string] { return v.ж.NetfilterKin
func (v PrefsView) DriveShares() prefs.StructListView[*drive.Share, drive.ShareView] {
return prefs.StructListViewOf(&v.ж.DriveShares)
}
func (v PrefsView) AllowSingleHosts() prefs.Item[marshalAsTrueInJSON] { return v.ж.AllowSingleHosts }
// Persist is an internal state rather than a preference.
// It can be kept in the Prefs structure but should not be wrapped
@@ -182,7 +181,6 @@ var _PrefsViewNeedsRegeneration = Prefs(struct {
PostureChecking prefs.Item[bool]
NetfilterKind prefs.Item[string]
DriveShares prefs.StructList[*drive.Share]
AllowSingleHosts prefs.Item[marshalAsTrueInJSON]
Persist *persist.Persist
}{})
+1 -9
View File
@@ -106,8 +106,7 @@ type Prefs struct {
// not be modified after the preference is set.
// Since the item type (*drive.Share) is mutable and implements [views.ViewCloner],
// we need to use [prefs.StructList] instead of [prefs.List].
DriveShares prefs.StructList[*drive.Share] `json:",omitzero"`
AllowSingleHosts prefs.Item[marshalAsTrueInJSON] `json:",omitzero"`
DriveShares prefs.StructList[*drive.Share] `json:",omitzero"`
// Persist is an internal state rather than a preference.
// It can be kept in the Prefs structure but should not be wrapped
@@ -162,10 +161,3 @@ func (p Prefs) MarshalJSON() ([]byte, error) {
func (p *Prefs) UnmarshalJSON(b []byte) error {
return jsonv2.Unmarshal(b, p) // uses UnmarshalJSONFrom
}
type marshalAsTrueInJSON struct{}
var trueJSON = []byte("true")
func (marshalAsTrueInJSON) MarshalJSON() ([]byte, error) { return trueJSON, nil }
func (*marshalAsTrueInJSON) UnmarshalJSON([]byte) error { return nil }