ipn/store/kubestore: don't error if state cannot be preloaded ()

Preloading of state from kube Secret should not
error if the Secret does not exist.

Updates 

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
This commit is contained in:
Irbe Krumina 2024-10-27 10:54:38 -05:00 committed by GitHub
parent 853fe3b713
commit 9d1348fe21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -53,7 +53,7 @@ func New(_ logger.Logf, secretName string) (*Store, error) {
secretName: secretName,
}
// Load latest state from kube Secret if it already exists.
if err := s.loadState(); err != nil {
if err := s.loadState(); err != nil && err != ipn.ErrStateNotExist {
return nil, fmt.Errorf("error loading state from kube Secret: %w", err)
}
return s, nil