This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We are removing all of the telemetry code as it is not needed, and being on by default it may be contrary to CNCF policies around telemetry. * remove check function With no telemetry, there's no need for these function implementations or this syscall in this package anymore. We need to preserve the cadence of checkpoint.go to avoid disturbing any thing that would constitute a breaking change, but basically all of the underlying behavior of check can go away, since every Flux v1 version is out of date every time, we don't need any remote service or lookup to tell if an update is needed. (It's always needed) Users should follow the link to upgrade (eg. the migration guide) Signed-off-by: Kingdon Barrett <kingdon@weave.works>
- Loading branch information
Kingdon Barrett
committed
Aug 26, 2022
1 parent
f6a3aff
commit 6d294c8
Showing
9 changed files
with
88 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package checkpoint | ||
|
||
import ( | ||
"sync" | ||
"time" | ||
) | ||
|
||
type flag struct { | ||
Key string | ||
Value string | ||
} | ||
|
||
type checkParams struct { | ||
Product string | ||
Version string | ||
Flags map[string]string | ||
ExtraFlags func() []flag | ||
Arch string | ||
OS string | ||
Signature string | ||
SignatureFile string | ||
CacheFile string | ||
CacheDuration time.Duration | ||
Force bool | ||
} | ||
|
||
type checker struct { | ||
doneCh chan struct{} | ||
nextCheckAt time.Time | ||
nextCheckAtLock sync.RWMutex | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package checkpoint | ||
|
||
import ( | ||
mrand "math/rand" | ||
"os" | ||
"time" | ||
) | ||
|
||
func isCheckDisabled() bool { | ||
return os.Getenv("CHECKPOINT_DISABLE") != "" | ||
} | ||
|
||
func randomStagger(interval time.Duration) time.Duration { | ||
stagger := time.Duration(mrand.Int63()) % (interval / 2) | ||
return 3*(interval/4) + stagger | ||
} |