Merge branch 'main' into wasaga/healthcheck-reporter

This commit is contained in:
Denis Mishin 2023-12-14 14:48:34 -05:00 committed by GitHub
commit a38a21a225
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 133 additions and 219 deletions

View file

@ -11,9 +11,7 @@ import (
"github.com/pomerium/pomerium/pkg/protoutil"
)
var (
sessionTypeURL = protoutil.GetTypeURL(new(session.Session))
)
var sessionTypeURL = protoutil.GetTypeURL(new(session.Session))
// CurrentUsers returns a list of users active within the current UTC day
func CurrentUsers(

View file

@ -26,7 +26,6 @@ func (e *RequestIDError) Unwrap() error {
// Is implements errors.Is for RequestIDError
func (e *RequestIDError) Is(err error) bool {
//nolint:errorlint
_, ok := err.(*RequestIDError)
return ok
}

View file

@ -22,7 +22,6 @@ func (e *terminalError) Unwrap() error {
// Is implements errors.Is for terminalError
func (e *terminalError) Is(err error) bool {
//nolint:errorlint
_, ok := err.(*terminalError)
return ok
}

View file

@ -46,7 +46,7 @@ func SaveBootstrapConfigToFile(src *cluster_api.BootstrapConfig, fp string, ciph
}
ciphertext := cryptutil.Encrypt(cipher, plaintext, nil)
err = os.WriteFile(fp, ciphertext, 0600)
err = os.WriteFile(fp, ciphertext, 0o600)
if err != nil {
return fmt.Errorf("write bootstrap config: %w", err)
}

View file

@ -12,16 +12,12 @@ import (
cluster_api "github.com/pomerium/pomerium/pkg/zero/cluster"
)
var (
_ = config.Source(new(source))
)
var _ = config.Source(new(source))
var (
cmpOpts = []cmp.Option{
cmpopts.IgnoreUnexported(config.Options{}),
cmpopts.EquateEmpty(),
}
)
var cmpOpts = []cmp.Option{
cmpopts.IgnoreUnexported(config.Options{}),
cmpopts.EquateEmpty(),
}
type source struct {
cfg atomicutil.Value[*config.Config]

View file

@ -16,7 +16,6 @@ import (
)
func TestReadRecords(t *testing.T) {
dir := t.TempDir()
fd, err := os.CreateTemp(dir, "config")
require.NoError(t, err)
@ -34,7 +33,7 @@ func TestReadRecords(t *testing.T) {
}
func writeSampleRecords(dst io.Writer) error {
var marshalOpts = protodelim.MarshalOptions{
marshalOpts := protodelim.MarshalOptions{
MarshalOptions: proto.MarshalOptions{
AllowPartial: false,
Deterministic: true,

View file

@ -73,7 +73,6 @@ func TestQueueMarkForSyncLater(t *testing.T) {
assert.Equal(t, "bundle1", id4)
assert.False(t, ok5, "Expected no more bundles to sync")
assert.Empty(t, id5)
}
func TestQueueGetNextBundleToSync(t *testing.T) {

View file

@ -37,10 +37,8 @@ const (
BundleCacheEntryRecordType = "pomerium.io/BundleCacheEntry"
)
var (
// ErrBundleCacheEntryNotFound is returned when a bundle cache entry is not found
ErrBundleCacheEntryNotFound = errors.New("bundle cache entry not found")
)
// ErrBundleCacheEntryNotFound is returned when a bundle cache entry is not found
var ErrBundleCacheEntryNotFound = errors.New("bundle cache entry not found")
// GetBundleCacheEntry gets a bundle cache entry from the databroker
func (c *service) GetBundleCacheEntry(ctx context.Context, id string) (*BundleCacheEntry, error) {