diff --git a/Dockerfile b/Dockerfile index bfb3cb44f..d05a0bc0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,6 +33,7 @@ RUN go mod download RUN if [ "$INSTALL_TOOLS" == "yes" ] ; then \ go install github.com/swaggo/swag/cmd/swag@v1.8.7 && \ + go install gotest.tools/gotestsum@v1.10.1 && \ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \ | sh -s -- -b $(go env GOPATH)/bin v1.50.0 ; \ fi diff --git a/README.md b/README.md index 8c07309ae..05eef584f 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ System Patch Manager is one of the applications for [console.redhat.com](https:/ - [Control by private API](#control-by-private-api) - [VMaaS](#vmaas) - [Monitoring](#monitoring) +- [Profiling] (#profiling) ## Development environment @@ -135,5 +136,21 @@ Copy Grafana board json config to the temporary file, e.g. `grafana.json` and ru ./scripts/grafana-json-to-yaml.sh grafana.json > ./dashboards/grafana-dashboard-insights-patchman-engine-general.configmap.yaml ~~~ +## Profiling +App can be profiled using [/net/http/pprof](https://pkg.go.dev/net/http/pprof). Profiler is exposed on app's private port. +### Local development +- set `ENABLE_PROFILE=true` in the `cont/common.env` +- `docker-compose up --build` +- `go tool pprof http://localhost:{port}/debug/pprof/{heap|profile|block|mutex}` +available ports: +- 9000 - manager +- 9002 - listener +- 9003 - evaluator-upload +- 9004 - evaluator-recalc +### Admin API +- set `ENABLE_PROFILE_{container_name}=true` in the ClowdApp +- download the profile file using internal api `/api/patch/admin/pprof/{manager|listener|evaluator_upload|evaluator_recalc}/{heap|profile|block|mutex|trace}` +- `go tool pprof ` + ## Deps backup [patchman-engine-deps](https://github.com/RedHatInsights/patchman-engine-deps) diff --git a/VERSION b/VERSION index d8c907121..9a07e665a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v3.1.27 +v3.5.7 diff --git a/base/api/client.go b/base/api/client.go index 4544b1b84..96f8d81a1 100644 --- a/base/api/client.go +++ b/base/api/client.go @@ -36,7 +36,7 @@ func (o *Client) Request(ctx *context.Context, method, url string, httpResp, err := utils.CallAPI(o.HTTPClient, httpReq, o.Debug) if err != nil { - return nil, errors.Wrap(err, "Request failed") + return httpResp, errors.Wrap(err, "Request failed") } bodyBytes, err := io.ReadAll(httpResp.Body) diff --git a/base/core/gintesting.go b/base/core/gintesting.go index 77550edbb..c85134c44 100644 --- a/base/core/gintesting.go +++ b/base/core/gintesting.go @@ -31,7 +31,7 @@ func InitRouterWithParams(handler gin.HandlerFunc, account int, method, path str } router.Use(func(c *gin.Context) { // set default api version for tests to latest - c.Set(middlewares.KeyApiver, 3) + c.Set(middlewares.KeyApiver, LatestAPIVersion) for _, kv := range contextKVs { c.Set(kv.Key, kv.Value) } diff --git a/base/database/batch.go b/base/database/batch.go index 635cc1047..530f24ea6 100644 --- a/base/database/batch.go +++ b/base/database/batch.go @@ -108,7 +108,7 @@ func statementFromObjects(db *gorm.DB, objects reflect.Value) (*gorm.Statement, }() // Get a map of the first element to calculate field names and number of // placeholders. - firstObjectFields, err := objectToMap(db, firstElem) + firstObjectFields, err := objectToMap(schema, firstElem) if err != nil { return nil, err } @@ -127,7 +127,7 @@ func statementFromObjects(db *gorm.DB, objects reflect.Value) (*gorm.Statement, for i := 0; i < objects.Len(); i++ { // Retrieve ith element as an interface r := objects.Index(i).Interface() - row, err := objectToMap(db, r) + row, err := objectToMap(schema, r) if err != nil { return nil, err } @@ -212,7 +212,7 @@ func parseClause(clauseOnConflict clause.Expression) string { // objectToMap takes any object of type and returns a map with the gorm // field DB name as key and the value as value -func objectToMap(db *gorm.DB, object interface{}) (map[string]interface{}, error) { +func objectToMap(schema *schema.Schema, object interface{}) (map[string]interface{}, error) { attributes := make(map[string]interface{}) now := bulkNow @@ -220,7 +220,6 @@ func objectToMap(db *gorm.DB, object interface{}) (map[string]interface{}, error rv := reflect.ValueOf(object) if rv.Kind() == reflect.Ptr { rv = rv.Elem() - object = rv.Interface() } if rv.Kind() != reflect.Struct { return nil, errors.New("value must be kind of Struct") @@ -230,8 +229,7 @@ func objectToMap(db *gorm.DB, object interface{}) (map[string]interface{}, error now = Db.NowFunc() } - parsedSchema, _ := schema.Parse(object, &sync.Map{}, db.NamingStrategy) - for _, field := range parsedSchema.Fields { + for _, field := range schema.Fields { // Exclude relational record because it's not directly contained in database columns fieldVaule := rv.FieldByName(field.Name).Interface() _, hasForeignKey := field.TagSettings["FOREIGNKEY"] diff --git a/base/database/dbtest.go b/base/database/dbtest.go index 21c6d85df..fd97d1cc6 100644 --- a/base/database/dbtest.go +++ b/base/database/dbtest.go @@ -1,7 +1,7 @@ package database type TestTable struct { - ID uint `gorm:"primary_key"` + ID uint `gorm:"primaryKey"` Name string `gorm:"unique"` Email string } diff --git a/base/database/query.go b/base/database/query.go index 39edabb28..0bbd8b086 100644 --- a/base/database/query.go +++ b/base/database/query.go @@ -4,12 +4,13 @@ import ( "app/base" "app/base/utils" "fmt" - "github.com/pkg/errors" "reflect" "regexp" "strconv" "strings" "time" + + "github.com/pkg/errors" ) type AttrParser func(string) (interface{}, error) @@ -91,7 +92,7 @@ func getQueryFromTags(v reflect.Type) (AttrMap, []AttrName, error) { res[k] = v } } else { - columnName := field.Name + columnName := strings.ToLower(field.Name) if expr, has := field.Tag.Lookup("gorm"); has { match := ColumnNameRe.FindStringSubmatch(expr) if len(match) > 0 { diff --git a/base/database/utils.go b/base/database/utils.go index 7f04bb757..7db9f2e88 100644 --- a/base/database/utils.go +++ b/base/database/utils.go @@ -2,30 +2,28 @@ package database import ( "app/base/models" + "app/base/rbac" "app/base/types" "app/base/utils" + "errors" "fmt" "os" "strconv" "strings" "time" - "github.com/jackc/pgconn" - log "github.com/sirupsen/logrus" + "gorm.io/driver/postgres" "gorm.io/gorm" ) -const ( - PgErrorDuplicateKey = "23505" -) - -func Systems(tx *gorm.DB, accountID int) *gorm.DB { - return tx.Table("system_platform sp").Where("sp.rh_account_id = ?", accountID) +func Systems(tx *gorm.DB, accountID int, groups map[string]string) *gorm.DB { + tx = tx.Table("system_platform sp").Where("sp.rh_account_id = ?", accountID) + return InventoryHostsJoin(tx, groups) } -func SystemAdvisories(tx *gorm.DB, accountID int) *gorm.DB { - return Systems(tx, accountID). +func SystemAdvisories(tx *gorm.DB, accountID int, groups map[string]string) *gorm.DB { + return Systems(tx, accountID, groups). Joins("JOIN system_advisories sa on sa.system_id = sp.id AND sa.rh_account_id = ?", accountID) } @@ -34,8 +32,8 @@ func SystemPackagesShort(tx *gorm.DB, accountID int) *gorm.DB { Where("spkg.rh_account_id = ?", accountID) } -func SystemPackages(tx *gorm.DB, accountID int) *gorm.DB { - return Systems(tx, accountID). +func SystemPackages(tx *gorm.DB, accountID int, groups map[string]string) *gorm.DB { + return Systems(tx, accountID, groups). Joins("JOIN system_package spkg on spkg.system_id = sp.id AND spkg.rh_account_id = ?", accountID). Joins("JOIN package p on p.id = spkg.package_id"). Joins("JOIN package_name pn on pn.id = spkg.name_id") @@ -53,11 +51,11 @@ func PackageByName(tx *gorm.DB, pkgName string) *gorm.DB { return Packages(tx).Where("pn.name = ?", pkgName) } -func SystemAdvisoriesByInventoryID(tx *gorm.DB, accountID int, inventoryID string) *gorm.DB { - return SystemAdvisories(tx, accountID).Where("sp.inventory_id = ?::uuid", inventoryID) +func SystemAdvisoriesByInventoryID(tx *gorm.DB, accountID int, groups map[string]string, inventoryID string) *gorm.DB { + return SystemAdvisories(tx, accountID, groups).Where("sp.inventory_id = ?::uuid", inventoryID) } -func SystemAdvisoriesBySystemID(tx *gorm.DB, accountID, systemID int) *gorm.DB { +func SystemAdvisoriesBySystemID(tx *gorm.DB, accountID int, systemID int64) *gorm.DB { query := systemAdvisoriesQuery(tx, accountID).Where("sp.id = ?", systemID) return query } @@ -135,13 +133,10 @@ func ExecFile(filename string) error { return err } -func IsPgErrorCode(err error, pgCode string) bool { - switch e := err.(type) { - case *pgconn.PgError: - return e.Code == pgCode - default: - return false - } +// compare the dialect translated errors(like gorm.ErrDuplicatedKey) +func IsPgErrorCode(db *gorm.DB, err error, expectedGormErr error) bool { + translatedErr := db.Dialector.(*postgres.Dialector).Translate(err) + return errors.Is(translatedErr, expectedGormErr) } func logAndWait(query string) { @@ -223,3 +218,21 @@ func DBWait(waitForDB string) { func ReadReplicaConfigured() bool { return len(utils.Cfg.DBReadReplicaHost) > 0 && utils.Cfg.DBReadReplicaPort != 0 } + +func InventoryHostsJoin(tx *gorm.DB, groups map[string]string) *gorm.DB { + tx = tx.Joins("JOIN inventory.hosts ih ON ih.id = sp.inventory_id") + if _, ok := groups[rbac.KeyGrouped]; !ok { + if _, ok := groups[rbac.KeyUngrouped]; ok { + // show only systems with '[]' group + return tx.Where("ih.groups = '[]'") + } + // return query without WHERE if there are no groups + return tx + } + + tx = tx.Where("ih.groups @> ANY (?::jsonb[])", groups[rbac.KeyGrouped]) + if _, ok := groups[rbac.KeyUngrouped]; ok { + tx = tx.Or("ih.groups = '[]'") + } + return tx.Where(tx) +} diff --git a/base/database/utils_test.go b/base/database/utils_test.go new file mode 100644 index 000000000..191a97517 --- /dev/null +++ b/base/database/utils_test.go @@ -0,0 +1,49 @@ +package database + +import ( + "app/base/rbac" + "app/base/utils" + "testing" + + "github.com/stretchr/testify/assert" +) + +var ( + // counts of systems from system_platform JOIN inventory.hosts + nGroup1 int64 = 6 + nGroup2 int64 = 2 + nUngrouped int64 = 6 + nAll int64 = 16 +) + +// nolint: lll +var testCases = []map[int64]map[string]string{ + {nGroup1: {rbac.KeyGrouped: `{"[{\"id\":\"inventory-group-1\"}]"}`}}, + {nGroup2: {rbac.KeyGrouped: `{"[{\"id\":\"inventory-group-2\"}]"}`}}, + {nGroup1 + nGroup2: {rbac.KeyGrouped: `{"[{\"id\":\"inventory-group-1\"}]","[{\"id\":\"inventory-group-2\"}]"}`}}, + {nGroup1 + nUngrouped: { + rbac.KeyGrouped: `{"[{\"id\":\"inventory-group-1\"}]"}`, + rbac.KeyUngrouped: "[]", + }}, + {nUngrouped: { + rbac.KeyGrouped: `{"[{\"id\":\"non-existing-group\"}]"}`, + rbac.KeyUngrouped: "[]", + }}, + {0: {rbac.KeyGrouped: `{"[{\"id\":\"non-existing-group\"}]"}`}}, + {nUngrouped: {rbac.KeyUngrouped: "[]"}}, + {nAll: {}}, + {nAll: nil}, +} + +func TestInventoryHostsJoin(t *testing.T) { + utils.SkipWithoutDB(t) + Configure() + + for _, tc := range testCases { + for expectedCount, groups := range tc { + var count int64 + InventoryHostsJoin(Db.Table("system_platform sp"), groups).Count(&count) + assert.Equal(t, expectedCount, count) + } + } +} diff --git a/base/inventory/inventory.go b/base/inventory/inventory.go index 92fac5832..24e0dfa6e 100644 --- a/base/inventory/inventory.go +++ b/base/inventory/inventory.go @@ -8,6 +8,8 @@ type SystemProfile struct { DnfModules *[]DnfModule `json:"dnf_modules,omitempty"` OperatingSystem OperatingSystem `json:"operating_system,omitempty"` Rhsm Rhsm `json:"rhsm,omitempty"` + Releasever *string `json:"releasever,omitempty"` + SatelliteManaged bool `json:"satellite_managed,omitempty"` } func (t *SystemProfile) GetInstalledPackages() []string { diff --git a/base/models/models.go b/base/models/models.go index 9f5e52546..8aa673d9e 100644 --- a/base/models/models.go +++ b/base/models/models.go @@ -5,10 +5,11 @@ import ( ) type RhAccount struct { - ID int - Name *string - OrgID *string - ValidPackageCache bool + ID int `gorm:"primaryKey"` + Name *string + OrgID *string + ValidPackageCache bool + ValidAdvisoryCache bool } func (RhAccount) TableName() string { @@ -16,7 +17,7 @@ func (RhAccount) TableName() string { } type Reporter struct { - ID int + ID int `gorm:"primaryKey"` Name string } @@ -25,8 +26,8 @@ func (Reporter) TableName() string { } type Baseline struct { - ID int64 - RhAccountID int + ID int64 `gorm:"primaryKey"` + RhAccountID int `gorm:"primaryKey"` Name string Config []byte Description *string @@ -41,9 +42,9 @@ func (Baseline) TableName() string { // nolint: maligned type SystemPlatform struct { - ID int64 `gorm:"primary_key"` - InventoryID string `sql:"unique" gorm:"unique"` - RhAccountID int + ID int64 `gorm:"primaryKey"` + InventoryID string `gorm:"unique"` + RhAccountID int `gorm:"primaryKey"` VmaasJSON *string JSONChecksum *string LastUpdated *time.Time `gorm:"default:null"` @@ -66,19 +67,28 @@ type SystemPlatform struct { BaselineID *int64 BaselineUpToDate *bool `gorm:"column:baseline_uptodate"` YumUpdates []byte `gorm:"column:yum_updates"` + SatelliteManaged bool `gorm:"column:satellite_managed"` + BuiltPkgcache bool `gorm:"column:built_pkgcache"` } func (SystemPlatform) TableName() string { return "system_platform" } +func (s *SystemPlatform) GetInventoryID() string { + if s == nil { + return "" + } + return s.InventoryID +} + type String struct { - ID []byte `gorm:"primary_key"` + ID []byte `gorm:"primaryKey"` Value string } type PackageName struct { - ID int64 `json:"id" gorm:"primary_key"` + ID int64 `json:"id" gorm:"primaryKey"` Name string Summary *string } @@ -88,7 +98,7 @@ func (PackageName) TableName() string { } type Package struct { - ID int64 `json:"id" gorm:"primary_key"` + ID int64 `json:"id" gorm:"primaryKey"` NameID int64 EVRA string DescriptionHash *[]byte @@ -104,12 +114,12 @@ func (Package) TableName() string { type PackageSlice []Package type SystemPackage struct { - RhAccountID int `gorm:"primary_key"` - SystemID int64 `gorm:"primary_key"` - PackageID int64 `gorm:"primary_key"` + RhAccountID int `gorm:"primaryKey"` + SystemID int64 `gorm:"primaryKey"` + PackageID int64 `gorm:"primaryKey"` // Will contain json in form of [{ "evra": "...", "advisory": "..."}] UpdateData []byte - NameID int64 `gorm:"primary_key"` + NameID int64 } func (SystemPackage) TableName() string { @@ -118,7 +128,8 @@ func (SystemPackage) TableName() string { type PackageUpdate struct { EVRA string `json:"evra"` - Advisory string `json:"advisory"` + Advisory string `json:"-"` // don't show it in API, we can probably remove it completely later + Status string `json:"status"` } type DeletedSystem struct { @@ -140,7 +151,7 @@ func (AdvisorySeverity) TableName() string { } type AdvisoryType struct { - ID int + ID int `gorm:"primaryKey"` Name string Preference int } @@ -152,7 +163,7 @@ func (AdvisoryType) TableName() string { type AdvisoryPackageData []string type AdvisoryMetadata struct { - ID int64 + ID int64 `gorm:"primaryKey"` Name string Description string Synopsis string @@ -177,9 +188,9 @@ func (AdvisoryMetadata) TableName() string { type AdvisoryMetadataSlice []AdvisoryMetadata type SystemAdvisories struct { - RhAccountID int `gorm:"primary_key"` - SystemID int64 `gorm:"primary_key"` - AdvisoryID int64 `gorm:"primary_key"` + RhAccountID int `gorm:"primaryKey"` + SystemID int64 `gorm:"primaryKey"` + AdvisoryID int64 `gorm:"primaryKey"` Advisory AdvisoryMetadata FirstReported *time.Time StatusID int @@ -192,8 +203,8 @@ func (SystemAdvisories) TableName() string { type SystemAdvisoriesSlice []SystemAdvisories type AdvisoryAccountData struct { - AdvisoryID int64 - RhAccountID int + AdvisoryID int64 `gorm:"primaryKey"` + RhAccountID int `gorm:"primaryKey"` SystemsApplicable int SystemsInstallable int Notified *time.Time @@ -205,7 +216,7 @@ func (AdvisoryAccountData) TableName() string { type AdvisoryAccountDataSlice []AdvisoryAccountData type Repo struct { - ID int64 + ID int64 `gorm:"primaryKey"` Name string ThirdParty bool } @@ -217,9 +228,9 @@ func (Repo) TableName() string { type RepoSlice []Repo type SystemRepo struct { - RhAccountID int64 - SystemID int64 - RepoID int64 + RhAccountID int64 `gorm:"primaryKey"` + SystemID int64 `gorm:"primaryKey"` + RepoID int64 `gorm:"primaryKey"` } func (SystemRepo) TableName() string { @@ -229,7 +240,7 @@ func (SystemRepo) TableName() string { type SystemRepoSlice []SystemRepo type TimestampKV struct { - Name string + Name string `gorm:"unique"` Value time.Time } @@ -238,10 +249,11 @@ func (TimestampKV) TableName() string { } type PackageAccountData struct { - AccID int `gorm:"column:rh_account_id"` - PkgNameID int64 `gorm:"column:package_name_id"` - SysInstalled int `gorm:"column:systems_installed"` - SysUpdatable int `gorm:"column:systems_updatable"` + AccID int `gorm:"column:rh_account_id;primaryKey"` + PkgNameID int64 `gorm:"column:package_name_id;primaryKey"` + SysInstalled int `gorm:"column:systems_installed"` + SysInstallable int `gorm:"column:systems_installable"` + SysApplicable int `gorm:"column:systems_applicable"` } func (PackageAccountData) TableName() string { diff --git a/base/rbac/rbac.go b/base/rbac/rbac.go index 1f0875515..c83eba35b 100644 --- a/base/rbac/rbac.go +++ b/base/rbac/rbac.go @@ -1,9 +1,29 @@ package rbac +const KeyGrouped = "grouped" +const KeyUngrouped = "ungrouped" + type AccessPagination struct { Data []Access `json:"data"` } type Access struct { - Permission string `json:"permission"` + Permission string `json:"permission"` + ResourceDefinitions []ResourceDefinition `json:"resourceDefinitions"` +} + +type ResourceDefinition struct { + AttributeFilter AttributeFilter `json:"attributeFilter,omitempty"` +} + +type AttributeFilter struct { + Key string `json:"key"` + Value []*string `json:"value"` +} + +type inventoryGroup struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` } + +type InventoryGroup []inventoryGroup diff --git a/base/types/timestamp.go b/base/types/timestamp.go index 54332f25d..844e8e83f 100644 --- a/base/types/timestamp.go +++ b/base/types/timestamp.go @@ -32,6 +32,10 @@ func (d Rfc3339Timestamp) MarshalJSON() ([]byte, error) { func (d *Rfc3339Timestamp) UnmarshalJSON(data []byte) error { t, err := unmarshalTimestamp(data, Rfc3339NoTz) + if err != nil { + // parsing fail, try to parse timestamp without T + t, err = unmarshalTimestamp(data, Rfc3339NoT) + } *d = Rfc3339Timestamp(t) return err } @@ -60,16 +64,6 @@ func (d *Rfc3339TimestampWithZ) Time() *time.Time { return (*time.Time)(d) } -func (d Rfc3339TimestampNoT) MarshalJSON() ([]byte, error) { - return json.Marshal(d.Time().Format(Rfc3339NoT)) -} - -func (d *Rfc3339TimestampNoT) UnmarshalJSON(data []byte) error { - t, err := unmarshalTimestamp(data, Rfc3339NoT) - *d = Rfc3339TimestampNoT(t) - return err -} - func (d *Rfc3339TimestampNoT) Time() *time.Time { if d == nil { return nil diff --git a/base/utils/config.go b/base/utils/config.go index 4efd877c8..94c2948a2 100644 --- a/base/utils/config.go +++ b/base/utils/config.go @@ -29,6 +29,7 @@ type Config struct { DBReadReplicaHost string DBReadReplicaPort int DBReadReplicaEnabled bool + DBWorkMem int // API PublicPort int @@ -57,8 +58,12 @@ type Config struct { NotificationsTopic string // services - VmaasAddress string - RbacAddress string + VmaasAddress string + RbacAddress string + ManagerPrivateAddress string + ListenerPrivateAddress string + EvaluatorUploadPrivateAddress string + EvaluatorRecalcPrivateAddress string // cloudwatch CloudWatchAccessKeyID string @@ -68,6 +73,9 @@ type Config struct { // prometheus pushgateway PrometheusPushGateway string + + // profiler + ProfilerEnabled bool } func init() { @@ -85,6 +93,7 @@ func init() { initKafkaFromEnv() initServicesFromEnv() initPrometheusPushGatewayFromEnv() + initProfilerFromEnv() } func initDBFromEnv() { @@ -103,6 +112,7 @@ func initDBFromEnv() { Cfg.DBReadReplicaHost = Getenv("DB_HOST_READ_REPLICA", "") Cfg.DBReadReplicaPort = GetIntEnvOrDefault("DB_PORT_READ_REPLICA", 0) } + Cfg.DBWorkMem = GetIntEnvOrDefault("DB_WORK_MEM", 4096) // 4MB is DB default } func initKafkaFromEnv() { @@ -206,26 +216,40 @@ func initServicesFromClowder() { switch endpoint.App { case "vmaas": if strings.Contains(endpoint.Name, webappName) { - Cfg.VmaasAddress = (*Endpoint)(&endpoint).buildURL("http") + Cfg.VmaasAddress = (*Endpoint)(&endpoint).buildURL() } case "rbac": - Cfg.RbacAddress = (*Endpoint)(&endpoint).buildURL("http") + Cfg.RbacAddress = (*Endpoint)(&endpoint).buildURL() } } -} -func (e *Endpoint) buildURL(scheme string) string { - return buildURL(scheme, e.Hostname, e.Port, e.TlsPort) + for _, e := range clowder.LoadedConfig.PrivateEndpoints { + e := e // re-assign iteration variable to use a new memory pointer + if e.App == "patchman" { + switch e.Name { + case "manager": + Cfg.ManagerPrivateAddress = (*Endpoint)(&e).buildURL() + case "listener": + Cfg.ListenerPrivateAddress = (*Endpoint)(&e).buildURL() + case "evaluator-upload": + Cfg.EvaluatorUploadPrivateAddress = (*Endpoint)(&e).buildURL() + case "evaluator-recalc": + Cfg.EvaluatorRecalcPrivateAddress = (*Endpoint)(&e).buildURL() + } + } + } } -func buildURL(scheme, host string, port int, tlsPort *int) string { +func (e *Endpoint) buildURL() string { + port := e.Port + scheme := "http" if clowder.LoadedConfig.TlsCAPath != nil { scheme += "s" - if tlsPort != nil { - port = *tlsPort + if e.TlsPort != nil { + port = *e.TlsPort } } - return fmt.Sprintf("%s://%s:%d", scheme, host, port) + return fmt.Sprintf("%s://%s:%d", scheme, e.Hostname, port) } func initCloudwatchFromClowder() { @@ -242,6 +266,10 @@ func initPrometheusPushGatewayFromEnv() { Cfg.PrometheusPushGateway = Getenv("PROMETHEUS_PUSHGATEWAY", "pushgateway") } +func initProfilerFromEnv() { + Cfg.ProfilerEnabled = GetBoolEnvOrDefault("ENABLE_PROFILER", false) +} + // PrintClowderParams Print Clowder params to export environment variables. func PrintClowderParams() { if clowder.IsClowderEnabled() { diff --git a/base/utils/core.go b/base/utils/core.go index 4b96a483d..99bf4c67c 100644 --- a/base/utils/core.go +++ b/base/utils/core.go @@ -1,7 +1,9 @@ package utils import ( + "app/base/rbac" "bytes" + "encoding/json" "fmt" "math" "os" @@ -163,3 +165,13 @@ func GetGorutineID() uint64 { n, _ := strconv.ParseUint(string(b), 10, 64) return n } + +func ParseInventoryGroup(id *string, name *string) (string, error) { + group := rbac.InventoryGroup{{ID: id, Name: name}} + groupJSON, err := json.Marshal(&group) + if err != nil { + LogError("group", group, "err", err.Error(), "Cannot Marshal Inventory group") + return "", err + } + return strconv.Quote(string(groupJSON)), nil +} diff --git a/base/utils/http.go b/base/utils/http.go index a89f259e2..a86633bc9 100644 --- a/base/utils/http.go +++ b/base/utils/http.go @@ -9,6 +9,8 @@ import ( "github.com/lestrrat-go/backoff" "github.com/pkg/errors" + + _ "net/http/pprof" //nolint:gosec ) func HTTPCallRetry(ctx context.Context, httpCallFun func() (outputDataPtr interface{}, resp *http.Response, err error), @@ -54,6 +56,12 @@ func CallAPI(client *http.Client, request *http.Request, debugEnabled bool) (*ht return resp, err } + if resp.StatusCode < http.StatusOK || resp.StatusCode > 299 { + // we got non 2xx status code, return error + // return also the response which is used for request retry + return resp, fmt.Errorf("received non 2xx status code, status code: %d", resp.StatusCode) + } + if debugEnabled { dump, err := httputil.DumpResponse(resp, true) if err != nil { @@ -103,3 +111,15 @@ func statusCodeFound(response *http.Response, statusCodes []int) bool { } return false } + +// run net/http/pprof on privatePort +func RunProfiler() { + if Cfg.ProfilerEnabled { + go func() { + err := http.ListenAndServe(fmt.Sprintf(":%d", Cfg.PrivatePort), nil) //nolint:gosec + if err != nil { + LogWarn("err", err.Error(), "couldn't start profiler") + } + }() + } +} diff --git a/base/utils/rpm.go b/base/utils/rpm.go index 46d51cb51..5697ee149 100644 --- a/base/utils/rpm.go +++ b/base/utils/rpm.go @@ -66,6 +66,13 @@ func ParseNameEVRA(name, evra string) (*Nevra, error) { return ParseNevra(fmt.Sprintf("%s-%s", name, evra)) } +func NEVRAStringE(name, evra string, showEpoch bool) string { + if showEpoch && !strings.Contains(evra, ":") { + evra = fmt.Sprintf("0:%s", evra) + } + return fmt.Sprintf("%s-%s", name, evra) +} + func (n Nevra) StringE(showEpoch bool) string { if n.Epoch != 0 || showEpoch { return fmt.Sprintf("%s-%d:%s-%s.%s", n.Name, n.Epoch, n.Version, n.Release, n.Arch) diff --git a/base/utils/vmaas.go b/base/utils/vmaas.go index 69849eb0b..84008a7ba 100644 --- a/base/utils/vmaas.go +++ b/base/utils/vmaas.go @@ -1,13 +1,14 @@ package utils import ( + "app/base/models" "app/base/vmaas" + "encoding/json" ) // Merge update data from vmaasDataB into vmaasDataA without duplicating. // Requires sorted update input and returns sorted output. -func MergeVMaaSResponses(vmaasDataA *vmaas.UpdatesV2Response, - vmaasDataB *vmaas.UpdatesV2Response) (*vmaas.UpdatesV2Response, error) { +func MergeVMaaSResponses(vmaasDataA, vmaasDataB *vmaas.UpdatesV3Response) (*vmaas.UpdatesV3Response, error) { if vmaasDataA == nil { return vmaasDataB, nil } @@ -24,7 +25,7 @@ func MergeVMaaSResponses(vmaasDataA *vmaas.UpdatesV2Response, if err != nil { return nil, err } - mergedList[nevraB] = *merged + mergedList[nevraB] = merged } else { mergedList[nevraB] = updateListB } @@ -37,9 +38,9 @@ func MergeVMaaSResponses(vmaasDataA *vmaas.UpdatesV2Response, return vmaasDataA, nil } -func mergeUpdates(listA, listB vmaas.UpdatesV2ResponseUpdateList) (*vmaas.UpdatesV2ResponseUpdateList, error) { +func mergeUpdates(listA, listB *vmaas.UpdatesV3ResponseUpdateList) (*vmaas.UpdatesV3ResponseUpdateList, error) { updatesA, updatesB := listA.GetAvailableUpdates(), listB.GetAvailableUpdates() - newUpdates := make([]vmaas.UpdatesV2ResponseAvailableUpdates, 0) + newUpdates := make([]vmaas.UpdatesV3ResponseAvailableUpdates, 0) a, b := 0, 0 for a < len(updatesA) && b < len(updatesB) { nevraA, err := ParseNevra(updatesA[a].GetPackage()) @@ -76,13 +77,13 @@ func mergeUpdates(listA, listB vmaas.UpdatesV2ResponseUpdateList) (*vmaas.Update if b <= len(updatesB)-1 { newUpdates = append(newUpdates, updatesB[b:]...) } - return &vmaas.UpdatesV2ResponseUpdateList{ + return &vmaas.UpdatesV3ResponseUpdateList{ AvailableUpdates: &newUpdates, }, nil } // Keep only updates for the latest package in update list -func RemoveNonLatestPackages(updates *vmaas.UpdatesV2Response) error { +func RemoveNonLatestPackages(updates *vmaas.UpdatesV3Response) error { var toDel []string type nevraStruct struct { nameString string @@ -121,3 +122,9 @@ func RemoveNonLatestPackages(updates *vmaas.UpdatesV2Response) error { updates.UpdateList = &updateList return nil } + +func ParseVmaasJSON(system *models.SystemPlatform) (vmaas.UpdatesV3Request, error) { + var updatesReq vmaas.UpdatesV3Request + err := json.Unmarshal([]byte(*system.VmaasJSON), &updatesReq) + return updatesReq, err +} diff --git a/base/utils/vmaas_test.go b/base/utils/vmaas_test.go index a1fed67eb..890fc12e2 100644 --- a/base/utils/vmaas_test.go +++ b/base/utils/vmaas_test.go @@ -10,13 +10,13 @@ import ( ) func compareUpdatesMerge(t *testing.T, jsonA, jsonB, merged []byte) { - var listA, listB vmaas.UpdatesV2ResponseUpdateList + var listA, listB vmaas.UpdatesV3ResponseUpdateList err := json.Unmarshal(jsonA, &listA) assert.Nil(t, err) err = json.Unmarshal(jsonB, &listB) assert.Nil(t, err) - listMerged, err := mergeUpdates(listA, listB) + listMerged, err := mergeUpdates(&listA, &listB) assert.Nil(t, err) res, err := json.Marshal(listMerged) @@ -51,7 +51,7 @@ func TestMergeDifferentAttrs(t *testing.T) { } func compareResponseMerge(t *testing.T, jsonA, jsonB, merged []byte) { - var respA, respB vmaas.UpdatesV2Response + var respA, respB vmaas.UpdatesV3Response err := json.Unmarshal(jsonA, &respA) assert.Nil(t, err) diff --git a/base/vmaas/vmaas.go b/base/vmaas/vmaas.go index b7b0775af..851763e8e 100644 --- a/base/vmaas/vmaas.go +++ b/base/vmaas/vmaas.go @@ -2,7 +2,6 @@ package vmaas import ( "app/base/types" - "sort" "strings" ) @@ -18,6 +17,10 @@ type UpdatesV3Request struct { ThirdParty *bool `json:"third_party,omitempty"` // Search for updates of unknown package EVRAs. OptimisticUpdates *bool `json:"optimistic_updates,omitempty"` + // VMaaS will check package_list and return error if we provide package_list without epochs + EpochRequired *bool `json:"epoch_required,omitempty"` + // helper for tests to get different status code from VMaaS mock + TestReturnStatus int `swaggerignore:"true" json:"return_status,omitempty"` } type UpdatesV3RequestModulesList struct { @@ -37,63 +40,75 @@ func (o *UpdatesV3Request) SetReleasever(v string) { o.Releasever = &v } -type UpdatesV2Response struct { - UpdateList *map[string]UpdatesV2ResponseUpdateList `json:"update_list,omitempty"` - RepositoryList *[]string `json:"repository_list,omitempty"` - ModulesList *[]UpdatesV3RequestModulesList `json:"modules_list,omitempty"` - Releasever *string `json:"releasever,omitempty"` - Basearch *string `json:"basearch,omitempty"` - LastChange *string `json:"last_change,omitempty"` +type UpdatesV3Response struct { + UpdateList *map[string]*UpdatesV3ResponseUpdateList `json:"update_list,omitempty"` + RepositoryList *[]string `json:"repository_list,omitempty"` + ModulesList *[]UpdatesV3RequestModulesList `json:"modules_list,omitempty"` + Releasever *string `json:"releasever,omitempty"` + Basearch *string `json:"basearch,omitempty"` + LastChange *string `json:"last_change,omitempty"` + BuildPkgcache *bool `json:"build_pkgcache,omitempty"` } // GetUpdateList returns the UpdateList field value if set, zero value otherwise. -func (o *UpdatesV2Response) GetUpdateList() map[string]UpdatesV2ResponseUpdateList { +func (o *UpdatesV3Response) GetUpdateList() map[string]*UpdatesV3ResponseUpdateList { if o == nil || o.UpdateList == nil { - var ret map[string]UpdatesV2ResponseUpdateList + var ret map[string]*UpdatesV3ResponseUpdateList return ret } return *o.UpdateList } -type UpdatesV2ResponseUpdateList struct { - AvailableUpdates *[]UpdatesV2ResponseAvailableUpdates `json:"available_updates,omitempty"` +// GetBuildPkgcache returns the boolean value for the `build_pkgcache` field of yum_updates +func (o *UpdatesV3Response) GetBuildPkgcache() bool { + if o == nil || o.BuildPkgcache == nil { + return false + } + return *o.BuildPkgcache +} + +type UpdatesV3ResponseUpdateList struct { + AvailableUpdates *[]UpdatesV3ResponseAvailableUpdates `json:"available_updates,omitempty"` } -func (o *UpdatesV2ResponseUpdateList) GetAvailableUpdates() []UpdatesV2ResponseAvailableUpdates { +func (o *UpdatesV3ResponseUpdateList) GetAvailableUpdates() []UpdatesV3ResponseAvailableUpdates { if o == nil || o.AvailableUpdates == nil { - var ret []UpdatesV2ResponseAvailableUpdates + var ret []UpdatesV3ResponseAvailableUpdates return ret } - updates := *o.AvailableUpdates - sort.Slice(updates, func(i, j int) bool { - // `less` function - updatesI := updates[i] - updatesJ := updates[j] - if updatesI.Package == nil && updatesJ.Package != nil { - return true - } - if updatesJ.Package == nil && updatesI.Package != nil { - return false - } - if updatesJ.Package == nil && updatesI.Package == nil { - return true - } - return *updatesI.Package < *updatesJ.Package - }) - return updates -} - -type UpdatesV2ResponseAvailableUpdates struct { - Repository *string `json:"repository,omitempty"` - Releasever *string `json:"releasever,omitempty"` - Basearch *string `json:"basearch,omitempty"` - Erratum *string `json:"erratum,omitempty"` - Package *string `json:"package,omitempty"` + return *o.AvailableUpdates +} + +func (o *UpdatesV3ResponseUpdateList) SetUpdatesInstallability(status int) { + if o == nil || o.AvailableUpdates == nil { + return + } + for index := range *o.AvailableUpdates { + (*o.AvailableUpdates)[index].SetInstallability(status) + } +} + +type UpdatesV3ResponseAvailableUpdates struct { + Repository *string `json:"repository,omitempty"` + Releasever *string `json:"releasever,omitempty"` + Basearch *string `json:"basearch,omitempty"` + Erratum *string `json:"erratum,omitempty"` + Package *string `json:"package,omitempty"` + PackageName *string `json:"package_name,omitempty"` + EVRA *string `json:"evra,omitempty"` // helper column to diferentiate installable/applicable StatusID int `json:"-"` } -func (o *UpdatesV2ResponseAvailableUpdates) GetPackage() string { +func (o *UpdatesV3ResponseAvailableUpdates) GetPackage() string { + // `package` does not contain epoch if epoch=0 + // get epoch from `evra` if it exists (not available in yum_updates) + name := o.GetPackageName() + evra := o.GetEVRA() + if len(name) > 0 && len(evra) > 0 { + return strings.Join([]string{name, evra}, "-") + } + // get value from `package` if `package_name` or `evra` is empty if o == nil || o.Package == nil { var ret string return ret @@ -101,7 +116,23 @@ func (o *UpdatesV2ResponseAvailableUpdates) GetPackage() string { return *o.Package } -func (o *UpdatesV2ResponseAvailableUpdates) GetErratum() string { +func (o *UpdatesV3ResponseAvailableUpdates) GetPackageName() string { + if o == nil || o.PackageName == nil { + var ret string + return ret + } + return *o.PackageName +} + +func (o *UpdatesV3ResponseAvailableUpdates) GetEVRA() string { + if o == nil || o.EVRA == nil { + var ret string + return ret + } + return *o.EVRA +} + +func (o *UpdatesV3ResponseAvailableUpdates) GetErratum() string { if o == nil || o.Erratum == nil { var ret string return ret @@ -109,7 +140,7 @@ func (o *UpdatesV2ResponseAvailableUpdates) GetErratum() string { return *o.Erratum } -func (o *UpdatesV2ResponseAvailableUpdates) GetBasearch() string { +func (o *UpdatesV3ResponseAvailableUpdates) GetBasearch() string { if o == nil || o.Basearch == nil { var ret string return ret @@ -117,7 +148,7 @@ func (o *UpdatesV2ResponseAvailableUpdates) GetBasearch() string { return *o.Basearch } -func (o *UpdatesV2ResponseAvailableUpdates) GetReleasever() string { +func (o *UpdatesV3ResponseAvailableUpdates) GetReleasever() string { if o == nil || o.Releasever == nil { var ret string return ret @@ -125,7 +156,7 @@ func (o *UpdatesV2ResponseAvailableUpdates) GetReleasever() string { return *o.Releasever } -func (o *UpdatesV2ResponseAvailableUpdates) GetRepository() string { +func (o *UpdatesV3ResponseAvailableUpdates) GetRepository() string { if o == nil || o.Repository == nil { var ret string return ret @@ -133,7 +164,14 @@ func (o *UpdatesV2ResponseAvailableUpdates) GetRepository() string { return *o.Repository } -func (o *UpdatesV2ResponseAvailableUpdates) Cmp(b *UpdatesV2ResponseAvailableUpdates) int { +func (o *UpdatesV3ResponseAvailableUpdates) SetInstallability(status int) { + if o == nil { + return + } + o.StatusID = status +} + +func (o *UpdatesV3ResponseAvailableUpdates) Cmp(b *UpdatesV3ResponseAvailableUpdates) int { if cmp := strings.Compare(o.GetPackage(), b.GetPackage()); cmp != 0 { return cmp } @@ -234,20 +272,16 @@ type ReposResponse struct { } type DBChangeResponse struct { - DBChange dbChange `json:"dbchange,omitempty"` -} - -type dbChange struct { - ErrataChanges *types.Rfc3339TimestampNoT `json:"errata_changes,omitempty"` - CVEChanges *types.Rfc3339TimestampNoT `json:"cve_changes,omitempty"` - RepositoryChanges *types.Rfc3339TimestampNoT `json:"repository_changes,omitempty"` - LastChange *types.Rfc3339TimestampNoT `json:"last_change,omitempty"` - Exported *types.Rfc3339TimestampNoT `json:"exported,omitempty"` + ErrataChanges *types.Rfc3339Timestamp `json:"errata_changes,omitempty"` + CVEChanges *types.Rfc3339Timestamp `json:"cve_changes,omitempty"` + RepositoryChanges *types.Rfc3339Timestamp `json:"repository_changes,omitempty"` + LastChange *types.Rfc3339Timestamp `json:"last_change,omitempty"` + Exported *types.Rfc3339Timestamp `json:"exported,omitempty"` } -func (o *DBChangeResponse) GetExported() *types.Rfc3339TimestampNoT { +func (o *DBChangeResponse) GetExported() *types.Rfc3339Timestamp { if o == nil { return nil } - return o.DBChange.Exported + return o.Exported } diff --git a/conf/cdappconfig.json b/conf/cdappconfig.json index a80e59211..b1892a882 100644 --- a/conf/cdappconfig.json +++ b/conf/cdappconfig.json @@ -68,6 +68,32 @@ "port": 9001 } ], + "privateEndpoints": [ + { + "app": "patchman", + "hostname": "manager", + "name": "manager", + "port": 9000 + }, + { + "app": "patchman", + "hostname": "listener", + "name": "listener", + "port": 9000 + }, + { + "app": "patchman", + "hostname": "evaluator_upload", + "name": "evaluator-upload", + "port": 9000 + }, + { + "app": "patchman", + "hostname": "evaluator_recalc", + "name": "evaluator-recalc", + "port": 9000 + } + ], "logging": { "cloudwatch": { "accessKeyId": "", diff --git a/conf/common.env b/conf/common.env index 73d573acc..7a76967af 100644 --- a/conf/common.env +++ b/conf/common.env @@ -1,7 +1,6 @@ LOG_LEVEL=trace LOG_STYLE=plain GIN_MODE=release -GOMAXPROCS=8 ACG_CONFIG=/go/src/app/conf/cdappconfig.json DB_DEBUG=false @@ -25,3 +24,4 @@ CONSUMER_COUNT=8 # If vmaas is running locally, its available here #VMAAS_ADDRESS=http://vmaas_webapp:8080 ENABLE_MODIFIED_SINCE_SYNC=true +ENABLE_PROFILER=true diff --git a/conf/kafka.env b/conf/kafka.env index a5adcf9cb..c20ec6fb7 100644 --- a/conf/kafka.env +++ b/conf/kafka.env @@ -2,9 +2,9 @@ # https://github.com/confluentinc/examples/blob/b8a68d8e41572cf1cb51e5b63f54e14b379c2ec4/cp-all-in-one/docker-compose.yml KAFKA_BROKER_ID=1 -KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 -KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,SSL:SSL,SSL_HOST:SSL +KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,CONTROLLER:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,SSL:SSL,SSL_HOST:SSL KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,SSL://kafka:9093,PLAINTEXT_HOST://localhost:29092,SSL_HOST://localhost:29093 +KAFKA_LISTENERS=PLAINTEXT://kafka:9092,SSL://kafka:9093,CONTROLLER://kafka:29094,PLAINTEXT_HOST://localhost:29092,SSL_HOST://localhost:29093 # secrets from /etc/kafka/secrets KAFKA_SSL_KEYSTORE_CREDENTIALS=broker_creds @@ -14,13 +14,15 @@ KAFKA_SSL_KEYSTORE_FILENAME=kafka.broker.keystore.jks KAFKA_SSL_TRUSTSTORE_FILENAME=kafka.broker.truststore.jks KAFKA_SSL_CLIENT_AUTH=none -KAFKA_METRIC_REPORTERS=io.confluent.metrics.reporter.ConfluentMetricsReporter +# KRaft mode settings +# https://docs.confluent.io/platform/current/installation/docker/config-reference.html#cp-kakfa-example +KAFKA_PROCESS_ROLES=broker,controller +KAFKA_CONTROLLER_QUORUM_VOTERS=1@kafka:29094 +KAFKA_INTER_BROKER_LISTENER_NAME=PLAINTEXT +KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER +CLUSTER_ID=ok340dKtTOWc4eOxrdavLA + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1 KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1 KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0 -CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS=kafka:9092 -CONFLUENT_METRICS_REPORTER_ZOOKEEPER_CONNECT=zookeeper:2181 -CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS=1 -CONFLUENT_METRICS_ENABLE=true -CONFLUENT_SUPPORT_CUSTOMER_ID=anonymous diff --git a/conf/local.env b/conf/local.env index bf34084df..6ac69592d 100644 --- a/conf/local.env +++ b/conf/local.env @@ -1,5 +1,6 @@ GIN_MODE=release LOG_LEVEL=DEBUG +DB_DEBUG=true USE_TESTING_DB=1 ACG_CONFIG=./conf/cdappconfig.json diff --git a/conf/platform.env b/conf/platform.env index 93afde6ef..445055d4a 100644 --- a/conf/platform.env +++ b/conf/platform.env @@ -1 +1,2 @@ +ACG_CONFIG=/go/src/app/conf/cdappconfig.json #KAFKA_ADDRESS=kafka:9092 diff --git a/dashboards/grafana-dashboard-insights-patchman-engine-general.configmap.yaml b/dashboards/grafana-dashboard-insights-patchman-engine-general.configmap.yaml index 53897bb00..3413fe888 100644 --- a/dashboards/grafana-dashboard-insights-patchman-engine-general.configmap.yaml +++ b/dashboards/grafana-dashboard-insights-patchman-engine-general.configmap.yaml @@ -134,7 +134,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -222,7 +222,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -309,7 +309,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -396,7 +396,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -483,7 +483,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -570,7 +570,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -657,7 +657,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -743,7 +743,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -832,7 +832,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -919,7 +919,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -1007,7 +1007,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -1097,7 +1097,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -1186,7 +1186,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -1273,7 +1273,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -1361,7 +1361,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -1448,7 +1448,7 @@ data: }, "textMode": "auto" }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -1858,7 +1858,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -1970,7 +1970,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -2110,7 +2110,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -2222,7 +2222,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -2480,7 +2480,7 @@ data: "unit": "short" } }, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "targets": [ { "datasource": { @@ -2802,7 +2802,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -2874,6 +2874,7 @@ data: "dashLength": 10, "dashes": false, "datasource": { + "type": "prometheus", "uid": "$datasource" }, "description": "The number of messages per second received by result in Listener.", @@ -2916,7 +2917,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -3032,7 +3033,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -3173,7 +3174,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -3327,7 +3328,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -3445,7 +3446,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -3565,7 +3566,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -3677,7 +3678,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -3827,7 +3828,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -3976,7 +3977,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -4124,7 +4125,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -4663,7 +4664,7 @@ data: "refId": "A" } ], - "title": "VMaaS sync", + "title": "Jobs", "type": "row" }, { @@ -4674,9 +4675,10 @@ data: "dashLength": 10, "dashes": false, "datasource": { + "type": "prometheus", "uid": "$datasource" }, - "description": "The number of culled systems per second which were deleted.", + "description": "The median value of duration of particular evaluation part.", "fieldConfig": { "defaults": { "links": [ @@ -4696,7 +4698,7 @@ data: "y": 91 }, "hiddenSeries": false, - "id": 76, + "id": 97, "legend": { "avg": false, "current": false, @@ -4716,7 +4718,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -4729,24 +4731,135 @@ data: "targets": [ { "datasource": { + "type": "prometheus", "uid": "$datasource" }, - "expr": "sum(increase(patchman_engine_vmaas_sync_deleted_culled_systems{}[$interval]))", + "editorMode": "code", + "expr": "histogram_quantile(0.5, sum(rate(patchman_engine_caches_package_refresh_part_duration_seconds_bucket[$interval])) by (part, le))", + "hide": false, + "legendFormat": "__auto", + "range": true, + "refId": "C" + } + ], + "thresholds": [ + + ], + "timeRegions": [ + + ], + "title": "Package refresh part duration median", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "show": true, + "values": [ + + ] + }, + "yaxes": [ + { + "$$hashKey": "object:447", + "format": "short", + "label": "Median of duration", + "logBase": 1, + "show": true + }, + { + "$$hashKey": "object:448", + "format": "short", + "logBase": 1, + "show": true + } + ], + "yaxis": { + "align": false + } + }, + { + "aliasColors": { + + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": { + "uid": "$datasource" + }, + "description": "The number of external services calls and their result.", + "fieldConfig": { + "defaults": { + "links": [ + + ] + }, + "overrides": [ + + ] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 91 + }, + "hiddenSeries": false, + "id": 40, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [ + + ], + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "9.3.8", + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "expr": "sum(increase(patchman_engine_vmaas_sync_vmaas_call{}[$interval])) by (type)", "format": "time_series", - "interval": "", "intervalFactor": 1, - "legendFormat": "deleted systems", + "legendFormat": "VMaaS Sync - {{type}}", "refId": "A" }, { "datasource": { "uid": "$datasource" }, - "expr": "sum(increase(patchman_engine_vmaas_sync_stale_systems_marked{}[$interval]))", + "expr": "sum(increase(patchman_engine_manager_dependency_call{name=\"rbac\"}[$interval])) by (name, status)", "format": "time_series", - "interval": "", "intervalFactor": 1, - "legendFormat": "marked stale systems", + "legendFormat": "{{name}} - {{status}}", "refId": "B" } ], @@ -4756,7 +4869,7 @@ data: "timeRegions": [ ], - "title": "System culling", + "title": "Vmaas sync - external services", "tooltip": { "shared": true, "sort": 0, @@ -4772,14 +4885,14 @@ data: }, "yaxes": [ { - "$$hashKey": "object:1244", + "$$hashKey": "object:1297", "format": "none", - "label": "Systems/s", + "label": "Calls/s", "logBase": 1, "show": true }, { - "$$hashKey": "object:1245", + "$$hashKey": "object:1298", "format": "short", "logBase": 1, "show": true @@ -4799,7 +4912,7 @@ data: "datasource": { "uid": "$datasource" }, - "description": "The number of external services calls and their result.", + "description": "The number of culled systems per second which were deleted.", "fieldConfig": { "defaults": { "links": [ @@ -4815,11 +4928,11 @@ data: "gridPos": { "h": 6, "w": 12, - "x": 12, - "y": 91 + "x": 0, + "y": 97 }, "hiddenSeries": false, - "id": 40, + "id": 76, "legend": { "avg": false, "current": false, @@ -4839,7 +4952,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -4854,20 +4967,22 @@ data: "datasource": { "uid": "$datasource" }, - "expr": "sum(increase(patchman_engine_vmaas_sync_vmaas_call{}[$interval])) by (type)", + "expr": "sum(increase(patchman_engine_vmaas_sync_deleted_culled_systems{}[$interval]))", "format": "time_series", + "interval": "", "intervalFactor": 1, - "legendFormat": "VMaaS Sync - {{type}}", + "legendFormat": "deleted systems", "refId": "A" }, { "datasource": { "uid": "$datasource" }, - "expr": "sum(increase(patchman_engine_manager_dependency_call{name=\"rbac\"}[$interval])) by (name, status)", + "expr": "sum(increase(patchman_engine_vmaas_sync_stale_systems_marked{}[$interval]))", "format": "time_series", + "interval": "", "intervalFactor": 1, - "legendFormat": "{{name}} - {{status}}", + "legendFormat": "marked stale systems", "refId": "B" } ], @@ -4877,7 +4992,7 @@ data: "timeRegions": [ ], - "title": "External services", + "title": "System culling", "tooltip": { "shared": true, "sort": 0, @@ -4893,14 +5008,14 @@ data: }, "yaxes": [ { - "$$hashKey": "object:1297", + "$$hashKey": "object:1244", "format": "none", - "label": "Calls/s", + "label": "Systems/s", "logBase": 1, "show": true }, { - "$$hashKey": "object:1298", + "$$hashKey": "object:1245", "format": "short", "logBase": 1, "show": true @@ -4920,7 +5035,7 @@ data: "h": 1, "w": 24, "x": 0, - "y": 97 + "y": 103 }, "id": 69, "panels": [ @@ -4969,7 +5084,7 @@ data: "h": 6, "w": 12, "x": 0, - "y": 98 + "y": 104 }, "hiddenSeries": false, "id": 51, @@ -4992,7 +5107,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -5095,7 +5210,7 @@ data: "h": 6, "w": 12, "x": 12, - "y": 98 + "y": 104 }, "hiddenSeries": false, "id": 42, @@ -5118,7 +5233,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -5221,7 +5336,7 @@ data: "h": 6, "w": 12, "x": 0, - "y": 104 + "y": 110 }, "hiddenSeries": false, "id": 73, @@ -5244,7 +5359,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -5336,7 +5451,7 @@ data: "h": 6, "w": 12, "x": 12, - "y": 104 + "y": 110 }, "hiddenSeries": false, "id": 78, @@ -5359,7 +5474,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -5463,7 +5578,7 @@ data: "h": 6, "w": 12, "x": 0, - "y": 110 + "y": 116 }, "hiddenSeries": false, "id": 58, @@ -5486,7 +5601,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -5621,7 +5736,7 @@ data: "h": 6, "w": 12, "x": 12, - "y": 110 + "y": 116 }, "hiddenSeries": false, "id": 59, @@ -5644,7 +5759,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -5715,7 +5830,7 @@ data: "h": 1, "w": 24, "x": 0, - "y": 116 + "y": 122 }, "id": 71, "panels": [ @@ -5766,7 +5881,7 @@ data: "h": 6, "w": 12, "x": 0, - "y": 117 + "y": 123 }, "hiddenSeries": false, "id": 53, @@ -5789,7 +5904,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -5882,7 +5997,7 @@ data: "h": 6, "w": 12, "x": 12, - "y": 117 + "y": 123 }, "hiddenSeries": false, "id": 52, @@ -5905,7 +6020,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -6008,7 +6123,7 @@ data: "h": 6, "w": 12, "x": 0, - "y": 123 + "y": 129 }, "hiddenSeries": false, "id": 54, @@ -6031,7 +6146,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -6154,7 +6269,7 @@ data: "h": 6, "w": 12, "x": 12, - "y": 123 + "y": 129 }, "hiddenSeries": false, "id": 55, @@ -6177,7 +6292,7 @@ data: "alertThreshold": true }, "percentage": false, - "pluginVersion": "9.4.3", + "pluginVersion": "9.3.8", "pointradius": 5, "points": false, "renderer": "flot", @@ -6260,7 +6375,7 @@ data: ], "refresh": "", "revision": 1, - "schemaVersion": 38, + "schemaVersion": 37, "style": "dark", "tags": [ @@ -6407,7 +6522,7 @@ data: }, { "current": { - "selected": false, + "selected": true, "text": "crcs02ue1-prometheus", "value": "crcs02ue1-prometheus" }, @@ -6428,7 +6543,7 @@ data: }, { "current": { - "selected": false, + "selected": true, "text": "app-sre-stage-01-prometheus", "value": "app-sre-stage-01-prometheus" }, @@ -6487,8 +6602,8 @@ data: { "current": { "selected": false, - "text": "GET/api/patch/v2/packages/", - "value": "GET/api/patch/v2/packages/" + "text": "GET/api/patch/v2/advisories", + "value": "GET/api/patch/v2/advisories" }, "datasource": { "type": "prometheus", @@ -6546,7 +6661,7 @@ data: "timezone": "", "title": "patchman-engine", "uid": "patch", - "version": 2, + "version": 3, "weekStart": "" } kind: ConfigMap diff --git a/database_admin/migrations/108_add_rhsm-system-profile-bridge.up.sql b/database_admin/migrations/108_add_rhsm-system-profile-bridge.up.sql new file mode 100644 index 000000000..19931888c --- /dev/null +++ b/database_admin/migrations/108_add_rhsm-system-profile-bridge.up.sql @@ -0,0 +1,3 @@ +INSERT INTO reporter (id, name) VALUES + (4, 'rhsm-system-profile-bridge') +ON CONFLICT DO NOTHING; diff --git a/database_admin/migrations/109_update_status.down.sql b/database_admin/migrations/109_update_status.down.sql new file mode 100644 index 000000000..ab9cc9fe0 --- /dev/null +++ b/database_admin/migrations/109_update_status.down.sql @@ -0,0 +1 @@ +DROP FUNCTION IF EXISTS update_status(update_data jsonb); diff --git a/database_admin/migrations/109_update_status.up.sql b/database_admin/migrations/109_update_status.up.sql new file mode 100644 index 000000000..a68baeeea --- /dev/null +++ b/database_admin/migrations/109_update_status.up.sql @@ -0,0 +1,18 @@ +CREATE OR REPLACE FUNCTION update_status(update_data jsonb) + RETURNS TEXT as +$$ +DECLARE + len int; +BEGIN + len = jsonb_array_length(update_data); + IF len IS NULL or len = 0 THEN + RETURN 'None'; + END IF; + len = jsonb_array_length(jsonb_path_query_array(update_data, '$ ? (@.status == "Installable")')); + IF len > 0 THEN + RETURN 'Installable'; + END IF; + RETURN 'Applicable'; +END; +$$ LANGUAGE 'plpgsql'; + diff --git a/database_admin/migrations/110_package_account_data_applicable.up.sql b/database_admin/migrations/110_package_account_data_applicable.up.sql new file mode 100644 index 000000000..307bd5b25 --- /dev/null +++ b/database_admin/migrations/110_package_account_data_applicable.up.sql @@ -0,0 +1,4 @@ +TRUNCATE package_account_data; +UPDATE rh_account SET valid_package_cache = FALSE; +ALTER TABLE package_account_data RENAME COLUMN systems_updatable TO systems_installable; +ALTER TABLE package_account_data ADD COLUMN systems_applicable INT NOT NULL DEFAULT 0; diff --git a/database_admin/migrations/110_package_account_data_installable.down.sql b/database_admin/migrations/110_package_account_data_installable.down.sql new file mode 100644 index 000000000..e01efd83e --- /dev/null +++ b/database_admin/migrations/110_package_account_data_installable.down.sql @@ -0,0 +1,4 @@ +TRUNCATE package_account_data; +UPDATE rh_account SET valid_package_cache = FALSE; +ALTER TABLE package_account_data RENAME COLUMN systems_installable TO systems_updatable; +ALTER TABLE package_account_data DROP COLUMN systems_applicable; diff --git a/database_admin/migrations/111_immutable.down.sql b/database_admin/migrations/111_immutable.down.sql new file mode 100644 index 000000000..cc8b44609 --- /dev/null +++ b/database_admin/migrations/111_immutable.down.sql @@ -0,0 +1,26 @@ +CREATE OR REPLACE FUNCTION empty(t TEXT) + RETURNS BOOLEAN as +$empty$ +BEGIN + RETURN t ~ '^[[:space:]]*$'; +END; +$empty$ LANGUAGE 'plpgsql'; + + +CREATE OR REPLACE FUNCTION update_status(update_data jsonb) + RETURNS TEXT as +$$ +DECLARE + len int; +BEGIN + len = jsonb_array_length(update_data); + IF len IS NULL or len = 0 THEN + RETURN 'None'; + END IF; + len = jsonb_array_length(jsonb_path_query_array(update_data, '$ ? (@.status == "Installable")')); + IF len > 0 THEN + RETURN 'Installable'; + END IF; + RETURN 'Applicable'; +END; +$$ LANGUAGE 'plpgsql'; diff --git a/database_admin/migrations/111_immutable.up.sql b/database_admin/migrations/111_immutable.up.sql new file mode 100644 index 000000000..4526f8a24 --- /dev/null +++ b/database_admin/migrations/111_immutable.up.sql @@ -0,0 +1,26 @@ +CREATE OR REPLACE FUNCTION empty(t TEXT) + RETURNS BOOLEAN as +$$ +BEGIN + RETURN t ~ '^[[:space:]]*$'; +END; +$$ LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE; + + +CREATE OR REPLACE FUNCTION update_status(update_data jsonb) + RETURNS TEXT as +$$ +DECLARE + len int; +BEGIN + len = jsonb_array_length(update_data); + IF len IS NULL or len = 0 THEN + RETURN 'None'; + END IF; + len = jsonb_array_length(jsonb_path_query_array(update_data, '$ ? (@.status == "Installable")')); + IF len > 0 THEN + RETURN 'Installable'; + END IF; + RETURN 'Applicable'; +END; +$$ LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE; diff --git a/database_admin/migrations/112_advisory_cache_valid.down.sql b/database_admin/migrations/112_advisory_cache_valid.down.sql new file mode 100644 index 000000000..f995fcf05 --- /dev/null +++ b/database_admin/migrations/112_advisory_cache_valid.down.sql @@ -0,0 +1 @@ +ALTER TABLE rh_account DROP valid_advisory_cache; diff --git a/database_admin/migrations/112_advisory_cache_valid.up.sql b/database_admin/migrations/112_advisory_cache_valid.up.sql new file mode 100644 index 000000000..0bff488bb --- /dev/null +++ b/database_admin/migrations/112_advisory_cache_valid.up.sql @@ -0,0 +1 @@ +ALTER TABLE rh_account ADD COLUMN valid_advisory_cache BOOLEAN NOT NULL DEFAULT FALSE; diff --git a/database_admin/migrations/113_satellite_managed.down.sql b/database_admin/migrations/113_satellite_managed.down.sql new file mode 100644 index 000000000..7a08782b8 --- /dev/null +++ b/database_admin/migrations/113_satellite_managed.down.sql @@ -0,0 +1 @@ +ALTER TABLE system_platform DROP COLUMN satellite_managed; diff --git a/database_admin/migrations/113_satellite_managed.up.sql b/database_admin/migrations/113_satellite_managed.up.sql new file mode 100644 index 000000000..1d16d4b95 --- /dev/null +++ b/database_admin/migrations/113_satellite_managed.up.sql @@ -0,0 +1 @@ +ALTER TABLE system_platform ADD COLUMN satellite_managed BOOLEAN NOT NULL DEFAULT FALSE; diff --git a/database_admin/migrations/114_built_pkgcache.down.sql b/database_admin/migrations/114_built_pkgcache.down.sql new file mode 100644 index 000000000..5bf912eb1 --- /dev/null +++ b/database_admin/migrations/114_built_pkgcache.down.sql @@ -0,0 +1 @@ +ALTER TABLE system_platform DROP COLUMN built_pkgcache; diff --git a/database_admin/migrations/114_built_pkgcache.up.sql b/database_admin/migrations/114_built_pkgcache.up.sql new file mode 100644 index 000000000..37d7805f6 --- /dev/null +++ b/database_admin/migrations/114_built_pkgcache.up.sql @@ -0,0 +1 @@ +ALTER TABLE system_platform ADD COLUMN built_pkgcache BOOLEAN NOT NULL DEFAULT FALSE; diff --git a/database_admin/schema/create_schema.sql b/database_admin/schema/create_schema.sql index 6078e2e50..fdff8fda5 100644 --- a/database_admin/schema/create_schema.sql +++ b/database_admin/schema/create_schema.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS schema_migrations INSERT INTO schema_migrations -VALUES (107, false); +VALUES (114, false); -- --------------------------------------------------------------------------- -- Functions @@ -20,11 +20,11 @@ CREATE COLLATION IF NOT EXISTS numeric (provider = icu, locale = 'en-u-kn-true') -- empty CREATE OR REPLACE FUNCTION empty(t TEXT) RETURNS BOOLEAN as -$empty$ +$$ BEGIN RETURN t ~ '^[[:space:]]*$'; END; -$empty$ LANGUAGE 'plpgsql'; +$$ LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE; CREATE OR REPLACE FUNCTION ternary(cond BOOL, iftrue ANYELEMENT, iffalse ANYELEMENT) RETURNS ANYELEMENT @@ -600,6 +600,25 @@ END; $$ LANGUAGE plpgsql; +CREATE OR REPLACE FUNCTION update_status(update_data jsonb) + RETURNS TEXT as +$$ +DECLARE + len int; +BEGIN + len = jsonb_array_length(update_data); + IF len IS NULL or len = 0 THEN + RETURN 'None'; + END IF; + len = jsonb_array_length(jsonb_path_query_array(update_data, '$ ? (@.status == "Installable")')); + IF len > 0 THEN + RETURN 'Installable'; + END IF; + RETURN 'Applicable'; +END; +$$ LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE; + + -- --------------------------------------------------------------------------- -- Tables -- --------------------------------------------------------------------------- @@ -611,6 +630,7 @@ CREATE TABLE IF NOT EXISTS rh_account name TEXT UNIQUE CHECK (NOT empty(name)), org_id TEXT UNIQUE CHECK (NOT empty(org_id)), valid_package_cache BOOLEAN NOT NULL DEFAULT FALSE, + valid_advisory_cache BOOLEAN NOT NULL DEFAULT FALSE, CHECK (name IS NOT NULL OR org_id IS NOT NULL), PRIMARY KEY (id) ) TABLESPACE pg_default; @@ -630,7 +650,8 @@ CREATE TABLE reporter INSERT INTO reporter (id, name) VALUES (1, 'puptoo'), (2, 'rhsm-conduit'), - (3, 'yupana') + (3, 'yupana'), + (4, 'rhsm-system-profile-bridge') ON CONFLICT DO NOTHING; -- baseline @@ -688,6 +709,8 @@ CREATE TABLE IF NOT EXISTS system_platform applicable_advisory_enh_count_cache INT NOT NULL DEFAULT 0, applicable_advisory_bug_count_cache INT NOT NULL DEFAULT 0, applicable_advisory_sec_count_cache INT NOT NULL DEFAULT 0, + satellite_managed BOOLEAN NOT NULL DEFAULT FALSE, + built_pkgcache BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY (rh_account_id, id), UNIQUE (rh_account_id, inventory_id), CONSTRAINT reporter_id FOREIGN KEY (reporter_id) REFERENCES reporter (id), @@ -1012,7 +1035,8 @@ CREATE TABLE IF NOT EXISTS package_account_data package_name_id BIGINT NOT NULL, rh_account_id INT NOT NULL, systems_installed INT NOT NULL DEFAULT 0, - systems_updatable INT NOT NULL DEFAULT 0, + systems_installable INT NOT NULL DEFAULT 0, + systems_applicable INT NOT NULL DEFAULT 0, CONSTRAINT package_name_id FOREIGN KEY (package_name_id) REFERENCES package_name (id), diff --git a/deploy/clowdapp.yaml b/deploy/clowdapp.yaml index 8d9c8902c..9b3a13028 100644 --- a/deploy/clowdapp.yaml +++ b/deploy/clowdapp.yaml @@ -31,7 +31,6 @@ objects: - ./scripts/entrypoint.sh - admin env: - - {name: GOMAXPROCS, value: '${GOMAXPROCS_ADMIN}'} - {name: GIN_MODE, value: '${GIN_MODE}'} - {name: KAFKA_GROUP, value: patchman} - {name: KAFKA_WRITER_MAX_ATTEMPTS, value: '${KAFKA_WRITER_MAX_ATTEMPTS}'} @@ -46,6 +45,7 @@ objects: - {name: PACKAGES_PAGE_SIZE, value: '${PACKAGES_PAGE_SIZE}'} - {name: MSG_BATCH_SIZE, value: '${MSG_BATCH_SIZE}'} - {name: ENABLE_TURNPIKE_AUTH, value: '${ENABLE_TURNPIKE_AUTH}'} + - {name: GOMEMLIMIT, value: '${GOMEMLIMIT_DATABASE_ADMIN}'} resources: limits: {cpu: '${RES_LIMIT_CPU_ADMIN}', memory: '${RES_LIMIT_MEM_ADMIN}'} @@ -58,7 +58,7 @@ objects: enabled: true apiPath: patch private: - enabled: false + enabled: true podSpec: image: ${IMAGE}:${IMAGE_TAG_MANAGER} initContainers: @@ -94,7 +94,6 @@ objects: - manager env: - {name: LOG_LEVEL, value: '${LOG_LEVEL_MANAGER}'} - - {name: GOMAXPROCS, value: '${GOMAXPROCS_MANAGER}'} - {name: GIN_MODE, value: '${GIN_MODE}'} - {name: SHOW_CLOWDER_VARS, value: ''} - {name: DB_DEBUG, value: '${DB_DEBUG_MANAGER}'} @@ -106,6 +105,7 @@ objects: - {name: DB_PORT_READ_REPLICA, valueFrom: {secretKeyRef: {key: db.port, name: patchman-db-readonly}}} - {name: DB_READ_REPLICA_ENABLED, value: '${DB_READ_REPLICA_ENABLED}'} + - {name: DB_WORK_MEM, value: '${DB_WORK_MEM}'} - {name: ENABLE_CYNDI_TAGS, value: '${ENABLE_CYNDI_TAGS}'} - {name: ENABLE_RBAC, value: '${ENABLE_RBAC}'} - {name: DISABLE_CACHE_COUNTS, value: '${DISABLE_CACHE_COUNTS}'} @@ -120,6 +120,9 @@ objects: - {name: ENABLE_PACKAGE_CACHE, value: '${ENABLE_PACKAGE_CACHE_MANAGER}'} - {name: RESPONSE_TIMEOUT, value: '${RESPONSE_TIMEOUT}'} - {name: SSL_CERT_DIR, value: '${SSL_CERT_DIR}'} + - {name: ENABLE_PROFILER, value: '${ENABLE_PROFILER_MANAGER}'} + - {name: GOMEMLIMIT, value: '${GOMEMLIMIT_MANAGER}'} + - {name: ENABLE_SATELLITE_FUNCTIONALITY, value: '${ENABLE_SATELLITE_FUNCTIONALITY}'} resources: limits: {cpu: '${RES_LIMIT_CPU_MANAGER}', memory: '${RES_LIMIT_MEM_MANAGER}'} @@ -131,7 +134,7 @@ objects: public: enabled: true private: - enabled: false + enabled: true metrics: enabled: true podSpec: @@ -148,7 +151,6 @@ objects: - listener env: - {name: LOG_LEVEL, value: '${LOG_LEVEL_LISTENER}'} - - {name: GOMAXPROCS, value: '${GOMAXPROCS_LISTENER}'} - {name: GIN_MODE, value: '${GIN_MODE}'} - {name: SHOW_CLOWDER_VARS, value: ''} - {name: DB_DEBUG, value: '${DB_DEBUG_LISTENER}'} @@ -166,6 +168,8 @@ objects: - {name: EXCLUDED_REPORTERS, value: '${EXCLUDED_REPORTERS}'} - {name: EXCLUDED_HOST_TYPES, value: '${EXCLUDED_HOST_TYPES}'} - {name: ENABLE_PAYLOAD_TRACKER, value: '${ENABLE_PAYLOAD_TRACKER}'} + - {name: ENABLE_PROFILER, value: '${ENABLE_PROFILER_LISTENER}'} + - {name: GOMEMLIMIT, value: '${GOMEMLIMIT_LISTENER}'} resources: limits: {cpu: '${RES_LIMIT_CPU_LISTENER}', memory: '${RES_LIMIT_MEM_LISTENER}'} @@ -177,7 +181,7 @@ objects: public: enabled: true private: - enabled: false + enabled: true metrics: enabled: true podSpec: @@ -194,7 +198,6 @@ objects: - evaluator env: - {name: LOG_LEVEL, value: '${LOG_LEVEL_EVALUATOR_UPLOAD}'} - - {name: GOMAXPROCS, value: '${GOMAXPROCS_EVALUATOR_UPLOAD}'} - {name: GIN_MODE, value: '${GIN_MODE}'} - {name: SHOW_CLOWDER_VARS, value: ''} - {name: DB_DEBUG, value: '${DB_DEBUG_EVALUATOR_UPLOAD}'} @@ -232,6 +235,10 @@ objects: - {name: ENABLE_INSTANT_NOTIFICATIONS, value: '${ENABLE_INSTANT_NOTIFICATIONS}'} - {name: USE_VMAAS_GO, value: '${USE_VMAAS_GO}'} - {name: SSL_CERT_DIR, value: '${SSL_CERT_DIR}'} + - {name: GOGC, value: '${GOGC}'} # set garbage collection limit for go 1.18 + - {name: ENABLE_PROFILER, value: '${ENABLE_PROFILER_EVALUATOR_UPLOAD}'} + - {name: GOMEMLIMIT, value: '${GOMEMLIMIT_EVALUATOR}'} + - {name: ENABLE_SATELLITE_FUNCTIONALITY, value: '${ENABLE_SATELLITE_FUNCTIONALITY}'} resources: limits: {cpu: '${RES_LIMIT_CPU_EVALUATOR_UPLOAD}', memory: '${RES_LIMIT_MEM_EVALUATOR_UPLOAD}'} requests: {cpu: '${RES_REQUEST_CPU_EVALUATOR_UPLOAD}', memory: '${RES_REQUEST_MEM_EVALUATOR_UPLOAD}'} @@ -242,7 +249,7 @@ objects: public: enabled: true private: - enabled: false + enabled: true metrics: enabled: true podSpec: @@ -259,7 +266,6 @@ objects: - evaluator env: - {name: LOG_LEVEL, value: '${LOG_LEVEL_EVALUATOR_RECALC}'} - - {name: GOMAXPROCS, value: '${GOMAXPROCS_EVALUATOR_RECALC}'} - {name: GIN_MODE, value: '${GIN_MODE}'} - {name: SHOW_CLOWDER_VARS, value: ''} - {name: DB_DEBUG, value: '${DB_DEBUG_EVALUATOR_RECALC}'} @@ -297,6 +303,10 @@ objects: - {name: ENABLE_INSTANT_NOTIFICATIONS, value: '${ENABLE_INSTANT_NOTIFICATIONS}'} - {name: USE_VMAAS_GO, value: '${USE_VMAAS_GO}'} - {name: SSL_CERT_DIR, value: '${SSL_CERT_DIR}'} + - {name: GOGC, value: '${GOGC}'} # set garbage collection limit for go 1.18 + - {name: ENABLE_PROFILER, value: '${ENABLE_PROFILER_EVALUATOR_RECALC}'} + - {name: GOMEMLIMIT, value: '${GOMEMLIMIT_EVALUATOR}'} + - {name: ENABLE_SATELLITE_FUNCTIONALITY, value: '${ENABLE_SATELLITE_FUNCTIONALITY}'} resources: limits: {cpu: '${RES_LIMIT_CPU_EVALUATOR_RECALC}', memory: '${RES_LIMIT_MEM_EVALUATOR_RECALC}'} requests: {cpu: '${RES_REQUEST_CPU_EVALUATOR_RECALC}', memory: '${RES_REQUEST_MEM_EVALUATOR_RECALC}'} @@ -322,7 +332,6 @@ objects: - vmaas_sync env: - {name: LOG_LEVEL, value: '${LOG_LEVEL_JOBS}'} - - {name: GOMAXPROCS, value: '${GOMAXPROCS_JOBS}'} - {name: GIN_MODE, value: '${GIN_MODE}'} - {name: SHOW_CLOWDER_VARS, value: ''} - {name: DB_DEBUG, value: '${DB_DEBUG_JOBS}'} @@ -345,6 +354,8 @@ objects: - {name: PROMETHEUS_PUSHGATEWAY,value: '${PROMETHEUS_PUSHGATEWAY}'} - {name: FULL_SYNC_CADENCE,value: '${FULL_SYNC_CADENCE}'} - {name: SSL_CERT_DIR, value: '${SSL_CERT_DIR}'} + - {name: USE_VMAAS_GO, value: '${USE_VMAAS_GO}'} + - {name: GOMEMLIMIT, value: '${GOMEMLIMIT_VMAAS_SYNC}'} resources: limits: {cpu: '${RES_LIMIT_CPU_VMAAS_SYNC}', memory: '${RES_LIMIT_MEM_VMAAS_SYNC}'} requests: {cpu: '${RES_REQUEST_CPU_VMAAS_SYNC}', memory: '${RES_REQUEST_MEM_VMAAS_SYNC}'} @@ -369,7 +380,6 @@ objects: - system_culling env: - {name: LOG_LEVEL, value: '${LOG_LEVEL_JOBS}'} - - {name: GOMAXPROCS, value: '${GOMAXPROCS_JOBS}'} - {name: GIN_MODE, value: '${GIN_MODE}'} - {name: DB_DEBUG, value: '${DB_DEBUG_JOBS}'} - {name: DB_USER, value: vmaas_sync} @@ -400,12 +410,18 @@ objects: - packages_cache_refresh env: - {name: LOG_LEVEL, value: '${LOG_LEVEL_JOBS}'} - - {name: GOMAXPROCS, value: '${GOMAXPROCS_PKG_REFRESH}'} - {name: GIN_MODE, value: '${GIN_MODE}'} - {name: DB_DEBUG, value: '${DB_DEBUG_JOBS}'} - {name: DB_USER, value: vmaas_sync} - {name: DB_PASSWD, valueFrom: {secretKeyRef: {name: patchman-engine-database-passwords, key: vmaas-sync-database-password}}} + - {name: DB_HOST_READ_REPLICA, valueFrom: {secretKeyRef: {key: db.host, + name: patchman-db-readonly}}} + - {name: DB_PORT_READ_REPLICA, valueFrom: {secretKeyRef: {key: db.port, + name: patchman-db-readonly}}} + - {name: DB_READ_REPLICA_ENABLED, value: '${DB_READ_REPLICA_ENABLED_JOBS}'} + - {name: DB_WORK_MEM, value: '${DB_WORK_MEM}'} + - {name: PROMETHEUS_PUSHGATEWAY,value: '${PROMETHEUS_PUSHGATEWAY}'} - name: advisory-refresh activeDeadlineSeconds: ${{JOBS_TIMEOUT}} @@ -427,13 +443,13 @@ objects: - advisory_cache_refresh env: - {name: LOG_LEVEL, value: '${LOG_LEVEL_JOBS}'} - - {name: GOMAXPROCS, value: '${GOMAXPROCS_JOBS}'} - {name: GIN_MODE, value: '${GIN_MODE}'} - {name: DB_DEBUG, value: '${DB_DEBUG_JOBS}'} - {name: DB_USER, value: vmaas_sync} - {name: DB_PASSWD, valueFrom: {secretKeyRef: {name: patchman-engine-database-passwords, key: vmaas-sync-database-password}}} - {name: ENABLE_REFRESH_ADVISORY_CACHES, value: '${ENABLE_REFRESH_ADVISORY_CACHES}'} + - {name: SKIP_N_ACCOUNTS_REFRESH, value: '${SKIP_N_ACCOUNTS_REFRESH}'} - name: delete-unused activeDeadlineSeconds: ${{JOBS_TIMEOUT}} @@ -455,7 +471,6 @@ objects: - delete_unused env: - {name: LOG_LEVEL, value: '${LOG_LEVEL_JOBS}'} - - {name: GOMAXPROCS, value: '${GOMAXPROCS_JOBS}'} - {name: GIN_MODE, value: '${GIN_MODE}'} - {name: DB_DEBUG, value: '${DB_DEBUG_JOBS}'} - {name: DB_USER, value: vmaas_sync} @@ -541,9 +556,8 @@ objects: parameters: # Manager - {name: REPLICAS_MANAGER, value: '1'} -- {name: IMAGE_TAG_MANAGER, value: v3.1.27} +- {name: IMAGE_TAG_MANAGER, value: v3.5.7} - {name: LOG_LEVEL_MANAGER, value: debug} -- {name: GOMAXPROCS_MANAGER, value: '8'} - {name: DB_DEBUG_MANAGER, value: 'false'} # Log database queries if enabled - {name: ENABLE_CYNDI_TAGS, value: 'true'} # Enable filtering with Cyndi tags - {name: ENABLE_RBAC, value: 'true'} # Enable requesting RBAC service @@ -553,7 +567,7 @@ parameters: - {name: PRELOAD_ADVISORY_DETAIL_CACHE, value: 'true'} # Enable advisory detail cache preloading - {name: ENABLE_BASELINES_API, value: 'true'} # Enable baselines API endpoints - {name: ENABLE_BASELINE_CHANGE_EVAL, value: 'true'} # Send Kafka eval messages on baseline update -- {name: ENABLE_PACKAGE_CACHE_MANAGER, value: 'false'} # Enable caching for /packages endpoint +- {name: ENABLE_PACKAGE_CACHE_MANAGER, value: 'true'} # Enable caching for /packages endpoint - {name: EVAL_TOPIC_MANAGER, value: patchman.evaluator.upload} - {name: RES_LIMIT_CPU_MANAGER, value: 200m} - {name: RES_LIMIT_MEM_MANAGER, value: 256Mi} @@ -561,35 +575,39 @@ parameters: - {name: RES_REQUEST_MEM_MANAGER, value: 256Mi} - {name: RESPONSE_TIMEOUT, value: '60'} - {name: DB_READ_REPLICA_ENABLED, value: 'TRUE'} +- {name: ENABLE_PROFILER_MANAGER, value: 'false'} +- {name: GOMEMLIMIT_MANAGER, value: '230MiB'} # set to 90% of the default memory limit 256Mi (don't forget `B`) # Listener - {name: REPLICAS_LISTENER, value: '1'} -- {name: IMAGE_TAG_LISTENER, value: v3.1.27} +- {name: IMAGE_TAG_LISTENER, value: v3.5.7} - {name: LOG_LEVEL_LISTENER, value: debug} -- {name: GOMAXPROCS_LISTENER, value: '8'} - {name: DB_DEBUG_LISTENER, value: 'false'} - {name: CONSUMER_COUNT_LISTENER, value: '8'} - {name: ENABLE_BYPASS_LISTENER, value: 'false'} # Enable only bypass (fake) messages processing -- {name: EXCLUDED_REPORTERS, value: 'yupana'} # Comma-separated list of reporters to exclude from processing +- {name: EXCLUDED_REPORTERS, value: 'yupana,rhsm-conduit'} # Comma-separated list of reporters to exclude from processing - {name: EXCLUDED_HOST_TYPES, value: 'edge'} # Comma-separated list of host types to exclude from processing - {name: RES_LIMIT_CPU_LISTENER, value: 250m} -- {name: RES_LIMIT_MEM_LISTENER, value: 256Mi} +- {name: RES_LIMIT_MEM_LISTENER, value: 192Mi} - {name: RES_REQUEST_CPU_LISTENER, value: 250m} -- {name: RES_REQUEST_MEM_LISTENER, value: 256Mi} +- {name: RES_REQUEST_MEM_LISTENER, value: 192Mi} +- {name: ENABLE_PROFILER_LISTENER, value: 'false'} +- {name: GOMEMLIMIT_LISTENER, value: '172MiB'} # set to 90% of the default memory limit 192Mi (don't forget `B`) # Evaluator -- {name: USE_VMAAS_GO, value: 'false'} +- {name: USE_VMAAS_GO, value: 'true'} +- {name: GOGC, value: '100'} +- {name: GOMEMLIMIT_EVALUATOR, value: '922MiB'} # set to 90% of the default memory limit 1024Mi (don't forget `B`) # Evaluator - upload - {name: REPLICAS_EVALUATOR_UPLOAD, value: '1'} -- {name: IMAGE_TAG_EVALUATOR_UPLOAD, value: v3.1.27} +- {name: IMAGE_TAG_EVALUATOR_UPLOAD, value: v3.5.7} - {name: LOG_LEVEL_EVALUATOR_UPLOAD, value: debug} -- {name: GOMAXPROCS_EVALUATOR_UPLOAD, value: '8'} - {name: DB_DEBUG_EVALUATOR_UPLOAD, value: 'false'} - {name: CONSUMER_COUNT_EVALUATOR_UPLOAD, value: '8'} - {name: ENABLE_BYPASS_EVALUATOR_UPLOAD, value: 'false'} # Enable only bypass (fake) messages processing - {name: ENABLE_LAZY_PACKAGE_SAVE_EVALUATOR_UPLOAD, value: 'false'} # Enable unknown EVRAs saving during the evaluation -- {name: ENABLE_BASELINE_EVAL_EVALUATOR_UPLOAD, value: 'false'} # Take baselines into account during the evaluation +- {name: ENABLE_BASELINE_EVAL_EVALUATOR_UPLOAD, value: 'true'} # Take baselines into account during the evaluation - {name: ENABLE_ADVISORY_ANALYSIS_SAVE_EVALUATOR_UPLOAD, value: 'true'} - {name: ENABLE_PACKAGE_ANALYSIS_SAVE_EVALUATOR_UPLOAD, value: 'true'} - {name: ENABLE_REPO_ANALYSIS_SAVE_EVALUATOR_UPLOAD, value: 'true'} @@ -604,17 +622,18 @@ parameters: - {name: MAX_EVAL_GOROUTINES_UPLOAD, value: '1'} - {name: ENABLE_INSTANT_NOTIFICATIONS, value: 'true'} - {name: VMAAS_CACHE_SIZE, value: '10000'} +- {name: ENABLE_PROFILER_EVALUATOR_UPLOAD, value: 'false'} +- {name: ENABLE_SATELLITE_FUNCTIONALITY, value: 'false'} # Evaluator - recalc - {name: REPLICAS_EVALUATOR_RECALC, value: '1'} -- {name: IMAGE_TAG_EVALUATOR_RECALC, value: v3.1.27} +- {name: IMAGE_TAG_EVALUATOR_RECALC, value: v3.5.7} - {name: LOG_LEVEL_EVALUATOR_RECALC, value: debug} -- {name: GOMAXPROCS_EVALUATOR_RECALC, value: '8'} - {name: DB_DEBUG_EVALUATOR_RECALC, value: 'false'} - {name: CONSUMER_COUNT_EVALUATOR_RECALC, value: '8'} - {name: ENABLE_BYPASS_EVALUATOR_RECALC, value: 'false'} # Enable only bypass (fake) messages processing - {name: ENABLE_LAZY_PACKAGE_SAVE_EVALUATOR_RECALC, value: 'false'} # Enable unknown EVRAs saving during the evaluation -- {name: ENABLE_BASELINE_EVAL_EVALUATOR_RECALC, value: 'false'} # Take baselines into account during the evaluation +- {name: ENABLE_BASELINE_EVAL_EVALUATOR_RECALC, value: 'true'} # Take baselines into account during the evaluation - {name: ENABLE_ADVISORY_ANALYSIS_SAVE_EVALUATOR_RECALC, value: 'true'} - {name: ENABLE_PACKAGE_ANALYSIS_SAVE_EVALUATOR_RECALC, value: 'true'} - {name: ENABLE_REPO_ANALYSIS_SAVE_EVALUATOR_RECALC, value: 'true'} @@ -628,15 +647,15 @@ parameters: - {name: RES_REQUEST_MEM_EVALUATOR_RECALC, value: 1024Mi} - {name: MAX_EVAL_GOROUTINES_RECALC, value: '1'} - {name: ENABLE_INSTANT_NOTIFICATIONS, value: 'true'} +- {name: ENABLE_PROFILER_EVALUATOR_RECALC, value: 'false'} # JOBS -- {name: IMAGE_TAG_JOBS, value: v3.1.27} +- {name: IMAGE_TAG_JOBS, value: v3.5.7} - {name: LOG_LEVEL_JOBS, value: debug} -- {name: GOMAXPROCS_JOBS, value: '8'} -- {name: GOMAXPROCS_PKG_REFRESH, value: '1'} - {name: DB_DEBUG_JOBS, value: 'false'} - {name: JOBS_TIMEOUT, value: '1800'} # 30 min timeout for jobs - {name: PROMETHEUS_PUSHGATEWAY, required: true, value: "pushgateway"} +- {name: DB_READ_REPLICA_ENABLED_JOBS, value: 'TRUE'} # VMaaS sync - {name: VMAAS_SYNC_SCHEDULE, value: '*/5 * * * *'} # Cronjob schedule definition @@ -655,6 +674,7 @@ parameters: - {name: RES_REQUEST_CPU_VMAAS_SYNC, value: 500m} - {name: RES_REQUEST_MEM_VMAAS_SYNC, value: 384Mi} - {name: FULL_SYNC_CADENCE, value: '168'} # run full vmaas sync (default: 168h) +- {name: GOMEMLIMIT_VMAAS_SYNC, value: '345MiB'} # set to 90% of the default memory limit 384Mi (don't forget `B`) # Delete unused data - {name: DELETE_UNUSED_SCHEDULE, value: '10 */6 * * *'} # Cronjob schedule definition - {name: DELETE_UNUSED_SUSPEND, value: 'true'} # Disable cronjob execution @@ -667,15 +687,15 @@ parameters: - {name: ENABLE_CULLED_SYSTEM_DELETE, value: 'true'} # Enable deleting part of culling method - {name: ENABLE_SYSTEM_STALING, value: 'true'} # Enable marking systems stale of culling method # Cache refresh -- {name: PKG_REFRESH_SCHEDULE, value: '5 11-22 * * *'} # Cronjob schedule definition +- {name: PKG_REFRESH_SCHEDULE, value: '5 11-20/2 * * *'} # Cronjob schedule definition - {name: PKG_REFRESH_SUSPEND, value: 'false'} # Disable cronjob execution - {name: ADVISORY_REFRESH_SCHEDULE, value: '*/15 * * * *'} # Cronjob schedule definition - {name: ADVISORY_REFRESH_SUSPEND, value: 'false'} # Disable cronjob execution - {name: ENABLE_REFRESH_ADVISORY_CACHES, value: 'true'} # Enable periodic refresh of account advisory caches +- {name: SKIP_N_ACCOUNTS_REFRESH, value: '0'} # Skip advisory cache refresh for N first accounts in case the previous refresh didn't finish # Database admin -- {name: GOMAXPROCS_ADMIN, value: '8'} -- {name: IMAGE_TAG_DATABASE_ADMIN, value: v3.1.27} +- {name: IMAGE_TAG_DATABASE_ADMIN, value: v3.5.7} - {name: LOG_LEVEL_DATABASE_ADMIN, value: debug} - {name: DB_DEBUG_DATABASE_ADMIN, value: 'false'} - {name: SCHEMA_MIGRATION, value: '-1'} # Set specific database schema version or use the last schema version (-1) @@ -688,6 +708,7 @@ parameters: - {name: RES_REQUEST_MEM_DATABASE_ADMIN, value: 128Mi} - {name: UPDATE_USERS, value: 'false'} # set to true if we need to change user or passwords - {name: UPDATE_DB_CONFIG, value: 'false'} # set to true if we need to load new './database_admin/config.sql' +- {name: GOMEMLIMIT_DATABASE_ADMIN, value: '115MiB'} # set to 90% of the default memory limit 128Mi (don't forget `B`) # Common parameters - {name: IMAGE, value: quay.io/cloudservices/patchman-engine-app} @@ -703,9 +724,10 @@ parameters: - {name: MSG_BATCH_SIZE, value: '4000'} # BatchSize for PlatformEvent message - {name: ENABLE_PAYLOAD_TRACKER, value: 'true'} # Send status messages to payload tracker - {name: SSL_CERT_DIR, value: '/etc/ssl/certs:/etc/pki/tls/certs:/system/etc/security/cacerts:/cdapp/certs'} +- {name: DB_WORK_MEM, value: '512000'} # How much memory can query use (used for packages queries) in kB - 500MB, postgres default is 4MB # Turnpike -- {name: IMAGE_TAG_ADMIN, value: v3.1.27} +- {name: IMAGE_TAG_ADMIN, value: v3.5.7} - {name: ENABLE_TURNPIKE_AUTH, value: 'true'} # Enable Turnpike authentication for internal API (manual sync, re-calc) - {name: REPLICAS_ADMIN, value: '1'} - {name: RES_LIMIT_CPU_ADMIN, value: 100m} diff --git a/dev/create_inventory_hosts.sql b/dev/create_inventory_hosts.sql index c9f5ccdc1..63d9e1c62 100644 --- a/dev/create_inventory_hosts.sql +++ b/dev/create_inventory_hosts.sql @@ -14,38 +14,44 @@ $$ $$; CREATE TABLE IF NOT EXISTS inventory.hosts_v1_0 ( - id uuid NOT NULL, - insights_id uuid, - account character varying(10) NOT NULL, - display_name character varying(200) NOT NULL, - tags jsonb NOT NULL, - updated timestamp with time zone NOT NULL, - created timestamp with time zone NOT NULL, - stale_timestamp timestamp with time zone NOT NULL, - system_profile jsonb NOT NULL, - PRIMARY KEY (id) + id uuid PRIMARY KEY, + account character varying(10), + display_name character varying(200) NOT NULL, + tags jsonb NOT NULL, + updated timestamp with time zone NOT NULL, + created timestamp with time zone NOT NULL, + stale_timestamp timestamp with time zone NOT NULL, + system_profile jsonb NOT NULL, + insights_id uuid, + reporter character varying(255) NOT NULL, + per_reporter_staleness jsonb NOT NULL, + org_id character varying(36), + groups jsonb ); DELETE FROM inventory.hosts_v1_0; -CREATE INDEX IF NOT EXISTS hosts_v1_0_account_index ON inventory.hosts_v1_0 USING btree (account); -CREATE INDEX IF NOT EXISTS hosts_v1_0_display_name_index ON inventory.hosts_v1_0 USING btree (display_name); +CREATE INDEX IF NOT EXISTS hosts_v1_0_tags_index ON inventory.hosts_v1_0 USING GIN (tags JSONB_PATH_OPS); +CREATE INDEX IF NOT EXISTS hosts_v1_0_insights_reporter_index ON inventory.hosts_v1_0 (reporter); CREATE INDEX IF NOT EXISTS hosts_v1_0_stale_timestamp_index ON inventory.hosts_v1_0 USING btree (stale_timestamp); -CREATE INDEX IF NOT EXISTS hosts_v1_0_system_profile_index ON inventory.hosts_v1_0 USING gin (system_profile jsonb_path_ops); -CREATE INDEX IF NOT EXISTS hosts_v1_0_tags_index ON inventory.hosts_v1_0 USING gin (tags jsonb_path_ops); +CREATE INDEX IF NOT EXISTS hosts_v1_0_groups_index ON inventory.hosts_v1_0 USING GIN (groups JSONB_PATH_OPS); -CREATE OR REPLACE VIEW inventory.hosts AS - SELECT hosts_v1_0.id, - hosts_v1_0.insights_id, - hosts_v1_0.account, - hosts_v1_0.display_name, - hosts_v1_0.created, - hosts_v1_0.updated, - hosts_v1_0.stale_timestamp, - (hosts_v1_0.stale_timestamp + ('1 day'::interval day * '7'::double precision)) AS stale_warning_timestamp, - (hosts_v1_0.stale_timestamp + ('1 day'::interval day * '14'::double precision)) AS culled_timestamp, - hosts_v1_0.tags, - hosts_v1_0.system_profile - FROM inventory.hosts_v1_0; +CREATE OR REPLACE VIEW inventory.hosts AS SELECT + id, + account, + display_name, + created, + updated, + stale_timestamp, + stale_timestamp + INTERVAL '1' DAY * '7'::double precision AS stale_warning_timestamp, + stale_timestamp + INTERVAL '1' DAY * '14'::double precision AS culled_timestamp, + tags, + system_profile, + insights_id, + reporter, + per_reporter_staleness, + org_id, + groups +FROM inventory.hosts_v1_0; GRANT SELECT ON TABLE inventory.hosts TO cyndi_reader; diff --git a/dev/kafka/Dockerfile b/dev/kafka/Dockerfile index 12669bdcd..824ac10bd 100644 --- a/dev/kafka/Dockerfile +++ b/dev/kafka/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/confluentinc/cp-enterprise-kafka:7.0.5 +FROM docker.io/confluentinc/cp-kafka ADD /dev/kafka/entrypoint.sh /app/entrypoint.sh ADD /dev/kafka/setup.sh /app/setup.sh diff --git a/dev/kafka/entrypoint.sh b/dev/kafka/entrypoint.sh index 8ca2151a3..fda337410 100755 --- a/dev/kafka/entrypoint.sh +++ b/dev/kafka/entrypoint.sh @@ -1,16 +1,5 @@ #!/bin/sh -#wait until zookeeper is ready -IFS=: read zooserver zooport <<<"$KAFKA_ZOOKEEPER_CONNECT" -while : ; do - STATUS=$(nc $zooserver $zooport <<<"ruok" 2>/dev/null) - if [[ $STATUS == 'imok' ]] ; then - break - fi - >&2 echo "Waiting until zookeeper is running" - sleep 1 -done - /app/setup.sh 2>&1 | grep -v '^WARNING: Due to limitations in metric names' & exec /etc/confluent/docker/run 2>&1 \ diff --git a/dev/scripts/advisories_list.sh b/dev/scripts/advisories_list.sh index ccf546ca2..b2eaf06b9 100755 --- a/dev/scripts/advisories_list.sh +++ b/dev/scripts/advisories_list.sh @@ -2,4 +2,4 @@ IDENTITY="$($(dirname "$0")/identity.sh)" -curl -v -H "x-rh-identity: $IDENTITY" http://localhost:8080/api/patch/v2/advisories/ | python3 -m json.tool +curl -v -H "x-rh-identity: $IDENTITY" http://localhost:8080/api/patch/v2/advisories | python3 -m json.tool diff --git a/dev/scripts/advisory_systems.sh b/dev/scripts/advisory_systems.sh new file mode 100755 index 000000000..778b345c0 --- /dev/null +++ b/dev/scripts/advisory_systems.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +IDENTITY="$($(dirname "$0")/identity.sh)" +ADVISORY=${1:-RH-1} + +curl -v -H "x-rh-identity: $IDENTITY" http://localhost:8080/api/patch/v1/advisories/$ADVISORY/systems | python3 -m json.tool diff --git a/dev/scripts/identity.sh b/dev/scripts/identity.sh index 0b2bd030c..13f826fd3 100755 --- a/dev/scripts/identity.sh +++ b/dev/scripts/identity.sh @@ -1,7 +1,7 @@ #!/bin/bash # This identity contains account_name = "0" -ACCOUNT_NUMBER=${1:-"0"} +ACCOUNT_NUMBER=${1:-"org_1"} encode() { local input=$(> /etc/confluent/docker/zookeeper.properties.template && - echo '4lw.commands.whitelist=*' >> /etc/confluent/docker/zookeeper.properties.template && - /etc/confluent/docker/run" - kafka: container_name: kafka build: @@ -77,8 +65,6 @@ services: image: patchman-engine-kafka env_file: - ./conf/kafka.env - depends_on: - - zookeeper volumes: - ./dev/kafka/secrets:/etc/kafka/secrets - ./dev/kafka:/app @@ -121,6 +107,7 @@ services: ports: - 8080:8080 - 9080:9080 # metrics + - 9000:9000 # private port - pprof depends_on: - db - platform @@ -142,6 +129,7 @@ services: ports: - 8081:8080 - 9081:9080 # metrics + - 9002:9000 # private port - pprof depends_on: - db - platform @@ -163,6 +151,7 @@ services: command: ./dev/scripts/docker-compose-entrypoint.sh evaluator ports: - 8082:8080 + - 9003:9000 # private port - pprof depends_on: - db - platform @@ -184,6 +173,7 @@ services: command: ./dev/scripts/docker-compose-entrypoint.sh evaluator ports: - 8084:8080 + - 9004:9000 # private port - pprof depends_on: - db - platform diff --git a/docker-compose.test.yml b/docker-compose.test.yml index b410bfc52..5f9e6de96 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -12,18 +12,6 @@ services: env_file: - ./conf/database.env - zookeeper: - image: docker.io/confluentinc/cp-zookeeper:7.0.5 - container_name: zookeeper - env_file: - - ./conf/zookeeper.env - ports: - - 2181:2181 - command: sh -c " - echo 'admin.enableServer=false' >> /etc/confluent/docker/zookeeper.properties.template && - echo '4lw.commands.whitelist=*' >> /etc/confluent/docker/zookeeper.properties.template && - /etc/confluent/docker/run" - kafka: container_name: kafka build: @@ -32,8 +20,6 @@ services: image: patchman-engine-kafka env_file: - ./conf/kafka.env - depends_on: - - zookeeper volumes: - ./dev/kafka/secrets:/etc/kafka/secrets - ./dev/kafka:/app @@ -63,9 +49,13 @@ services: restart: unless-stopped ports: - 9001:9001 + volumes: + - ./conf/cdappconfig.json:/go/src/app/conf/cdappconfig.json depends_on: - kafka - db + security_opt: + - label=disable test: container_name: test diff --git a/docker-compose.yml b/docker-compose.yml index 42b4d6718..355267df1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,18 +55,6 @@ services: security_opt: - label=disable - zookeeper: - image: docker.io/confluentinc/cp-zookeeper:7.0.5 - container_name: zookeeper - env_file: - - ./conf/zookeeper.env - ports: - - 2181:2181 - command: sh -c " - echo 'admin.enableServer=false' >> /etc/confluent/docker/zookeeper.properties.template && - echo '4lw.commands.whitelist=*' >> /etc/confluent/docker/zookeeper.properties.template && - /etc/confluent/docker/run" - kafka: container_name: kafka build: @@ -75,8 +63,6 @@ services: image: patchman-engine-kafka env_file: - ./conf/kafka.env - depends_on: - - zookeeper volumes: - ./dev/kafka/secrets:/etc/kafka/secrets - ./dev/kafka:/app @@ -121,6 +107,7 @@ services: ports: - 8080:8080 - 9080:9080 # metrics + - 9000:9000 # private port - pprof depends_on: - db - platform @@ -141,6 +128,7 @@ services: ports: - 8081:8080 - 9081:9080 # metrics + - 9002:9000 # private port - pprof depends_on: - db - platform @@ -161,6 +149,7 @@ services: command: ./dev/scripts/docker-compose-entrypoint.sh evaluator ports: - 8082:8080 + - 9003:9000 # private port - pprof depends_on: - db - platform @@ -181,6 +170,7 @@ services: command: ./dev/scripts/docker-compose-entrypoint.sh evaluator ports: - 8084:8080 + - 9004:9000 # private port - pprof depends_on: - db - platform diff --git a/docs/admin/openapi.json b/docs/admin/openapi.json index b3ecb6338..c03669076 100644 --- a/docs/admin/openapi.json +++ b/docs/admin/openapi.json @@ -8,7 +8,7 @@ "name": "GPLv3", "url": "https://www.gnu.org/licenses/gpl-3.0.en.html" }, - "version": "v3.1.27" + "version": "v3.5.7" }, "servers": [ { @@ -63,6 +63,174 @@ ] } }, + "/pprof/evaluator_recalc/{param}": { + "get": { + "summary": "Get profile info", + "description": "Get profile info", + "operationId": "getEvaluatorRecalcPprof", + "parameters": [ + { + "name": "param", + "in": "path", + "description": "What to profile", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/octet-stream": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + }, + "security": [ + { + "RhIdentity": [] + } + ] + } + }, + "/pprof/evaluator_upload/{param}": { + "get": { + "summary": "Get profile info", + "description": "Get profile info", + "operationId": "getEvaluatorUploadPprof", + "parameters": [ + { + "name": "param", + "in": "path", + "description": "What to profile", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/octet-stream": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + }, + "security": [ + { + "RhIdentity": [] + } + ] + } + }, + "/pprof/listener/{param}": { + "get": { + "summary": "Get profile info", + "description": "Get profile info", + "operationId": "getListenerPprof", + "parameters": [ + { + "name": "param", + "in": "path", + "description": "What to profile", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/octet-stream": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + }, + "security": [ + { + "RhIdentity": [] + } + ] + } + }, + "/pprof/manager/{param}": { + "get": { + "summary": "Get profile info", + "description": "Get profile info", + "operationId": "getManagerPprof", + "parameters": [ + { + "name": "param", + "in": "path", + "description": "What to profile", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": {} + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/octet-stream": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + } + } + }, + "security": [ + { + "RhIdentity": [] + } + ] + } + }, "/re-calc": { "get": { "summary": "Re-evaluate systems", diff --git a/docs/md/database.md b/docs/md/database.md index b5d369501..62b7b787a 100644 --- a/docs/md/database.md +++ b/docs/md/database.md @@ -6,6 +6,9 @@ Main database tables description: - **advisory_metadata** - stores info about advisories (`description`, `summary`, `solution` etc.). It's synced and stored on trigger by `vmaas_sync` component. It allows to display detail information about the advisory. - **system_advisories** - stores info about advisories evaluated for particular systems (system - advisory M-N mapping table). Contains info when system advisory was firstly reported and patched (if so). Records are created and updated by `evaluator` component. It allows to display list of advisories related to a system. - **advisory_account_data** - stores info about all advisories detected within at least one system that belongs to a given account. So it provides overall statistics about system advisories displayed by the application. +- **package_name** - names of the packages installed on systems +- **package** - list of all packages versions, precisely all EVRAs (epoch-version-release-arch) +- **system_package** - list of packages installed on a system ## Schema ![](graphics/db_diagram.png) diff --git a/docs/md/graphics/db_diagram.png b/docs/md/graphics/db_diagram.png index 0159a8860..6238cf51c 100644 Binary files a/docs/md/graphics/db_diagram.png and b/docs/md/graphics/db_diagram.png differ diff --git a/docs/v3/openapi.json b/docs/v3/openapi.json index 7cdaf0894..c089574aa 100644 --- a/docs/v3/openapi.json +++ b/docs/v3/openapi.json @@ -8,7 +8,7 @@ "name": "GPLv3", "url": "https://www.gnu.org/licenses/gpl-3.0.en.html" }, - "version": "v3.1.27" + "version": "v3.5.7" }, "servers": [ { @@ -46,10 +46,11 @@ "type": "string", "enum": [ "id", - "name", - "advisory_type", + "advisory_type_name", "synopsis", "public_date", + "severity", + "installable_systems", "applicable_systems" ] } @@ -94,14 +95,6 @@ "type": "string" } }, - { - "name": "filter[advisory_type]", - "in": "query", - "description": "Filter", - "schema": { - "type": "string" - } - }, { "name": "filter[advisory_type_name]", "in": "query", @@ -147,6 +140,19 @@ } } }, + { + "name": "filter[group_name]", + "in": "query", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "name": "filter[system_profile][sap_system]", "in": "query", @@ -156,7 +162,7 @@ } }, { - "name": "filter[system_profile][sap_sids][in]", + "name": "filter[system_profile][sap_sids]", "in": "query", "description": "Filter systems by their SAP SIDs", "style": "form", @@ -359,7 +365,8 @@ "last_upload", "stale", "status", - "template" + "template", + "groups" ] } }, @@ -432,6 +439,19 @@ } } }, + { + "name": "filter[group_name]", + "in": "query", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "name": "filter[system_profile][sap_system]", "in": "query", @@ -441,7 +461,7 @@ } }, { - "name": "filter[system_profile][sap_sids][in]", + "name": "filter[system_profile][sap_sids]", "in": "query", "description": "Filter systems by their SAP SIDs", "style": "form", @@ -659,7 +679,7 @@ }, "put": { "summary": "Create a baseline for my set of systems", - "description": "Create a baseline for my set of systems", + "description": "Create a baseline for my set of systems. System cannot be satellite managed.", "operationId": "createBaseline", "requestBody": { "description": "Request body", @@ -848,7 +868,7 @@ }, "put": { "summary": "Update a baseline for my set of systems", - "description": "Update a baseline for my set of systems", + "description": "Update a baseline for my set of systems. System cannot be satellite managed.", "operationId": "updateBaseline", "parameters": [ { @@ -1034,7 +1054,8 @@ "applicable_rhba_count", "applicable_rhea_count", "applicable_other_count", - "last_upload" + "last_upload", + "groups" ] } }, @@ -1074,6 +1095,72 @@ "type": "string" } } + }, + { + "name": "filter[group_name]", + "in": "query", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "filter[system_profile][sap_system]", + "in": "query", + "description": "Filter only SAP systems", + "schema": { + "type": "string" + } + }, + { + "name": "filter[system_profile][sap_sids]", + "in": "query", + "description": "Filter systems by their SAP SIDs", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "filter[system_profile][ansible]", + "in": "query", + "description": "Filter systems by ansible", + "schema": { + "type": "string" + } + }, + { + "name": "filter[system_profile][ansible][controller_version]", + "in": "query", + "description": "Filter systems by ansible version", + "schema": { + "type": "string" + } + }, + { + "name": "filter[system_profile][mssql]", + "in": "query", + "description": "Filter systems by mssql version", + "schema": { + "type": "string" + } + }, + { + "name": "filter[system_profile][mssql][version]", + "in": "query", + "description": "Filter systems by mssql version", + "schema": { + "type": "string" + } } ], "responses": { @@ -1311,6 +1398,19 @@ "type": "string" } }, + { + "name": "filter[group_name]", + "in": "query", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "name": "filter[system_profile][sap_system]", "in": "query", @@ -1320,7 +1420,7 @@ } }, { - "name": "filter[system_profile][sap_sids][in]", + "name": "filter[system_profile][sap_sids]", "in": "query", "description": "Filter systems by their SAP SIDs", "style": "form", @@ -1476,24 +1576,19 @@ ] } }, - "/export/packages": { + "/export/baselines/{baseline_id}/systems": { "get": { - "summary": "Show me all installed packages across my systems", - "description": "Show me all installed packages across my systems", - "operationId": "exportPackages", + "summary": "Export systems belonging to a baseline", + "description": "Export systems applicable to a baseline", + "operationId": "exportBaselineSystems", "parameters": [ { - "name": "sort", - "in": "query", - "description": "Sort field", + "name": "baseline_id", + "in": "path", + "description": "Baseline ID", + "required": true, "schema": { - "type": "string", - "enum": [ - "id", - "name", - "systems_installed", - "systems_updatable" - ] + "type": "integer" } }, { @@ -1505,7 +1600,7 @@ } }, { - "name": "filter[name]", + "name": "filter[display_name]", "in": "query", "description": "Filter", "schema": { @@ -1513,7 +1608,7 @@ } }, { - "name": "filter[systems_installed]", + "name": "filter[os]", "in": "query", "description": "Filter", "schema": { @@ -1521,96 +1616,30 @@ } }, { - "name": "filter[systems_updatable]", + "name": "tags", "in": "query", - "description": "Filter", + "description": "Tag filter", + "style": "form", + "explode": true, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } }, { - "name": "filter[summary]", + "name": "filter[group_name]", "in": "query", - "description": "Filter", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/controllers.PackageItem" - } - } - }, - "text/csv": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/controllers.PackageItem" - } - } - } - } - }, - "415": { - "description": "Unsupported Media Type", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/utils.ErrorResponse" - } - }, - "text/csv": { - "schema": { - "$ref": "#/components/schemas/utils.ErrorResponse" - } - } - } - }, - "500": { - "description": "Internal Server Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/utils.ErrorResponse" - } - }, - "text/csv": { - "schema": { - "$ref": "#/components/schemas/utils.ErrorResponse" - } + "type": "array", + "items": { + "type": "string" } } - } - }, - "security": [ - { - "RhIdentity": [] - } - ] - } - }, - "/export/packages/{package_name}/systems": { - "get": { - "summary": "Show me all my systems which have a package installed", - "description": "Show me all my systems which have a package installed", - "operationId": "exportPackageSystems", - "parameters": [ - { - "name": "package_name", - "in": "path", - "description": "Package name", - "required": true, - "schema": { - "type": "string" - } }, { "name": "filter[system_profile][sap_system]", @@ -1621,7 +1650,7 @@ } }, { - "name": "filter[system_profile][sap_sids][in]", + "name": "filter[system_profile][sap_sids]", "in": "query", "description": "Filter systems by their SAP SIDs", "style": "form", @@ -1664,19 +1693,6 @@ "schema": { "type": "string" } - }, - { - "name": "tags", - "in": "query", - "description": "Tag filter", - "style": "form", - "explode": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } } ], "responses": { @@ -1687,7 +1703,15 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/controllers.PackageSystemItem" + "$ref": "#/components/schemas/controllers.BaselineSystemsDBLookup" + } + } + }, + "text/csv": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.BaselineSystemsDBLookup" } } } @@ -1700,6 +1724,11 @@ "schema": { "$ref": "#/components/schemas/utils.ErrorResponse" } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } } } }, @@ -1710,6 +1739,11 @@ "schema": { "$ref": "#/components/schemas/utils.ErrorResponse" } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } } } }, @@ -1720,7 +1754,295 @@ "schema": { "$ref": "#/components/schemas/utils.ErrorResponse" } - } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + } + }, + "security": [ + { + "RhIdentity": [] + } + ] + } + }, + "/export/packages": { + "get": { + "summary": "Show me all installed packages across my systems", + "description": "Show me all installed packages across my systems", + "operationId": "exportPackages", + "parameters": [ + { + "name": "sort", + "in": "query", + "description": "Sort field", + "schema": { + "type": "string", + "enum": [ + "id", + "name", + "systems_installed", + "systems_updatable" + ] + } + }, + { + "name": "search", + "in": "query", + "description": "Find matching text", + "schema": { + "type": "string" + } + }, + { + "name": "filter[name]", + "in": "query", + "description": "Filter", + "schema": { + "type": "string" + } + }, + { + "name": "filter[systems_installed]", + "in": "query", + "description": "Filter", + "schema": { + "type": "string" + } + }, + { + "name": "filter[systems_updatable]", + "in": "query", + "description": "Filter", + "schema": { + "type": "string" + } + }, + { + "name": "filter[summary]", + "in": "query", + "description": "Filter", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.PackageItem" + } + } + }, + "text/csv": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.PackageItem" + } + } + } + } + }, + "415": { + "description": "Unsupported Media Type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + }, + "text/csv": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + } + }, + "security": [ + { + "RhIdentity": [] + } + ] + } + }, + "/export/packages/{package_name}/systems": { + "get": { + "summary": "Show me all my systems which have a package installed", + "description": "Show me all my systems which have a package installed", + "operationId": "exportPackageSystems", + "parameters": [ + { + "name": "package_name", + "in": "path", + "description": "Package name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "filter[group_name]", + "in": "query", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "filter[system_profile][sap_system]", + "in": "query", + "description": "Filter only SAP systems", + "schema": { + "type": "string" + } + }, + { + "name": "filter[system_profile][sap_sids]", + "in": "query", + "description": "Filter systems by their SAP SIDs", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "filter[system_profile][ansible]", + "in": "query", + "description": "Filter systems by ansible", + "schema": { + "type": "string" + } + }, + { + "name": "filter[system_profile][ansible][controller_version]", + "in": "query", + "description": "Filter systems by ansible version", + "schema": { + "type": "string" + } + }, + { + "name": "filter[system_profile][mssql]", + "in": "query", + "description": "Filter systems by mssql version", + "schema": { + "type": "string" + } + }, + { + "name": "filter[system_profile][mssql][version]", + "in": "query", + "description": "Filter systems by mssql version", + "schema": { + "type": "string" + } + }, + { + "name": "tags", + "in": "query", + "description": "Tag filter", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.PackageSystemItemV3" + } + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + }, + "415": { + "description": "Unsupported Media Type", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } } }, "500": { @@ -1827,6 +2149,19 @@ "type": "string" } }, + { + "name": "filter[group_name]", + "in": "query", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "name": "filter[system_profile][sap_system]", "in": "query", @@ -1836,7 +2171,7 @@ } }, { - "name": "filter[system_profile][sap_sids][in]", + "name": "filter[system_profile][sap_sids]", "in": "query", "description": "Filter systems by their SAP SIDs", "style": "form", @@ -2212,7 +2547,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/controllers.SystemPackageInline" + "$ref": "#/components/schemas/controllers.SystemPackageInlineV3" } } } @@ -2397,6 +2732,19 @@ } } }, + { + "name": "filter[group_name]", + "in": "query", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "name": "filter[system_profile][sap_system]", "in": "query", @@ -2406,7 +2754,7 @@ } }, { - "name": "filter[system_profile][sap_sids][in]", + "name": "filter[system_profile][sap_sids]", "in": "query", "description": "Filter systems by their SAP SIDs", "style": "form", @@ -2546,7 +2894,9 @@ "rhba_count", "rhea_count", "other_count", - "stale" + "satellite_managed", + "stale", + "built_pkgcache" ] } }, @@ -2630,6 +2980,14 @@ "type": "string" } }, + { + "name": "filter[satellite_managed]", + "in": "query", + "description": "Filter", + "schema": { + "type": "string" + } + }, { "name": "filter[stale]", "in": "query", @@ -2702,6 +3060,14 @@ "type": "string" } }, + { + "name": "filter[built_pkgcache]", + "in": "query", + "description": "Filter", + "schema": { + "type": "string" + } + }, { "name": "tags", "in": "query", @@ -2715,6 +3081,19 @@ } } }, + { + "name": "filter[group_name]", + "in": "query", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "name": "filter[system_profile][sap_system]", "in": "query", @@ -2724,7 +3103,7 @@ } }, { - "name": "filter[system_profile][sap_sids][in]", + "name": "filter[system_profile][sap_sids]", "in": "query", "description": "Filter systems by their SAP SIDs", "style": "form", @@ -2737,35 +3116,175 @@ } }, { - "name": "filter[system_profile][ansible]", + "name": "filter[system_profile][ansible]", + "in": "query", + "description": "Filter systems by ansible", + "schema": { + "type": "string" + } + }, + { + "name": "filter[system_profile][ansible][controller_version]", + "in": "query", + "description": "Filter systems by ansible version", + "schema": { + "type": "string" + } + }, + { + "name": "filter[system_profile][mssql]", + "in": "query", + "description": "Filter systems by mssql version", + "schema": { + "type": "string" + } + }, + { + "name": "filter[system_profile][mssql][version]", + "in": "query", + "description": "Filter systems by mssql version", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/controllers.IDsStatusResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + } + }, + "security": [ + { + "RhIdentity": [] + } + ] + } + }, + "/ids/baselines/{baseline_id}/systems": { + "get": { + "summary": "Show me all systems belonging to a baseline", + "description": "Show me all systems applicable to a baseline", + "operationId": "listBaselineSystemsIds", + "parameters": [ + { + "name": "baseline_id", + "in": "path", + "description": "Baseline ID", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "limit", + "in": "query", + "description": "Limit for paging, set -1 to return all", + "schema": { + "type": "integer" + } + }, + { + "name": "offset", + "in": "query", + "description": "Offset for paging", + "schema": { + "type": "integer" + } + }, + { + "name": "sort", + "in": "query", + "description": "Sort field", + "schema": { + "type": "string", + "enum": [ + "id", + "display_name", + "os", + "installable_rhsa_count", + "installable_rhba_count", + "installable_rhea_count", + "installable_other_count", + "applicable_rhsa_count", + "applicable_rhba_count", + "applicable_rhea_count", + "applicable_other_count", + "last_upload" + ] + } + }, + { + "name": "search", "in": "query", - "description": "Filter systems by ansible", + "description": "Find matching text", "schema": { "type": "string" } }, { - "name": "filter[system_profile][ansible][controller_version]", + "name": "filter[display_name]", "in": "query", - "description": "Filter systems by ansible version", + "description": "Filter", "schema": { "type": "string" } }, { - "name": "filter[system_profile][mssql]", + "name": "filter[os]", "in": "query", - "description": "Filter systems by mssql version", + "description": "Filter", "schema": { "type": "string" } }, { - "name": "filter[system_profile][mssql][version]", + "name": "tags", "in": "query", - "description": "Filter systems by mssql version", + "description": "Tag filter", + "style": "form", + "explode": true, "schema": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } ], @@ -2862,6 +3381,19 @@ } } }, + { + "name": "filter[group_name]", + "in": "query", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "name": "filter[system_profile][sap_system]", "in": "query", @@ -2871,7 +3403,7 @@ } }, { - "name": "filter[system_profile][sap_sids][in]", + "name": "filter[system_profile][sap_sids]", "in": "query", "description": "Filter systems by their SAP SIDs", "style": "form", @@ -2922,7 +3454,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/controllers.IDsResponse" + "$ref": "#/components/schemas/controllers.IDsStatusResponse" } } } @@ -3003,7 +3535,9 @@ "other_count", "stale", "packages_installed", - "baseline_name" + "baseline_name", + "satellite_managed", + "built_pkgcache" ] } }, @@ -3135,6 +3669,22 @@ "type": "string" } }, + { + "name": "filter[satellite_managed]", + "in": "query", + "description": "Filter", + "schema": { + "type": "string" + } + }, + { + "name": "filter[built_pkgcache]", + "in": "query", + "description": "Filter", + "schema": { + "type": "string" + } + }, { "name": "tags", "in": "query", @@ -3148,6 +3698,19 @@ } } }, + { + "name": "filter[group_name]", + "in": "query", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "name": "filter[system_profile][sap_system]", "in": "query", @@ -3157,7 +3720,7 @@ } }, { - "name": "filter[system_profile][sap_sids][in]", + "name": "filter[system_profile][sap_sids]", "in": "query", "description": "Filter systems by their SAP SIDs", "style": "form", @@ -3358,7 +3921,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/controllers.IDsResponse" + "$ref": "#/components/schemas/controllers.IDsStatusResponse" } } } @@ -3433,7 +3996,8 @@ "id", "name", "systems_installed", - "systems_updatable" + "systems_installable", + "systems_applicable" ] } }, @@ -3462,7 +4026,15 @@ } }, { - "name": "filter[systems_updatable]", + "name": "filter[systems_installable]", + "in": "query", + "description": "Filter", + "schema": { + "type": "string" + } + }, + { + "name": "filter[systems_applicable]", "in": "query", "description": "Filter", "schema": { @@ -3490,6 +4062,19 @@ } } }, + { + "name": "filter[group_name]", + "in": "query", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "name": "filter[system_profile][sap_system]", "in": "query", @@ -3499,7 +4084,7 @@ } }, { - "name": "filter[system_profile][sap_sids][in]", + "name": "filter[system_profile][sap_sids]", "in": "query", "description": "Filter systems by their SAP SIDs", "style": "form", @@ -3702,6 +4287,19 @@ } } }, + { + "name": "filter[group_name]", + "in": "query", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "name": "filter[system_profile][sap_system]", "in": "query", @@ -3711,7 +4309,7 @@ } }, { - "name": "filter[system_profile][sap_sids][in]", + "name": "filter[system_profile][sap_sids]", "in": "query", "description": "Filter systems by their SAP SIDs", "style": "form", @@ -3754,6 +4352,14 @@ "schema": { "type": "string" } + }, + { + "name": "filter[updatable]", + "in": "query", + "description": "Filter", + "schema": { + "type": "boolean" + } } ], "responses": { @@ -3762,7 +4368,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/controllers.PackageSystemsResponse" + "$ref": "#/components/schemas/controllers.PackageSystemsResponseV3" } } } @@ -3924,7 +4530,8 @@ "other_count", "stale", "packages_installed", - "baseline_name" + "baseline_name", + "groups" ] } }, @@ -4069,6 +4676,19 @@ } } }, + { + "name": "filter[group_name]", + "in": "query", + "description": "Filter systems by inventory groups", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "name": "filter[system_profile][sap_system]", "in": "query", @@ -4078,7 +4698,7 @@ } }, { - "name": "filter[system_profile][sap_sids][in]", + "name": "filter[system_profile][sap_sids]", "in": "query", "description": "Filter systems by their SAP SIDs", "style": "form", @@ -4522,6 +5142,144 @@ "schema": { "type": "boolean" } + }, + { + "name": "filter[update_status]", + "in": "query", + "description": "Filter", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/controllers.SystemPackageResponseV3" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + } + }, + "security": [ + { + "RhIdentity": [] + } + ] + } + }, + "/systems/{inventory_id}/vmaas_json": { + "get": { + "summary": "Show me system's json request for VMaaS", + "description": "Show me system's json request for VMaaS", + "operationId": "systemVmaasJson", + "parameters": [ + { + "name": "inventory_id", + "in": "path", + "description": "Inventory ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/controllers.SystemVmaasJSONResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/utils.ErrorResponse" + } + } + } + } + }, + "security": [ + { + "RhIdentity": [] + } + ] + } + }, + "/systems/{inventory_id}/yum_updates": { + "get": { + "summary": "Show me system's yum_updates (client side evaluation data)", + "description": "Show me system's yum_updates (client side evaluation data)", + "operationId": "systemYumUpdates", + "parameters": [ + { + "name": "inventory_id", + "in": "path", + "description": "Inventory ID", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { @@ -4530,7 +5288,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/controllers.SystemPackageResponse" + "$ref": "#/components/schemas/controllers.SystemYumUpdatesResponse" } } } @@ -4649,8 +5407,8 @@ }, "/views/advisories/systems": { "post": { - "summary": "View advisory-system pairs for selected systems and advisories", - "description": "View advisory-system pairs for selected systems and advisories", + "summary": "View advisory-system pairs for selected systems and installable advisories", + "description": "View advisory-system pairs for selected systems and installable advisories", "operationId": "viewAdvisoriesSystems", "requestBody": { "description": "Request body", @@ -4705,8 +5463,8 @@ }, "/views/systems/advisories": { "post": { - "summary": "View system-advisory pairs for selected systems and advisories", - "description": "View system-advisory pairs for selected systems and advisories", + "summary": "View system-advisory pairs for selected systems and installable advisories", + "description": "View system-advisory pairs for selected systems and installable advisories", "operationId": "viewSystemsAdvisories", "requestBody": { "description": "Request body", @@ -4981,6 +5739,9 @@ "baseline_name": { "type": "string" }, + "built_pkgcache": { + "type": "boolean" + }, "created": { "type": "string" }, @@ -4990,6 +5751,12 @@ "display_name": { "type": "string" }, + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.SystemGroup" + } + }, "id": { "type": "string" }, @@ -5002,6 +5769,9 @@ "rhsm": { "type": "string" }, + "satellite_managed": { + "type": "boolean" + }, "stale": { "type": "boolean" }, @@ -5045,6 +5815,9 @@ "baseline_name": { "type": "string" }, + "built_pkgcache": { + "type": "boolean" + }, "created": { "type": "string" }, @@ -5054,6 +5827,12 @@ "display_name": { "type": "string" }, + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.SystemGroup" + } + }, "last_upload": { "type": "string" }, @@ -5063,6 +5842,9 @@ "rhsm": { "type": "string" }, + "satellite_managed": { + "type": "boolean" + }, "stale": { "type": "boolean" }, @@ -5224,6 +6006,12 @@ "description": "Baseline system display name", "example": "my-baselined-system" }, + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.SystemGroup" + } + }, "installable_other_count": { "type": "integer" }, @@ -5271,6 +6059,64 @@ } } }, + "controllers.BaselineSystemsDBLookup": { + "type": "object", + "properties": { + "applicable_other_count": { + "type": "integer" + }, + "applicable_rhba_count": { + "type": "integer" + }, + "applicable_rhea_count": { + "type": "integer" + }, + "applicable_rhsa_count": { + "type": "integer" + }, + "display_name": { + "type": "string", + "description": "Baseline system display name", + "example": "my-baselined-system" + }, + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.SystemGroup" + } + }, + "id": { + "type": "string" + }, + "installable_other_count": { + "type": "integer" + }, + "installable_rhba_count": { + "type": "integer" + }, + "installable_rhea_count": { + "type": "integer" + }, + "installable_rhsa_count": { + "type": "integer" + }, + "last_upload": { + "type": "string" + }, + "os": { + "type": "string" + }, + "rhsm": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.SystemTag" + } + } + } + }, "controllers.BaselineSystemsRemoveRequest": { "type": "object", "properties": { @@ -5434,6 +6280,17 @@ } } }, + "controllers.IDStatus": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, "controllers.IDsResponse": { "type": "object", "properties": { @@ -5445,6 +6302,23 @@ } } }, + "controllers.IDsStatusResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.IDStatus" + } + }, + "ids": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "controllers.Links": { "type": "object", "properties": { @@ -5570,20 +6444,26 @@ "summary": { "type": "string" }, - "systems_installed": { + "systems_applicable": { + "type": "integer" + }, + "systems_installable": { "type": "integer" }, - "systems_updatable": { + "systems_installed": { "type": "integer" } } }, - "controllers.PackageSystemItem": { + "controllers.PackageSystemItemV3": { "type": "object", "properties": { "available_evra": { "type": "string" }, + "baseline_id": { + "type": "integer" + }, "baseline_name": { "type": "string" }, @@ -5593,12 +6473,24 @@ "display_name": { "type": "string" }, + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.SystemGroup" + } + }, "id": { "type": "string" }, "installed_evra": { "type": "string" }, + "os": { + "type": "string" + }, + "rhsm": { + "type": "string" + }, "tags": { "type": "array", "items": { @@ -5607,16 +6499,19 @@ }, "updatable": { "type": "boolean" + }, + "update_status": { + "type": "string" } } }, - "controllers.PackageSystemsResponse": { + "controllers.PackageSystemsResponseV3": { "type": "object", "properties": { "data": { "type": "array", "items": { - "$ref": "#/components/schemas/controllers.PackageSystemItem" + "$ref": "#/components/schemas/controllers.PackageSystemItemV3" } }, "links": { @@ -5785,6 +6680,9 @@ "baseline_name": { "type": "string" }, + "built_pkgcache": { + "type": "boolean" + }, "created": { "type": "string" }, @@ -5794,6 +6692,12 @@ "display_name": { "type": "string" }, + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.SystemGroup" + } + }, "id": { "type": "string" }, @@ -5821,6 +6725,9 @@ "rhsm": { "type": "string" }, + "satellite_managed": { + "type": "boolean" + }, "stale": { "type": "boolean" }, @@ -5846,6 +6753,17 @@ } } }, + "controllers.SystemGroup": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, "controllers.SystemItem": { "type": "object", "properties": { @@ -5872,6 +6790,9 @@ "baseline_uptodate": { "type": "boolean" }, + "built_pkgcache": { + "type": "boolean" + }, "created": { "type": "string" }, @@ -5881,6 +6802,12 @@ "display_name": { "type": "string" }, + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.SystemGroup" + } + }, "insights_id": { "type": "string" }, @@ -5923,6 +6850,9 @@ "rhsm": { "type": "string" }, + "satellite_managed": { + "type": "boolean" + }, "stale": { "type": "boolean" }, @@ -5952,6 +6882,9 @@ "baseline_name": { "type": "string" }, + "built_pkgcache": { + "type": "boolean" + }, "created": { "type": "string" }, @@ -5961,6 +6894,12 @@ "display_name": { "type": "string" }, + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/controllers.SystemGroup" + } + }, "last_upload": { "type": "string" }, @@ -5985,6 +6924,9 @@ "rhsm": { "type": "string" }, + "satellite_managed": { + "type": "boolean" + }, "stale": { "type": "boolean" }, @@ -6016,7 +6958,7 @@ } } }, - "controllers.SystemPackageData": { + "controllers.SystemPackageDataV3": { "type": "object", "properties": { "description": { @@ -6034,6 +6976,9 @@ "updatable": { "type": "boolean" }, + "update_status": { + "type": "string" + }, "updates": { "type": "array", "items": { @@ -6042,7 +6987,7 @@ } } }, - "controllers.SystemPackageInline": { + "controllers.SystemPackageInlineV3": { "type": "object", "properties": { "description": { @@ -6051,7 +6996,10 @@ "evra": { "type": "string" }, - "latest_evra": { + "latest_applicable": { + "type": "string" + }, + "latest_installable": { "type": "string" }, "name": { @@ -6062,16 +7010,19 @@ }, "updatable": { "type": "boolean" + }, + "update_status": { + "type": "string" } } }, - "controllers.SystemPackageResponse": { + "controllers.SystemPackageResponseV3": { "type": "object", "properties": { "data": { "type": "array", "items": { - "$ref": "#/components/schemas/controllers.SystemPackageData" + "$ref": "#/components/schemas/controllers.SystemPackageDataV3" } }, "links": { @@ -6124,6 +7075,22 @@ } } }, + "controllers.SystemVmaasJSONResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/vmaas.UpdatesV3Request" + } + } + }, + "controllers.SystemYumUpdatesResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/vmaas.UpdatesV3Response" + } + } + }, "controllers.SystemsAdvisoriesRequest": { "type": "object", "properties": { @@ -6218,10 +7185,10 @@ "models.PackageUpdate": { "type": "object", "properties": { - "advisory": { + "evra": { "type": "string" }, - "evra": { + "status": { "type": "string" } } @@ -6233,6 +7200,136 @@ "type": "string" } } + }, + "vmaas.UpdatesV3Request": { + "type": "object", + "properties": { + "basearch": { + "type": "string" + }, + "epoch_required": { + "type": "boolean", + "description": "VMaaS will check package_list and return error if we provide package_list without epochs" + }, + "latest_only": { + "type": "boolean" + }, + "modules_list": { + "type": "array", + "items": { + "$ref": "#/components/schemas/vmaas.UpdatesV3RequestModulesList" + } + }, + "optimistic_updates": { + "type": "boolean", + "description": "Search for updates of unknown package EVRAs." + }, + "package_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "releasever": { + "type": "string" + }, + "repository_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "security_only": { + "type": "boolean" + }, + "third_party": { + "type": "boolean", + "description": "Include content from \\\"third party\\\" repositories into the response, disabled by default." + } + } + }, + "vmaas.UpdatesV3RequestModulesList": { + "type": "object", + "properties": { + "module_name": { + "type": "string" + }, + "module_stream": { + "type": "string" + } + } + }, + "vmaas.UpdatesV3Response": { + "type": "object", + "properties": { + "basearch": { + "type": "string" + }, + "build_pkgcache": { + "type": "boolean" + }, + "last_change": { + "type": "string" + }, + "modules_list": { + "type": "array", + "items": { + "$ref": "#/components/schemas/vmaas.UpdatesV3RequestModulesList" + } + }, + "releasever": { + "type": "string" + }, + "repository_list": { + "type": "array", + "items": { + "type": "string" + } + }, + "update_list": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/vmaas.UpdatesV3ResponseUpdateList" + } + } + } + }, + "vmaas.UpdatesV3ResponseAvailableUpdates": { + "type": "object", + "properties": { + "basearch": { + "type": "string" + }, + "erratum": { + "type": "string" + }, + "evra": { + "type": "string" + }, + "package": { + "type": "string" + }, + "package_name": { + "type": "string" + }, + "releasever": { + "type": "string" + }, + "repository": { + "type": "string" + } + } + }, + "vmaas.UpdatesV3ResponseUpdateList": { + "type": "object", + "properties": { + "available_updates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/vmaas.UpdatesV3ResponseAvailableUpdates" + } + } + } } }, "securitySchemes": { diff --git a/evaluator/evaluate.go b/evaluator/evaluate.go index 867b6203b..a4850c193 100644 --- a/evaluator/evaluate.go +++ b/evaluator/evaluate.go @@ -58,6 +58,8 @@ var ( enableYumUpdatesEval bool nEvalGoroutines int enableInstantNotifications bool + enableSatelliteFunctionality bool + errVmaasBadRequest = errors.New("vmaas bad request") ) const WarnPayloadTracker = "unable to send message to payload tracker" @@ -97,13 +99,17 @@ func configure() { enableYumUpdatesEval = utils.GetBoolEnvOrDefault("ENABLE_YUM_UPDATES_EVAL", true) nEvalGoroutines = utils.GetIntEnvOrDefault("MAX_EVAL_GOROUTINES", 1) enableInstantNotifications = utils.GetBoolEnvOrDefault("ENABLE_INSTANT_NOTIFICATIONS", true) + enableSatelliteFunctionality = utils.GetBoolEnvOrDefault("ENABLE_SATELLITE_FUNCTIONALITY", true) configureRemediations() configureNotifications() + configureStatus() } func Evaluate(ctx context.Context, event *mqueue.PlatformEvent, inventoryID, evaluationType string) error { tStart := time.Now() defer utils.ObserveSecondsSince(tStart, evaluationDuration.WithLabelValues(evaluationType)) + + utils.LogInfo("inventoryID", inventoryID, "Evaluating system") if enableBypass { evaluationCnt.WithLabelValues("bypassed").Inc() utils.LogInfo("inventoryID", inventoryID, "Evaluation bypassed") @@ -125,8 +131,10 @@ func Evaluate(ctx context.Context, event *mqueue.PlatformEvent, inventoryID, eva // increment `success` metric only if the system exists // don't count messages from `tryGetSystem` as success evaluationCnt.WithLabelValues("success").Inc() + utils.LogInfo("inventoryID", inventoryID, "evalLabel", evaluationType, "System evaluated successfully") + return nil } - utils.LogInfo("inventoryID", inventoryID, "evalLabel", evaluationType, "system evaluated successfully") + utils.LogInfo("inventoryID", inventoryID, "evalLabel", evaluationType, "System not evaluated") return nil } @@ -167,13 +175,17 @@ func runEvaluate( } func evaluateInDatabase(ctx context.Context, event *mqueue.PlatformEvent, inventoryID string) ( - *models.SystemPlatform, *vmaas.UpdatesV2Response, error) { + *models.SystemPlatform, *vmaas.UpdatesV3Response, error) { tx := database.Db.WithContext(base.Context).Begin() // Don't allow requested TX to hang around locking the rows defer tx.Rollback() - system := tryGetSystem(tx, event.AccountID, inventoryID, event.Timestamp) + system, err := tryGetSystem(tx, event.AccountID, inventoryID, event.Timestamp) + if err != nil { + return nil, nil, errors.Wrap(err, "unable to get system") + } if system == nil { + // warning logged in `tryGetSystem` return nil, nil, nil } @@ -182,6 +194,7 @@ func evaluateInDatabase(ctx context.Context, event *mqueue.PlatformEvent, invent return nil, nil, errors.Wrap(err, "unable to get updates data") } if updatesData == nil { + utils.LogWarn("inventoryID", inventoryID, "No vmaas updates") return nil, nil, nil } @@ -193,12 +206,12 @@ func evaluateInDatabase(ctx context.Context, event *mqueue.PlatformEvent, invent return system, vmaasData, nil } -func tryGetYumUpdates(system *models.SystemPlatform) (*vmaas.UpdatesV2Response, error) { +func tryGetYumUpdates(system *models.SystemPlatform) (*vmaas.UpdatesV3Response, error) { if system.YumUpdates == nil { return nil, nil } - var resp vmaas.UpdatesV2Response + var resp vmaas.UpdatesV3Response err := json.Unmarshal(system.YumUpdates, &resp) if err != nil { return nil, errors.Wrap(err, "unable to unmarshall yum updates") @@ -206,18 +219,44 @@ func tryGetYumUpdates(system *models.SystemPlatform) (*vmaas.UpdatesV2Response, updatesMap := resp.GetUpdateList() if len(updatesMap) == 0 { // TODO: do we need evaluationCnt.WithLabelValues("error-no-yum-packages").Inc()? + utils.LogWarn("inventoryID", system.GetInventoryID(), "No yum_updates") return nil, nil } + // set EVRA and package name + for k, v := range updatesMap { + updates := make([]vmaas.UpdatesV3ResponseAvailableUpdates, 0, len(v.GetAvailableUpdates())) + for _, u := range v.GetAvailableUpdates() { + nevra, err := utils.ParseNevra(u.GetPackage()) + if err != nil { + utils.LogWarn("package", u.GetPackage(), "Cannot parse package") + continue + } + updates = append(updates, vmaas.UpdatesV3ResponseAvailableUpdates{ + Repository: u.Repository, + Releasever: u.Releasever, + Basearch: u.Basearch, + Erratum: u.Erratum, + Package: u.Package, + PackageName: utils.PtrString(nevra.Name), + EVRA: utils.PtrString(nevra.EVRAStringE(true)), + }) + } + updatesMap[k] = &vmaas.UpdatesV3ResponseUpdateList{ + AvailableUpdates: &updates, + } + } return &resp, nil } -func evaluateWithVmaas(tx *gorm.DB, updatesData *vmaas.UpdatesV2Response, - system *models.SystemPlatform, event *mqueue.PlatformEvent) (*vmaas.UpdatesV2Response, error) { +func evaluateWithVmaas(tx *gorm.DB, updatesData *vmaas.UpdatesV3Response, + system *models.SystemPlatform, event *mqueue.PlatformEvent) (*vmaas.UpdatesV3Response, error) { if enableBaselineEval { - err := limitVmaasToBaseline(tx, system, updatesData) - if err != nil { - return nil, errors.Wrap(err, "Failed to evaluate baseline") + if !system.SatelliteManaged || (system.SatelliteManaged && !enableSatelliteFunctionality) { + err := limitVmaasToBaseline(tx, system, updatesData) + if err != nil { + return nil, errors.Wrap(err, "Failed to evaluate baseline") + } } } @@ -235,8 +274,8 @@ func evaluateWithVmaas(tx *gorm.DB, updatesData *vmaas.UpdatesV2Response, } func getUpdatesData(ctx context.Context, tx *gorm.DB, system *models.SystemPlatform) ( - *vmaas.UpdatesV2Response, error) { - var yumUpdates *vmaas.UpdatesV2Response + *vmaas.UpdatesV3Response, error) { + var yumUpdates *vmaas.UpdatesV3Response var yumErr error if enableYumUpdatesEval { yumUpdates, yumErr = tryGetYumUpdates(system) @@ -248,6 +287,13 @@ func getUpdatesData(ctx context.Context, tx *gorm.DB, system *models.SystemPlatf vmaasData, vmaasErr := getVmaasUpdates(ctx, tx, system) if vmaasErr != nil { + if errors.Is(vmaasErr, errVmaasBadRequest) { + // vmaas bad request means we either created wrong vmaas request + // or more likely we received package_list without epochs + // either way, we should skip this system and not fail hard which will cause pod to restart + utils.LogWarn("Vmaas response error - bad request, skipping system", vmaasErr.Error()) + return nil, nil + } // if there's no yum update fail hard otherwise only log warning and use yum data if yumUpdates == nil { return nil, errors.Wrap(vmaasErr, vmaasErr.Error()) @@ -255,17 +301,19 @@ func getUpdatesData(ctx context.Context, tx *gorm.DB, system *models.SystemPlatf utils.LogWarn("Vmaas response error, continuing with yum updates only", vmaasErr.Error()) } - // Try to merge YumUpdates and VMaaS updates - updatesData, err := utils.MergeVMaaSResponses(vmaasData, yumUpdates) - if err != nil { - return nil, err + if system.SatelliteManaged { + // satellite managed systems has vmaas updates APPLICABLE instead of INSTALLABLE + mergedUpdateList := vmaasData.GetUpdateList() + for nevra := range mergedUpdateList { + (*mergedUpdateList[nevra]).SetUpdatesInstallability(APPLICABLE) + } } - return updatesData, nil + return utils.MergeVMaaSResponses(yumUpdates, vmaasData) } func getVmaasUpdates(ctx context.Context, tx *gorm.DB, - system *models.SystemPlatform) (*vmaas.UpdatesV2Response, error) { + system *models.SystemPlatform) (*vmaas.UpdatesV3Response, error) { // first check if we have data in cache vmaasData, ok := memoryVmaasCache.Get(system.JSONChecksum) if ok { @@ -277,6 +325,7 @@ func getVmaasUpdates(ctx context.Context, tx *gorm.DB, } if updatesReq == nil { + // warning logged in `tryGetVmaasRequest` return nil, nil } @@ -288,6 +337,7 @@ func getVmaasUpdates(ctx context.Context, tx *gorm.DB, updatesReq.ThirdParty = utils.PtrBool(thirdParty) // enable "third_party" updates in VMaaS if needed useOptimisticUpdates := thirdParty || vmaasCallUseOptimisticUpdates updatesReq.OptimisticUpdates = utils.PtrBool(useOptimisticUpdates) + updatesReq.EpochRequired = utils.PtrBool(true) vmaasData, err = callVMaas(ctx, updatesReq) if err != nil { @@ -302,7 +352,7 @@ func getVmaasUpdates(ctx context.Context, tx *gorm.DB, func tryGetVmaasRequest(system *models.SystemPlatform) (*vmaas.UpdatesV3Request, error) { if system == nil || system.VmaasJSON == nil { evaluationCnt.WithLabelValues("error-parse-vmaas-json").Inc() - utils.LogWarn("inventory_id", system.InventoryID, "system with empty vmaas json") + utils.LogWarn("inventoryID", system.GetInventoryID(), "system with empty vmaas json") // skip the system // don't return error as it will cause panic of evaluator pod return nil, nil @@ -316,35 +366,44 @@ func tryGetVmaasRequest(system *models.SystemPlatform) (*vmaas.UpdatesV3Request, if len(updatesReq.PackageList) == 0 { evaluationCnt.WithLabelValues("error-no-packages").Inc() + utils.LogWarn("inventoryID", system.GetInventoryID(), "Empty package list") return nil, nil } if len(updatesReq.RepositoryList) == 0 { // system without any repositories won't have any advisories evaluated by vmaas evaluationCnt.WithLabelValues("error-no-repositories").Inc() + utils.LogWarn("inventoryID", system.GetInventoryID(), "Empty repository list") return nil, nil } return &updatesReq, nil } func tryGetSystem(tx *gorm.DB, accountID int, inventoryID string, - requested *types.Rfc3339Timestamp) *models.SystemPlatform { + requested *types.Rfc3339Timestamp) (*models.SystemPlatform, error) { system, err := loadSystemData(tx, accountID, inventoryID) - if err != nil || system.ID == 0 { + if err != nil { evaluationCnt.WithLabelValues("error-db-read-inventory-data").Inc() - return nil + return nil, errors.Wrap(err, "error loading system from DB") + } + if system.ID == 0 { + evaluationCnt.WithLabelValues("error-db-read-inventory-data").Inc() + utils.LogWarn("inventoryID", inventoryID, "System not found in DB") + return nil, nil } if system.Stale && !enableStaleSysEval { evaluationCnt.WithLabelValues("skipping-stale").Inc() - return nil + utils.LogWarn("inventoryID", inventoryID, "Skipping stale system") + return nil, nil } if requested != nil && system.LastEvaluation != nil && requested.Time().Before(*system.LastEvaluation) { evaluationCnt.WithLabelValues("skip-old-msg").Inc() - return nil + utils.LogWarn("inventoryID", inventoryID, "Skipping old message") + return nil, nil } - return system + return system, nil } func commitWithObserve(tx *gorm.DB) error { @@ -359,7 +418,7 @@ func commitWithObserve(tx *gorm.DB) error { } func evaluateAndStore(tx *gorm.DB, system *models.SystemPlatform, - vmaasData *vmaas.UpdatesV2Response, event *mqueue.PlatformEvent) error { + vmaasData *vmaas.UpdatesV3Response, event *mqueue.PlatformEvent) error { newSystemAdvisories, err := analyzeAdvisories(tx, system, vmaasData) if err != nil { return errors.Wrap(err, "Advisory analysis failed") @@ -381,7 +440,7 @@ func evaluateAndStore(tx *gorm.DB, system *models.SystemPlatform, err = publishNewAdvisoriesNotification(tx, system, event, system.RhAccountID, newSystemAdvisories) if err != nil { evaluationCnt.WithLabelValues("error-advisory-notification").Inc() - utils.LogError("orgID", event.GetOrgID(), "inventoryID", system.InventoryID, "err", err.Error(), + utils.LogError("orgID", event.GetOrgID(), "inventoryID", system.GetInventoryID(), "err", err.Error(), "publishing new advisories notification failed") } } @@ -482,19 +541,35 @@ func updateSystemPlatform(tx *gorm.DB, system *models.SystemPlatform, data["third_party"] = system.ThirdParty } - return tx.Model(system).Updates(data).Error + if enableSatelliteFunctionality && system.SatelliteManaged && system.BaselineID != nil { + data["baseline_id"] = nil + data["baseline_uptodate"] = nil + } + + err := tx.Model(system).Updates(data).Error + + now := time.Now() + if system.LastUpload.Sub(now) > time.Hour { + // log long evaluating systems + utils.LogWarn("id", system.InventoryID, "lastUpload", *system.LastUpload, "now", now, "uploadEvaluationDelay") + } + return err } -func callVMaas(ctx context.Context, request *vmaas.UpdatesV3Request) (*vmaas.UpdatesV2Response, error) { +func callVMaas(ctx context.Context, request *vmaas.UpdatesV3Request) (*vmaas.UpdatesV3Response, error) { tStart := time.Now() defer utils.ObserveSecondsSince(tStart, evaluationPartDuration.WithLabelValues("vmaas-updates-call")) vmaasCallFunc := func() (interface{}, *http.Response, error) { utils.LogTrace("request", *request, "vmaas /updates request") - vmaasData := vmaas.UpdatesV2Response{} + vmaasData := vmaas.UpdatesV3Response{} resp, err := vmaasClient.Request(&ctx, http.MethodPost, vmaasUpdatesURL, request, &vmaasData) - utils.LogDebug("status_code", utils.TryGetStatusCode(resp), "vmaas /updates call") + statusCode := utils.TryGetStatusCode(resp) + utils.LogDebug("status_code", statusCode, "vmaas /updates call") utils.LogTrace("response", resp, "vmaas /updates response") + if err != nil && statusCode == 400 { + err = errors.Wrap(errVmaasBadRequest, err.Error()) + } return &vmaasData, resp, err } @@ -503,7 +578,7 @@ func callVMaas(ctx context.Context, request *vmaas.UpdatesV3Request) (*vmaas.Upd if err != nil { return nil, errors.Wrap(err, "vmaas /v3/updates API call failed") } - return vmaasDataPtr.(*vmaas.UpdatesV2Response), nil + return vmaasDataPtr.(*vmaas.UpdatesV3Response), nil } func loadSystemData(tx *gorm.DB, accountID int, inventoryID string) (*models.SystemPlatform, error) { @@ -523,16 +598,15 @@ func loadSystemData(tx *gorm.DB, accountID int, inventoryID string) (*models.Sys func parseVmaasJSON(system *models.SystemPlatform) (vmaas.UpdatesV3Request, error) { tStart := time.Now() defer utils.ObserveSecondsSince(tStart, evaluationPartDuration.WithLabelValues("parse-vmaas-json")) - - var updatesReq vmaas.UpdatesV3Request - err := json.Unmarshal([]byte(*system.VmaasJSON), &updatesReq) - return updatesReq, err + return utils.ParseVmaasJSON(system) } -func invalidatePkgCache(orgID string) error { +func invalidateCaches(orgID string) error { err := database.Db.Model(models.RhAccount{}). Where("org_id = ?", orgID). - Update("valid_package_cache", false). + Where("valid_package_cache = true OR valid_advisory_cache = true"). + // use map because struct updates only non-zero values and we need to update it to `false` + Updates(map[string]interface{}{"valid_package_cache": false, "valid_advisory_cache": false}). Error return err } @@ -570,8 +644,8 @@ func evaluateHandler(event mqueue.PlatformEvent) error { } wg.Wait() - if cacheErr := invalidatePkgCache(event.GetOrgID()); cacheErr != nil { - utils.LogError("err", err.Error(), "org_id", event.GetOrgID(), "Couldn't invalidate pkg cache") + if cacheErr := invalidateCaches(event.GetOrgID()); cacheErr != nil { + utils.LogError("err", err.Error(), "org_id", event.GetOrgID(), "Couldn't invalidate caches") } // send kafka message to payload tracker @@ -589,7 +663,10 @@ func loadCache() { memoryPackageCache = NewPackageCache(enablePackageCache, preloadPackageCache, packageCacheSize, packageNameCacheSize) memoryPackageCache.Load() memoryVmaasCache = NewVmaasPackageCache(enableVmaasCache, vmaasCacheSize, vmaasCacheCheckDuration) - go memoryVmaasCache.CheckValidity() + if memoryVmaasCache.enabled { + // no need to check cache validity when cache is not enabled + go memoryVmaasCache.CheckValidity() + } } func run(wg *sync.WaitGroup, readerBuilder mqueue.CreateReader) { @@ -611,6 +688,9 @@ func run(wg *sync.WaitGroup, readerBuilder mqueue.CreateReader) { func RunEvaluator() { var wg sync.WaitGroup + + go utils.RunProfiler() + run(&wg, mqueue.NewKafkaReaderFromEnv) wg.Wait() utils.LogInfo("evaluator completed") diff --git a/evaluator/evaluate_advisories.go b/evaluator/evaluate_advisories.go index 00c3c32e3..e5605f787 100644 --- a/evaluator/evaluate_advisories.go +++ b/evaluator/evaluate_advisories.go @@ -12,12 +12,7 @@ import ( "gorm.io/gorm/clause" ) -const ( - INSTALLABLE = 0 - APPLICABLE = 1 -) - -func analyzeAdvisories(tx *gorm.DB, system *models.SystemPlatform, vmaasData *vmaas.UpdatesV2Response) ( +func analyzeAdvisories(tx *gorm.DB, system *models.SystemPlatform, vmaasData *vmaas.UpdatesV3Response) ( SystemAdvisoryMap, error) { if !enableAdvisoryAnalysis { utils.LogInfo("advisory analysis disabled, skipping") @@ -41,13 +36,13 @@ func analyzeAdvisories(tx *gorm.DB, system *models.SystemPlatform, vmaasData *vm // Changes data stored in system_advisories, in order to match newest evaluation // Before this methods stores the entries into the system_advisories table, it locks // advisory_account_data table, so other evaluations don't interfere with this one -func processSystemAdvisories(tx *gorm.DB, system *models.SystemPlatform, vmaasData *vmaas.UpdatesV2Response) ( +func processSystemAdvisories(tx *gorm.DB, system *models.SystemPlatform, vmaasData *vmaas.UpdatesV3Response) ( []int64, []int64, []int64, error) { tStart := time.Now() defer utils.ObserveSecondsSince(tStart, evaluationPartDuration.WithLabelValues("advisories-processing")) reported := getReportedAdvisories(vmaasData) - oldSystemAdvisories, err := getStoredAdvisoriesMap(tx, system.RhAccountID, int(system.ID)) + oldSystemAdvisories, err := getStoredAdvisoriesMap(tx, system.RhAccountID, system.ID) if err != nil { return nil, nil, nil, errors.Wrap(err, "Unable to get system stored advisories") } @@ -98,7 +93,7 @@ func storeAdvisoryData(tx *gorm.DB, system *models.SystemPlatform, return newSystemAdvisories, nil } -func getStoredAdvisoriesMap(tx *gorm.DB, accountID, systemID int) (map[string]models.SystemAdvisories, error) { +func getStoredAdvisoriesMap(tx *gorm.DB, accountID int, systemID int64) (map[string]models.SystemAdvisories, error) { var advisories []models.SystemAdvisories err := database.SystemAdvisoriesBySystemID(tx, accountID, systemID).Preload("Advisory").Find(&advisories).Error if err != nil { @@ -118,7 +113,7 @@ func getAdvisoryChanges(reported map[string]int, stored map[string]models.System applicableNames := make([]string, 0, len(reported)) deleteIDs := make([]int64, 0, len(stored)) for reportedAdvisory, statusID := range reported { - if _, found := stored[reportedAdvisory]; !found { + if advisory, found := stored[reportedAdvisory]; !found || advisory.StatusID != statusID { if statusID == INSTALLABLE { installableNames = append(installableNames, reportedAdvisory) } else { @@ -164,10 +159,8 @@ func ensureSystemAdvisories(tx *gorm.DB, rhAccountID int, systemID int64, instal StatusID: APPLICABLE}) } - txOnConflict := tx.Clauses(clause.OnConflict{ - DoNothing: true, - }) - err := database.BulkInsert(txOnConflict, advisoriesObjs) + tx = database.OnConflictUpdateMulti(tx, []string{"rh_account_id", "system_id", "advisory_id"}, "status_id") + err := database.BulkInsert(tx, advisoriesObjs) return err } @@ -192,11 +185,6 @@ func calcAdvisoryChanges(system *models.SystemPlatform, deleteIDs, installableID return []models.AdvisoryAccountData{} } - isApplicable := make(map[int64]bool, len(applicableIDs)) - for _, id := range applicableIDs { - isApplicable[id] = true - } - aadMap := make(map[int64]models.AdvisoryAccountData, len(installableIDs)) for _, id := range installableIDs { @@ -209,6 +197,19 @@ func calcAdvisoryChanges(system *models.SystemPlatform, deleteIDs, installableID } } + isApplicable := make(map[int64]bool, len(applicableIDs)) + for _, id := range applicableIDs { + isApplicable[id] = true + // add advisories which are only applicable and not installable to aad + if _, ok := aadMap[id]; !ok { + aadMap[id] = models.AdvisoryAccountData{ + AdvisoryID: id, + RhAccountID: system.RhAccountID, + SystemsApplicable: 1, + } + } + } + for _, id := range deleteIDs { aadMap[id] = models.AdvisoryAccountData{ AdvisoryID: id, @@ -223,7 +224,7 @@ func calcAdvisoryChanges(system *models.SystemPlatform, deleteIDs, installableID } } - deltas := make([]models.AdvisoryAccountData, 0, len(deleteIDs)+len(installableIDs)) + deltas := make([]models.AdvisoryAccountData, 0, len(deleteIDs)+len(installableIDs)+len(applicableIDs)) for _, aad := range aadMap { deltas = append(deltas, aad) } diff --git a/evaluator/evaluate_advisories_test.go b/evaluator/evaluate_advisories_test.go index 11fcb8c5e..a9dd671ff 100644 --- a/evaluator/evaluate_advisories_test.go +++ b/evaluator/evaluate_advisories_test.go @@ -38,18 +38,18 @@ func TestGetReportedAdvisories1(t *testing.T) { } func TestGetReportedAdvisories2(t *testing.T) { - aUpdates := []vmaas.UpdatesV2ResponseAvailableUpdates{ + aUpdates := []vmaas.UpdatesV3ResponseAvailableUpdates{ {Erratum: utils.PtrString("ER1")}, {Erratum: utils.PtrString("ER2")}} - bUpdates := []vmaas.UpdatesV2ResponseAvailableUpdates{ + bUpdates := []vmaas.UpdatesV3ResponseAvailableUpdates{ {Erratum: utils.PtrString("ER2")}, {Erratum: utils.PtrString("ER3")}} - cUpdates := []vmaas.UpdatesV2ResponseAvailableUpdates{ + cUpdates := []vmaas.UpdatesV3ResponseAvailableUpdates{ {Erratum: utils.PtrString("ER3")}, {Erratum: utils.PtrString("ER4")}} - updateList := map[string]vmaas.UpdatesV2ResponseUpdateList{ + updateList := map[string]*vmaas.UpdatesV3ResponseUpdateList{ "pkg-a": {AvailableUpdates: &aUpdates}, "pkg-b": {AvailableUpdates: &bUpdates}, "pkg-c": {AvailableUpdates: &cUpdates}, } - vmaasData := vmaas.UpdatesV2Response{UpdateList: &updateList} + vmaasData := vmaas.UpdatesV3Response{UpdateList: &updateList} advisories := getReportedAdvisories(&vmaasData) assert.Equal(t, 4, len(advisories)) } @@ -126,9 +126,9 @@ func TestEnsureSystemAdvisories(t *testing.T) { database.DeleteSystemAdvisories(t, systemID, advisoryIDs) } -func getVMaaSUpdates(t *testing.T) vmaas.UpdatesV2Response { +func getVMaaSUpdates(t *testing.T) vmaas.UpdatesV3Response { ctx := context.Background() - vmaasData := vmaas.UpdatesV2Response{} + vmaasData := vmaas.UpdatesV3Response{} resp, err := vmaasClient.Request(&ctx, http.MethodPost, vmaasUpdatesURL, nil, &vmaasData) assert.Nil(t, err) assert.Equal(t, http.StatusOK, resp.StatusCode) diff --git a/evaluator/evaluate_baseline.go b/evaluator/evaluate_baseline.go index 451e173a0..6b3990c3b 100644 --- a/evaluator/evaluate_baseline.go +++ b/evaluator/evaluate_baseline.go @@ -9,7 +9,7 @@ import ( "gorm.io/gorm" ) -func limitVmaasToBaseline(tx *gorm.DB, system *models.SystemPlatform, vmaasData *vmaas.UpdatesV2Response) error { +func limitVmaasToBaseline(tx *gorm.DB, system *models.SystemPlatform, vmaasData *vmaas.UpdatesV3Response) error { baselineConfig := database.GetBaselineConfig(tx, system) if baselineConfig == nil { return nil // no baseline config, nothing to change @@ -35,7 +35,9 @@ func limitVmaasToBaseline(tx *gorm.DB, system *models.SystemPlatform, vmaasData filterOutNamesSet[i] = struct{}{} } - for _, updates := range vmaasData.GetUpdateList() { + updateList := vmaasData.GetUpdateList() + modifiedUpdateList := make(map[string]*vmaas.UpdatesV3ResponseUpdateList, len(updateList)) + for pkg, updates := range updateList { availableUpdates := updates.GetAvailableUpdates() for i := range availableUpdates { advisoryName := availableUpdates[i].GetErratum() @@ -45,7 +47,12 @@ func limitVmaasToBaseline(tx *gorm.DB, system *models.SystemPlatform, vmaasData availableUpdates[i].StatusID = INSTALLABLE } } + updates.AvailableUpdates = &availableUpdates + modifiedUpdateList[pkg] = updates } + if vmaasData != nil && vmaasData.UpdateList != nil { + vmaasData.UpdateList = &modifiedUpdateList + } return nil } diff --git a/evaluator/evaluate_baseline_test.go b/evaluator/evaluate_baseline_test.go index 007e79862..aa9ad44c2 100644 --- a/evaluator/evaluate_baseline_test.go +++ b/evaluator/evaluate_baseline_test.go @@ -41,7 +41,7 @@ func TestLimitVmaasToBaseline(t *testing.T) { assert.Equal(t, []string{"RH-1", "RH-2"}, errataInVmaasData(vmaasData, APPLICABLE)) } -func errataInVmaasData(vmaasData vmaas.UpdatesV2Response, status int) []string { +func errataInVmaasData(vmaasData vmaas.UpdatesV3Response, status int) []string { errata := make([]string, 0) for _, updates := range vmaasData.GetUpdateList() { availableUpdates := updates.GetAvailableUpdates() diff --git a/evaluator/evaluate_packages.go b/evaluator/evaluate_packages.go index 86558a5db..9079e023c 100644 --- a/evaluator/evaluate_packages.go +++ b/evaluator/evaluate_packages.go @@ -15,7 +15,7 @@ import ( "gorm.io/gorm/clause" ) -func analyzePackages(tx *gorm.DB, system *models.SystemPlatform, vmaasData *vmaas.UpdatesV2Response) ( +func analyzePackages(tx *gorm.DB, system *models.SystemPlatform, vmaasData *vmaas.UpdatesV3Response) ( installed, updatable int, err error) { if !enablePackageAnalysis { return 0, 0, nil @@ -42,7 +42,7 @@ func analyzePackages(tx *gorm.DB, system *models.SystemPlatform, vmaasData *vmaa } // Add unknown EVRAs into the db if needed -func lazySavePackages(tx *gorm.DB, vmaasData *vmaas.UpdatesV2Response) error { +func lazySavePackages(tx *gorm.DB, vmaasData *vmaas.UpdatesV3Response) error { if !enableLazyPackageSave { return nil } @@ -58,7 +58,7 @@ func lazySavePackages(tx *gorm.DB, vmaasData *vmaas.UpdatesV2Response) error { } // Get packages with known name but version missing in db/cache -func getMissingPackages(tx *gorm.DB, vmaasData *vmaas.UpdatesV2Response) models.PackageSlice { +func getMissingPackages(tx *gorm.DB, vmaasData *vmaas.UpdatesV3Response) models.PackageSlice { updates := vmaasData.GetUpdateList() packages := make(models.PackageSlice, 0, len(updates)) for nevra := range updates { @@ -150,7 +150,7 @@ func updatePackageCache(missing models.PackageSlice) { // Find relevant package data based on vmaas results func loadPackages(tx *gorm.DB, system *models.SystemPlatform, - vmaasData *vmaas.UpdatesV2Response) (*map[string]namedPackage, error) { + vmaasData *vmaas.UpdatesV3Response) (*map[string]namedPackage, error) { defer utils.ObserveSecondsSince(time.Now(), evaluationPartDuration.WithLabelValues("packages-load")) packages, err := loadSystemNEVRAsFromDB(tx, system, vmaasData) @@ -166,20 +166,14 @@ func packages2NevraMap(packages []namedPackage) map[string]namedPackage { pkgByNevra := make(map[string]namedPackage, len(packages)) for _, p := range packages { // make sure nevra contains epoch even if epoch==0 - nevra, err := utils.ParseNameEVRA(p.Name, p.EVRA) - if err != nil { - utils.LogWarn("package_id", p.PackageID, "name_id", p.NameID, "name", p.Name, "evra", p.EVRA, - "packages2NevraMap: cannot parse evra") - continue - } - nevraString := nevra.StringE(true) + nevraString := utils.NEVRAStringE(p.Name, p.EVRA, true) pkgByNevra[nevraString] = p } return pkgByNevra } func loadSystemNEVRAsFromDB(tx *gorm.DB, system *models.SystemPlatform, - vmaasData *vmaas.UpdatesV2Response) ([]namedPackage, error) { + vmaasData *vmaas.UpdatesV3Response) ([]namedPackage, error) { updates := vmaasData.GetUpdateList() numUpdates := len(updates) packageIDs := make([]int64, 0, numUpdates) @@ -257,10 +251,10 @@ func updateDataChanged(currentNamedPackage *namedPackage, updateDataJSON []byte) } func createSystemPackage(nevra string, - updateData vmaas.UpdatesV2ResponseUpdateList, + updateData *vmaas.UpdatesV3ResponseUpdateList, system *models.SystemPlatform, packagesByNEVRA *map[string]namedPackage) (systemPackagePtr *models.SystemPackage, updatesChanged bool) { - updateDataJSON, err := vmaasResponse2UpdateDataJSON(&updateData) + updateDataJSON, err := vmaasResponse2UpdateDataJSON(updateData) if err != nil { utils.LogError("nevra", nevra, "VMaaS updates response parsing failed") return nil, false @@ -284,7 +278,7 @@ func createSystemPackage(nevra string, func updateSystemPackages(tx *gorm.DB, system *models.SystemPlatform, packagesByNEVRA *map[string]namedPackage, - vmaasData *vmaas.UpdatesV2Response) (installed, updatable int, err error) { + vmaasData *vmaas.UpdatesV3Response) (installed, updatable int, err error) { defer utils.ObserveSecondsSince(time.Now(), evaluationPartDuration.WithLabelValues("packages-store")) updates := vmaasData.GetUpdateList() @@ -308,8 +302,6 @@ func updateSystemPackages(tx *gorm.DB, system *models.SystemPlatform, toStore = append(toStore, *systemPackagePtr) } } - tx = database.OnConflictUpdateMulti(tx, []string{"rh_account_id", "system_id", "package_id"}, "update_data") - // return installed, updatable, errors.Wrap(database.BulkInsert(tx, toStore), "Storing system packages") return installed, updatable, errors.Wrap( database.UnnestInsert(tx, "INSERT INTO system_package (rh_account_id, system_id, package_id, update_data, name_id)"+ @@ -318,28 +310,42 @@ func updateSystemPackages(tx *gorm.DB, system *models.SystemPlatform, "Storing system packages") } -func vmaasResponse2UpdateDataJSON(updateData *vmaas.UpdatesV2ResponseUpdateList) ([]byte, error) { +func vmaasResponse2UpdateDataJSON(updateData *vmaas.UpdatesV3ResponseUpdateList) ([]byte, error) { + var latestInstallable models.PackageUpdate + var latestApplicable models.PackageUpdate uniqUpdates := make(map[models.PackageUpdate]bool) pkgUpdates := make([]models.PackageUpdate, 0, len(updateData.GetAvailableUpdates())) for _, upData := range updateData.GetAvailableUpdates() { - upNevra, err := utils.ParseNevra(upData.GetPackage()) - // Skip invalid nevras in updates list - if err != nil { - utils.LogWarn("nevra", upData.Package, "Invalid nevra") + if len(upData.GetPackage()) == 0 { + // no update continue } + // before we used nevra.EVRAString() function which shows only non zero epoch, keep it consistent + evra := strings.TrimPrefix(upData.GetEVRA(), "0:") // Keep only unique entries for each update in the list pkgUpdate := models.PackageUpdate{ - EVRA: upNevra.EVRAString(), Advisory: upData.GetErratum(), + EVRA: evra, Advisory: upData.GetErratum(), Status: STATUS[upData.StatusID], } if !uniqUpdates[pkgUpdate] { pkgUpdates = append(pkgUpdates, pkgUpdate) uniqUpdates[pkgUpdate] = true + switch upData.StatusID { + case INSTALLABLE: + latestInstallable = pkgUpdate + case APPLICABLE: + latestApplicable = pkgUpdate + } } } if prunePackageLatestOnly && len(pkgUpdates) > 1 { - pkgUpdates = pkgUpdates[len(pkgUpdates)-1:] + pkgUpdates = make([]models.PackageUpdate, 0, 2) + if latestInstallable.EVRA != "" { + pkgUpdates = append(pkgUpdates, latestInstallable) + } + if latestApplicable.EVRA != "" { + pkgUpdates = append(pkgUpdates, latestApplicable) + } } var updateDataJSON []byte diff --git a/evaluator/evaluate_packages_test.go b/evaluator/evaluate_packages_test.go index b167c1aed..5784e0556 100644 --- a/evaluator/evaluate_packages_test.go +++ b/evaluator/evaluate_packages_test.go @@ -23,13 +23,14 @@ func TestAnalyzePackages(t *testing.T) { database.CheckEVRAsInDB(t, 0, "12.0.1-1.fc31.x86_64") // lazy added package // we send request with zero epoch and expect response with zero epoch // so we have to test with zero epoch - vmaasData := vmaas.UpdatesV2Response{UpdateList: &map[string]vmaas.UpdatesV2ResponseUpdateList{ - "kernel-0:5.6.13-200.fc31.x86_64": {AvailableUpdates: &[]vmaas.UpdatesV2ResponseAvailableUpdates{}}, - "firefox-0:12.0.1-1.fc31.x86_64": {AvailableUpdates: &[]vmaas.UpdatesV2ResponseAvailableUpdates{{ + vmaasData := vmaas.UpdatesV3Response{UpdateList: &map[string]*vmaas.UpdatesV3ResponseUpdateList{ + "kernel-0:5.6.13-200.fc31.x86_64": {AvailableUpdates: &[]vmaas.UpdatesV3ResponseAvailableUpdates{}}, + "firefox-0:12.0.1-1.fc31.x86_64": {AvailableUpdates: &[]vmaas.UpdatesV3ResponseAvailableUpdates{{ Package: utils.PtrString("firefox-0:77.0.1-1.fc31.x86_64"), + EVRA: utils.PtrString("0:77.0.1-1.fc31.x86_64"), }}}, // this custom-package will NOT be ignored - "custom-package-0:1.2.3-1.fc33.x86_64": {AvailableUpdates: &[]vmaas.UpdatesV2ResponseAvailableUpdates{{}}}}} + "custom-package-0:1.2.3-1.fc33.x86_64": {AvailableUpdates: &[]vmaas.UpdatesV3ResponseAvailableUpdates{{}}}}} installed, updatable, err := analyzePackages(database.Db, &system, &vmaasData) assert.Nil(t, err) @@ -51,12 +52,12 @@ func TestLazySavePackages(t *testing.T) { names := []string{"kernel", "firefox", "custom-package"} evras := []string{"1-0.el7.x86_64", "1-1.1.el7.x86_64", "11-1.el7.x86_64"} - updateList := make(map[string]vmaas.UpdatesV2ResponseUpdateList, len(names)) + updateList := make(map[string]*vmaas.UpdatesV3ResponseUpdateList, len(names)) for i, name := range names { nevra := fmt.Sprintf("%s-%s", name, evras[i]) - updateList[nevra] = vmaas.UpdatesV2ResponseUpdateList{} + updateList[nevra] = &vmaas.UpdatesV3ResponseUpdateList{} } - vmaasData := vmaas.UpdatesV2Response{UpdateList: &updateList} + vmaasData := vmaas.UpdatesV3Response{UpdateList: &updateList} database.CheckEVRAsInDB(t, 0, evras...) err := lazySavePackages(database.Db, &vmaasData) assert.Nil(t, err) diff --git a/evaluator/evaluate_test.go b/evaluator/evaluate_test.go index 53a93aad8..bda7adbea 100644 --- a/evaluator/evaluate_test.go +++ b/evaluator/evaluate_test.go @@ -8,6 +8,7 @@ import ( "app/base/utils" "app/base/vmaas" "context" + "encoding/json" "net/http" "os" "sync" @@ -28,6 +29,10 @@ func TestEvaluate(t *testing.T) { utils.SkipWithoutDB(t) utils.SkipWithoutPlatform(t) core.SetupTestEnvironment() + // don't use vmaas-cache since tests here are not using vmaas_json + // so it will always get the same result from cache for empty vmaas_json + os.Setenv("ENABLE_VMAAS_CACHE", "false") + defer os.Setenv("ENABLE_VMAAS_CACHE", "true") configure() loadCache() @@ -172,7 +177,7 @@ func TestVMaaSUpdatesCall(t *testing.T) { PackageList: []string{"curl-7.29.0-51.el7_6.3.x86_64"}, } - resp := vmaas.UpdatesV2Response{} + resp := vmaas.UpdatesV3Response{} ctx := context.Background() httpResp, err := vmaasClient.Request(&ctx, http.MethodPost, vmaasUpdatesURL, &req, &resp) // nolint: bodyclose assert.Nil(t, err) @@ -215,3 +220,176 @@ func TestGetYumUpdates(t *testing.T) { assert.NotNil(t, updates) assert.Equal(t, 2, len(updateList.GetAvailableUpdates())) } + +// nolint:funlen +func TestSatelliteSystemAdvisories(t *testing.T) { + utils.SkipWithoutDB(t) + utils.SkipWithoutPlatform(t) + core.SetupTestEnvironment() + + ogYumUpdatesEval := enableYumUpdatesEval + enableYumUpdatesEval = true + defer func() { enableYumUpdatesEval = ogYumUpdatesEval }() + + configure() + loadCache() + mockWriter := mqueue.MockKafkaWriter{} + remediationsPublisher = &mockWriter + + vmaasJSON := ` + { + "package_list": [ + "git-2.30.1-1.el8_8.x86_64", + "sqlite-3.21.0-1.el8_6.x86_64" + ], + "repository_list": [ + "rhel-8-for-x86_64-appstream-rpms" + ], + "releasever": "8", + "basearch": "x86_64", + "latest_only": true + } + ` + // this satellite system has 2 git and 1 sqlite advisories reported by vmaas (APPLICABLE) + vmaasDataResp := ` + { + "update_list": { + "git-2.30.1-1.el8_8.x86_64": { + "available_updates": [ + { + "erratum": "RHSA-2023:3246", + "basearch": "x86_64", + "releasever": "8", + "repository": "rhel-8-for-x86_64-appstream-rpms", + "package": "git-2.39.3-1.el8_8.x86_64", + "package_name": "git", + "evra": "0:2.39.3-1.el8_8.x86_64" + }, + { + "erratum": "RHSA-2023:3240", + "basearch": "x86_64", + "releasever": "8", + "repository": "rhel-8-for-x86_64-appstream-rpms", + "package": "git-2.39.4-1.el8_8.x86_64", + "package_name": "git", + "evra": "0:2.39.4-1.el8_8.x86_64" + } + ] + }, + "sqlite-3.21.0-1.el8_6.x86_64": { + "available_updates": [ + { + "erratum": "RHSA-2022:7100", + "basearch": "x86_64", + "releasever": "8", + "repository": "rhel-8-for-x86_64-appstream-rpms", + "package": "sqlite-3.26.0-16.el8_6.x86_64", + "package_name": "sqlite", + "evra": "0:3.26.0-16.el8_6.x86_64" + } + ] + } + } + } + ` + + var vmaasData vmaas.UpdatesV3Response + err := json.Unmarshal([]byte(vmaasDataResp), &vmaasData) + assert.Nil(t, err) + + // lets add the checksum to the cache, so we do not actually call vmaas + vmaasJSONChecksum := "1337" + memoryVmaasCache.Add(&vmaasJSONChecksum, &vmaasData) + + // this satellite system has 1 git installable advisory which is the same as the applicable one from vmaas + // and 1 sqlite different installable advisory + yumUpdatesRaw := []byte(` + { + "update_list": { + "git-2.30.1-1.el8_8.x86_64": { + "available_updates": [ + { + "erratum": "RHSA-2023:3246", + "basearch": "x86_64", + "releasever": "8", + "repository": "rhel-8-for-x86_64-appstream-rpms", + "package": "git-0:2.39.3-1.el8_8.x86_64" + } + ] + }, + "sqlite-3.21.0-1.el8_6.x86_64": { + "available_updates": [ + { + "erratum": "RHSA-2022:7108", + "basearch": "x86_64", + "releasever": "8", + "repository": "rhel-8-for-x86_64-appstream-rpms", + "package": "sqlite-3.26.0-16.el8_6.x86_64" + } + ] + } + } + } + `) + + system := models.SystemPlatform{ + InventoryID: "99999999-0000-0000-0000-000000000015", + JSONChecksum: &vmaasJSONChecksum, + VmaasJSON: &vmaasJSON, + YumUpdates: yumUpdatesRaw, + DisplayName: "satellite_system_test1", + RhAccountID: 1, + BuiltPkgcache: true, + SatelliteManaged: true, + } + tx := database.Db.Create(&system) + assert.Nil(t, tx.Error) + + result, err := getUpdatesData(context.Background(), database.Db, &system) + assert.Nil(t, err) + + // result should have 2 git advisories, 1 is installable (taken from yum updates and vmaas, merged) + // 1 is applicable (taken from vmaas) + // 2 sqlite advisories, 1 is installable (taken from yum updates) + // 1 is applicable (taken from vmaas) + var installableCnt, applicableCnt int + for _, updates := range result.GetUpdateList() { + for _, update := range updates.GetAvailableUpdates() { + if update.StatusID == INSTALLABLE { + installableCnt++ + } else if update.StatusID == APPLICABLE { + applicableCnt++ + } + } + } + assert.Equal(t, 2, installableCnt) + assert.Equal(t, 2, applicableCnt) + + database.Db.Delete(system) +} + +func TestCallVmaas400(t *testing.T) { + utils.SkipWithoutDB(t) + utils.SkipWithoutPlatform(t) + configure() + req := vmaas.UpdatesV3Request{TestReturnStatus: 400} + _, err := callVMaas(context.Background(), &req) + assert.ErrorIs(t, err, errVmaasBadRequest) +} + +func TestGetUpdatesDataVmaas400(t *testing.T) { + utils.SkipWithoutDB(t) + utils.SkipWithoutPlatform(t) + configure() + loadCache() + req := vmaas.UpdatesV3Request{ + TestReturnStatus: 400, PackageList: []string{"pkg"}, RepositoryList: []string{"repo"}, + } + reqJSON, _ := json.Marshal(req) + reqString := string(reqJSON) + sp := models.SystemPlatform{VmaasJSON: &reqString} + res, err := getUpdatesData(context.Background(), database.Db, &sp) + // response and error should be nil, system is skipped due to VMaaS 400 + assert.Nil(t, err) + assert.Nil(t, res) +} diff --git a/evaluator/package_cache.go b/evaluator/package_cache.go index b2660ef17..34460e661 100644 --- a/evaluator/package_cache.go +++ b/evaluator/package_cache.go @@ -8,7 +8,7 @@ import ( "time" rpm "github.com/ezamriy/gorpm" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" "gorm.io/gorm" ) @@ -30,10 +30,10 @@ type PackageCache struct { preload bool size int nameSize int - byID *lru.Cache - byNevra *lru.Cache - latestByName *lru.Cache - nameByID *lru.Cache + byID *lru.Cache[int64, *PackageCacheMetadata] + byNevra *lru.Cache[string, *PackageCacheMetadata] + latestByName *lru.Cache[string, *PackageCacheMetadata] + nameByID *lru.Cache[int64, *PackageCacheMetadata] } func NewPackageCache(enabled bool, preload bool, size int, nameSize int) *PackageCache { @@ -51,25 +51,25 @@ func NewPackageCache(enabled bool, preload bool, size int, nameSize int) *Packag if c.enabled { var err error - c.byID, err = lru.New(c.size) + c.byID, err = lru.New[int64, *PackageCacheMetadata](c.size) if err != nil { panic(err) } - c.byNevra, err = lru.New(c.size) + c.byNevra, err = lru.New[string, *PackageCacheMetadata](c.size) if err != nil { panic(err) } - c.latestByName, err = lru.New(c.nameSize) + c.latestByName, err = lru.New[string, *PackageCacheMetadata](c.nameSize) if err != nil { panic(err) } - c.nameByID, err = lru.New(c.nameSize) + c.nameByID, err = lru.New[int64, *PackageCacheMetadata](c.nameSize) if err != nil { panic(err) } return c } - return nil + return c } func (c *PackageCache) Load() { @@ -127,8 +127,7 @@ func (c *PackageCache) GetByID(id int64) (*PackageCacheMetadata, bool) { if ok { packageCacheCnt.WithLabelValues("hit", "id").Inc() utils.LogTrace("id", id, "PackageCache.GetByID cache hit") - metadata := val.(*PackageCacheMetadata) - return metadata, true + return val, true } } @@ -149,8 +148,7 @@ func (c *PackageCache) GetByNevra(nevra string) (*PackageCacheMetadata, bool) { if ok { packageCacheCnt.WithLabelValues("hit", "nevra").Inc() utils.LogTrace("nevra", nevra, "PackageCache.GetByNevra cache hit") - metadata := val.(*PackageCacheMetadata) - return metadata, true + return val, true } } @@ -171,8 +169,7 @@ func (c *PackageCache) GetLatestByName(name string) (*PackageCacheMetadata, bool if ok { packageCacheCnt.WithLabelValues("hit", "name").Inc() utils.LogTrace("name", name, "PackageCache.GetLatestByName cache hit") - metadata := val.(*PackageCacheMetadata) - return metadata, true + return val, true } } @@ -193,8 +190,7 @@ func (c *PackageCache) GetNameByID(id int64) (string, bool) { if ok { packageCacheCnt.WithLabelValues("hit", "nameByID").Inc() utils.LogTrace("id", id, "PackageCache.GetNameByID cache hit") - metadata := val.(*PackageCacheMetadata) - return metadata.Name, true + return val.Name, true } } @@ -218,21 +214,19 @@ func (c *PackageCache) Add(pkg *PackageCacheMetadata) { func (c *PackageCache) addByID(pkg *PackageCacheMetadata) { evicted := c.byID.Add(pkg.ID, pkg) - packageCacheGauge.WithLabelValues("id").Inc() + if !evicted { + packageCacheGauge.WithLabelValues("id").Inc() + } utils.LogTrace("byID", pkg.ID, "evicted", evicted, "PackageCache.addByID") } func (c *PackageCache) addByNevra(pkg *PackageCacheMetadata) { // make sure nevra contains epoch even if epoch==0 - nevra, err := utils.ParseNameEVRA(pkg.Name, pkg.Evra) - if err != nil { - utils.LogWarn("id", pkg.ID, "name_id", pkg.NameID, "name", pkg.Name, "evra", pkg.Evra, - "PackageCache.addByNevra: cannot parse evra") - return - } - nevraString := nevra.StringE(true) + nevraString := utils.NEVRAStringE(pkg.Name, pkg.Evra, true) evicted := c.byNevra.Add(nevraString, pkg) - packageCacheGauge.WithLabelValues("nevra").Inc() + if !evicted { + packageCacheGauge.WithLabelValues("nevra").Inc() + } utils.LogTrace("byNevra", nevraString, "evicted", evicted, "PackageCache.addByNevra") } @@ -240,13 +234,15 @@ func (c *PackageCache) addLatestByName(pkg *PackageCacheMetadata) { var latestEvra string latest, ok := c.latestByName.Peek(pkg.Name) if ok { - latestEvra = latest.(*PackageCacheMetadata).Evra + latestEvra = latest.Evra } if !ok || rpm.Vercmp(pkg.Evra, latestEvra) > 0 { // if there is no record yet // or it has older EVR we have to replace it evicted := c.latestByName.Add(pkg.Name, pkg) - packageCacheGauge.WithLabelValues("name").Inc() + if !evicted { + packageCacheGauge.WithLabelValues("name").Inc() + } utils.LogTrace("latestByName", pkg.Name, "evicted", evicted, "PackageCache.addLatestByName") } } @@ -255,7 +251,9 @@ func (c *PackageCache) addNameByID(pkg *PackageCacheMetadata) { ok, evicted := c.nameByID.ContainsOrAdd(pkg.NameID, pkg) if !ok { // name was not there and we've added it - packageCacheGauge.WithLabelValues("nameByID").Inc() + if !evicted { + packageCacheGauge.WithLabelValues("nameByID").Inc() + } utils.LogTrace("nameByID", pkg.NameID, "evicted", evicted, "PackageCache.addNameByID") } } diff --git a/evaluator/remediations.go b/evaluator/remediations.go index e4b81f56f..8ea58e4f8 100644 --- a/evaluator/remediations.go +++ b/evaluator/remediations.go @@ -25,7 +25,7 @@ type RemediationsState struct { Issues []string `json:"issues"` } -func createRemediationsStateMsg(id string, response *vmaas.UpdatesV2Response) *RemediationsState { +func createRemediationsStateMsg(id string, response *vmaas.UpdatesV3Response) *RemediationsState { advisories := getReportedAdvisories(response) packages := getReportedPackageUpdates(response) var state RemediationsState @@ -41,7 +41,7 @@ func createRemediationsStateMsg(id string, response *vmaas.UpdatesV2Response) *R return &state } -func getReportedAdvisories(vmaasData *vmaas.UpdatesV2Response) map[string]int { +func getReportedAdvisories(vmaasData *vmaas.UpdatesV3Response) map[string]int { updateList := vmaasData.GetUpdateList() advisories := make(map[string]int, len(updateList)) for _, updates := range updateList { @@ -52,7 +52,7 @@ func getReportedAdvisories(vmaasData *vmaas.UpdatesV2Response) map[string]int { return advisories } -func getReportedPackageUpdates(vmaasData *vmaas.UpdatesV2Response) map[string]bool { +func getReportedPackageUpdates(vmaasData *vmaas.UpdatesV3Response) map[string]bool { updateList := vmaasData.GetUpdateList() packages := make(map[string]bool, len(updateList)) for _, updates := range updateList { @@ -63,7 +63,7 @@ func getReportedPackageUpdates(vmaasData *vmaas.UpdatesV2Response) map[string]bo return packages } -func publishRemediationsState(system *models.SystemPlatform, response *vmaas.UpdatesV2Response) error { +func publishRemediationsState(system *models.SystemPlatform, response *vmaas.UpdatesV3Response) error { if remediationsPublisher == nil { return nil } diff --git a/evaluator/remediations_test.go b/evaluator/remediations_test.go index bd55554b7..86e5803cc 100644 --- a/evaluator/remediations_test.go +++ b/evaluator/remediations_test.go @@ -8,17 +8,17 @@ import ( "github.com/stretchr/testify/assert" ) -var testFfUpdates = []vmaas.UpdatesV2ResponseAvailableUpdates{ +var testFfUpdates = []vmaas.UpdatesV3ResponseAvailableUpdates{ {Repository: utils.PtrString("repo1"), Releasever: utils.PtrString("ser1"), Basearch: utils.PtrString("i686"), Erratum: utils.PtrString("RH-1"), Package: utils.PtrString("firefox-0:77.0.1-1.fc31.x86_64")}, {Repository: utils.PtrString("repo1"), Releasever: utils.PtrString("ser1"), Basearch: utils.PtrString("i686"), Erratum: utils.PtrString("RH-2"), Package: utils.PtrString("firefox-1:76.0.1-1.fc31.x86_64")}, } -var testKUpdates = []vmaas.UpdatesV2ResponseAvailableUpdates{ +var testKUpdates = []vmaas.UpdatesV3ResponseAvailableUpdates{ {Repository: utils.PtrString("repo1"), Releasever: utils.PtrString("ser1"), Basearch: utils.PtrString("i686"), Erratum: utils.PtrString("RH-100"), Package: utils.PtrString("kernel-5.10.13-200.fc31.x86_64")}, } -var testUpdateList = map[string]vmaas.UpdatesV2ResponseUpdateList{ +var testUpdateList = map[string]*vmaas.UpdatesV3ResponseUpdateList{ "firefox-76.0.1-1.fc31.x86_64": { AvailableUpdates: &testFfUpdates, }, @@ -27,7 +27,7 @@ var testUpdateList = map[string]vmaas.UpdatesV2ResponseUpdateList{ }, } var testModuleList = []vmaas.UpdatesV3RequestModulesList{} -var testVmaasResponse = vmaas.UpdatesV2Response{ +var testVmaasResponse = vmaas.UpdatesV3Response{ UpdateList: &testUpdateList, RepositoryList: utils.PtrSliceString([]string{"repo1"}), ModulesList: &testModuleList, diff --git a/evaluator/status.go b/evaluator/status.go new file mode 100644 index 000000000..a15d2b282 --- /dev/null +++ b/evaluator/status.go @@ -0,0 +1,26 @@ +package evaluator + +import "app/base/database" + +var STATUS = make(map[int]string, 2) + +const INSTALLABLE = 0 +const APPLICABLE = 1 + +type statusRow struct { + ID int + Name string +} + +func configureStatus() { + var rows []statusRow + + err := database.Db.Table("status s").Select("id, name").Scan(&rows).Error + if err != nil { + panic(err) + } + + for _, r := range rows { + STATUS[r.ID] = r.Name + } +} diff --git a/evaluator/status_test.go b/evaluator/status_test.go new file mode 100644 index 000000000..6fa0ecbf9 --- /dev/null +++ b/evaluator/status_test.go @@ -0,0 +1,18 @@ +package evaluator + +import ( + "app/base/core" + "app/base/utils" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestStatus(t *testing.T) { + utils.SkipWithoutDB(t) + core.SetupTestEnvironment() + configureStatus() + + assert.Equal(t, "Installable", STATUS[INSTALLABLE]) + assert.Equal(t, "Applicable", STATUS[APPLICABLE]) +} diff --git a/evaluator/vmaas_cache.go b/evaluator/vmaas_cache.go index 5802a5157..eff525dfa 100644 --- a/evaluator/vmaas_cache.go +++ b/evaluator/vmaas_cache.go @@ -7,7 +7,7 @@ import ( "app/tasks/vmaas_sync" "time" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" ) var memoryVmaasCache *VmaasCache @@ -15,9 +15,10 @@ var memoryVmaasCache *VmaasCache type VmaasCache struct { enabled bool size int + currentSize int validity *types.Rfc3339TimestampWithZ checkDuration time.Duration - data *lru.TwoQueueCache + data *lru.TwoQueueCache[string, *vmaas.UpdatesV3Response] } func NewVmaasPackageCache(enabled bool, size int, checkDuration time.Duration) *VmaasCache { @@ -25,46 +26,51 @@ func NewVmaasPackageCache(enabled bool, size int, checkDuration time.Duration) * c.enabled = enabled c.size = size + c.currentSize = 0 c.validity = vmaas_sync.GetLastSync(vmaas_sync.VmaasExported) c.checkDuration = checkDuration vmaasCacheGauge.Set(0) if c.enabled { var err error - c.data, err = lru.New2Q(c.size) + c.data, err = lru.New2Q[string, *vmaas.UpdatesV3Response](c.size) if err != nil { panic(err) } return c } - return nil + return c } -func (c *VmaasCache) Get(checksum *string) (*vmaas.UpdatesV2Response, bool) { +func (c *VmaasCache) Get(checksum *string) (*vmaas.UpdatesV3Response, bool) { if c.enabled && checksum != nil { - val, ok := c.data.Get(checksum) + val, ok := c.data.Get(*checksum) if ok { vmaasCacheCnt.WithLabelValues("hit").Inc() - utils.LogTrace("checksum", checksum, "VmaasCache.Get cache hit") - response := val.(*vmaas.UpdatesV2Response) - return response, true + utils.LogTrace("checksum", *checksum, "VmaasCache.Get cache hit") + return val, true } } vmaasCacheCnt.WithLabelValues("miss").Inc() return nil, false } -func (c *VmaasCache) Add(checksum *string, response *vmaas.UpdatesV2Response) { +func (c *VmaasCache) Add(checksum *string, response *vmaas.UpdatesV3Response) { if c.enabled && checksum != nil { - vmaasCacheGauge.Inc() - c.data.Add(checksum, response) + c.data.Add(*checksum, response) + if c.currentSize <= c.size { + c.currentSize++ + vmaasCacheGauge.Inc() + } } } func (c *VmaasCache) Reset(ts *types.Rfc3339TimestampWithZ) { - c.data.Purge() - c.validity = ts - vmaasCacheGauge.Set(0) + if c.enabled { + c.data.Purge() + c.validity = ts + vmaasCacheGauge.Set(0) + } } func (c *VmaasCache) CheckValidity() { diff --git a/go.mod b/go.mod index ff0f81306..531c925ae 100644 --- a/go.mod +++ b/go.mod @@ -1,94 +1,96 @@ module app -go 1.18 +go 1.19 require ( - github.com/aws/aws-sdk-go v1.44.116 + github.com/aws/aws-sdk-go v1.44.280 github.com/ezamriy/gorpm v0.0.0-20160905202458-25f7273cbf51 - github.com/getkin/kin-openapi v0.106.0 + github.com/getkin/kin-openapi v0.118.0 github.com/gin-contrib/gzip v0.0.6 github.com/gin-contrib/timeout v0.0.3 - github.com/gin-gonic/gin v1.8.1 - github.com/gocarina/gocsv v0.0.0-20200330101823-46266ca37bd3 // newer version skips some columns - github.com/golang-migrate/migrate/v4 v4.15.2 - github.com/hashicorp/golang-lru v0.5.4 - github.com/jackc/pgconn v1.13.0 - github.com/joho/godotenv v1.4.0 + github.com/gin-gonic/gin v1.9.1 + github.com/gocarina/gocsv v0.0.0-20230513223533-9ddd7fd60602 + github.com/golang-migrate/migrate/v4 v4.16.2 + github.com/hashicorp/golang-lru/v2 v2.0.3 + github.com/joho/godotenv v1.5.1 github.com/lestrrat-go/backoff v1.0.1 - github.com/lib/pq v1.10.7 + github.com/lib/pq v1.10.9 github.com/pkg/errors v0.9.1 github.com/pmezard/go-difflib v1.0.0 - github.com/prometheus/client_golang v1.13.0 + github.com/prometheus/client_golang v1.15.1 github.com/redhatinsights/app-common-go v1.6.6 github.com/redhatinsights/identity v0.0.0-20220719174832-36a7b1cbeff1 github.com/redhatinsights/platform-go-middlewares v0.20.0 - github.com/segmentio/kafka-go v0.4.35 - github.com/sirupsen/logrus v1.9.0 - github.com/stretchr/testify v1.8.0 - github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a - github.com/swaggo/gin-swagger v1.5.3 + github.com/segmentio/kafka-go v0.4.40 + github.com/sirupsen/logrus v1.9.3 + github.com/stretchr/testify v1.8.4 + github.com/swaggo/files v1.0.1 + github.com/swaggo/gin-swagger v1.6.0 github.com/zsais/go-gin-prometheus v0.1.0 - golang.org/x/net v0.7.0 - gorm.io/driver/postgres v1.4.4 - gorm.io/gorm v1.24.0 + go.uber.org/automaxprocs v1.5.2 + golang.org/x/net v0.12.0 + gorm.io/driver/postgres v1.5.2 + gorm.io/gorm v1.25.1 modernc.org/strutil v1.1.3 ) require ( github.com/KyleBanks/depth v1.2.1 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/bytedance/sonic v1.9.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/spec v0.20.7 // indirect - github.com/go-openapi/swag v0.22.3 // indirect - github.com/go-playground/locales v0.14.0 // indirect - github.com/go-playground/universal-translator v0.18.0 // indirect - github.com/go-playground/validator/v10 v10.11.1 // indirect - github.com/goccy/go-json v0.9.11 // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/spec v0.20.9 // indirect + github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.14.1 // indirect + github.com/goccy/go-json v0.10.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/invopop/yaml v0.2.0 // indirect - github.com/jackc/chunkreader/v2 v2.0.1 // indirect - github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgproto3/v2 v2.3.1 // indirect - github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect - github.com/jackc/pgtype v1.12.0 // indirect - github.com/jackc/pgx/v4 v4.17.2 // indirect + github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgx/v5 v5.3.1 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.11 // indirect - github.com/leodido/go-urn v1.2.1 // indirect + github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/cpuid/v2 v2.2.5 // indirect + github.com/leodido/go-urn v1.2.4 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect - github.com/pelletier/go-toml/v2 v2.0.5 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/perimeterx/marshmallow v1.1.4 // indirect github.com/pierrec/lz4/v4 v4.1.17 // indirect - github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect - github.com/swaggo/swag v1.8.6 // indirect - github.com/ugorji/go/codec v1.2.7 // indirect - github.com/xdg/scram v1.0.5 // indirect - github.com/xdg/stringprep v1.0.3 // indirect - go.uber.org/atomic v1.10.0 // indirect - golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect - golang.org/x/tools v0.1.12 // indirect - google.golang.org/protobuf v1.28.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/prometheus/client_model v0.4.0 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.10.1 // indirect + github.com/swaggo/swag v1.16.1 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect + github.com/xdg-go/pbkdf2 v1.0.0 // indirect + github.com/xdg-go/scram v1.1.2 // indirect + github.com/xdg-go/stringprep v1.0.4 // indirect + go.uber.org/atomic v1.11.0 // indirect + golang.org/x/arch v0.4.0 // indirect + golang.org/x/crypto v0.11.0 // indirect + golang.org/x/sys v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect + golang.org/x/tools v0.9.3 // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 07bdfb389..715989615 100644 --- a/go.sum +++ b/go.sum @@ -1,428 +1,38 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/spanner v1.28.0/go.mod h1:7m6mtQZn/hMbMfx62ct5EWrGND4DNqkXyrmBPRS+OJo= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= -github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= -github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= -github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/adal v0.9.16/go.mod h1:tGMin8I49Yij6AQ+rvV+Xa/zwxYQB5hmsd6DkfAx2+A= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ClickHouse/clickhouse-go v1.4.3/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/MichaelMraka/gorpm v0.0.0-20210923131407-e21b5950f175 h1:KkjlVN/HUw3OStvTnsAKt6bzLfWz/qDzfdNKRAo9Ef0= github.com/MichaelMraka/gorpm v0.0.0-20210923131407-e21b5950f175/go.mod h1:R3iHBCKh4OIuNrIzJl+81N08s7dD92MLffdRy+wbtnk= -github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= -github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= -github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= -github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= -github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= -github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.8.21/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= -github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= -github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= -github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= -github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= -github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/arrow/go/arrow v0.0.0-20210818145353-234c94e4ce64/go.mod h1:2qMFB56yOP3KzkB3PbYZ4AlUFg3a88F67TIx5lB/WwY= -github.com/apache/arrow/go/arrow v0.0.0-20211013220434-5962184e7a30/go.mod h1:Q7yQnSMnLvcXlZ8RV+jwz/6y1rQTqbX6C82SndT52Zs= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.17.7/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/aws/aws-sdk-go v1.38.51/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.44.116 h1:NpLIhcvLWXJZAEwvPj3TDHeqp7DleK6ZUVYyW01WNHY= -github.com/aws/aws-sdk-go v1.44.116/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go-v2 v1.8.0/go.mod h1:xEFuWz+3TYdlPRuo+CqATbeDWIWyaT5uAPwPaWtgse0= -github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= -github.com/aws/aws-sdk-go-v2/config v1.6.0/go.mod h1:TNtBVmka80lRPk5+S9ZqVfFszOQAGJJ9KbT3EM3CHNU= -github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= -github.com/aws/aws-sdk-go-v2/credentials v1.3.2/go.mod h1:PACKuTJdt6AlXvEq8rFI4eDmoqDFC5DpVKQbWysaDgM= -github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.4.0/go.mod h1:Mj/U8OpDbcVcoctrYwA2bak8k/HFPdcLzI/vaiXMwuM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.4.0/go.mod h1:eHwXu2+uE/T6gpnYWwBwqoeqRf9IXyCcolyOWDRAErQ= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.5.4/go.mod h1:Ex7XQmbFmgFHrjUX6TN3mApKW5Hglyga+F7wZHTtYhA= -github.com/aws/aws-sdk-go-v2/internal/ini v1.2.0/go.mod h1:Q5jATQc+f1MfZp3PDMhn6ry18hGvE0i8yvbXoKbnZaE= -github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.2.2/go.mod h1:EASdTcM1lGhUe1/p4gkojHwlGJkeoRjjr1sRCzup3Is= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.3.0/go.mod h1:v8ygadNyATSm6elwJ/4gzJwcFhri9RqS8skgHKiwXPU= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.2.2/go.mod h1:NXmNI41bdEsJMrD0v9rUvbGCB5GwdBEpKvUvIY3vTFg= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.5.2/go.mod h1:QuL2Ym8BkrLmN4lUofXYq6000/i5jPjosCNK//t6gak= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.7.2/go.mod h1:np7TMuJNT83O0oDOSF8i4dF3dvGqA6hPYYo6YYkzgRA= -github.com/aws/aws-sdk-go-v2/service/s3 v1.12.0/go.mod h1:6J++A5xpo7QDsIeSqPK4UHqMSyPOCopa+zKtqAMhqVQ= -github.com/aws/aws-sdk-go-v2/service/s3 v1.16.1/go.mod h1:CQe/KvWV1AqRc65KqeJjrLzr5X2ijnFTTVzJW0VBRCI= -github.com/aws/aws-sdk-go-v2/service/sso v1.3.2/go.mod h1:J21I6kF+d/6XHVk7kp/cx9YVD2TMD2TbLwtRGVcinXo= -github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= -github.com/aws/aws-sdk-go-v2/service/sts v1.6.1/go.mod h1:hLZ/AnkIKHLuPGjEiyghNEdvJ2PP0MgOxcmv9EBJ4xs= -github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= -github.com/aws/smithy-go v1.7.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/aws/aws-sdk-go v1.44.280 h1:UYl/yxhDxP8naok6ftWyQ9/9ZzNwjC9dvEs/j8BkGhw= +github.com/aws/aws-sdk-go v1.44.280/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= -github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= -github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= -github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= -github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= -github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/cockroachdb/cockroach-go/v2 v2.1.1/go.mod h1:7NtUnP6eK+l6k483WSYNrq3Kb23bWV10IRV1TyeSpwM= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= -github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= -github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e/go.mod h1:jg2QkJcsabfHugurUvvPhS3E08Oxiuh5W/g1ybB4e0E= -github.com/containerd/btrfs v0.0.0-20210316141732-918d888fb676/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/cgroups v0.0.0-20190717030353-c4b9ac5c7601/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= -github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= -github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= -github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= -github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= -github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.1-0.20191213020239-082f7e3aed57/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.0-beta.2.0.20200729163537-40b22ef07410/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.9/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7V960Tmcumvqn8Mc+pCYQ= -github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= -github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= -github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= -github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= -github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c= -github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s= -github.com/containerd/containerd v1.6.1 h1:oa2uY0/0G+JX4X7hpGCYvkp9FjUancz56kSNnb1sG3o= -github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= -github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= -github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= -github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= -github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= -github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20201026212402-0724c46b320c/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20210316144830-115abcc95a1d/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= -github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= -github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-cni v1.1.3/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= -github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/imgcrypt v1.0.1/go.mod h1:mdd8cEPW7TPgNG4FpuP3sGBiQ7Yi/zak9TYCG3juvb0= -github.com/containerd/imgcrypt v1.0.4-0.20210301171431-0ae5c75f59ba/go.mod h1:6TNsg0ctmizkrOgXRNQjAPFWpMYRWuiB6dSF4Pfa5SA= -github.com/containerd/imgcrypt v1.1.1-0.20210312161619-7ed62a527887/go.mod h1:5AZJNI6sLHJljKuI9IHnw1pWqo/F0nGDOuR9zgTs7ow= -github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= -github.com/containerd/imgcrypt v1.1.3/go.mod h1:/TPA1GIDXMzbj01yd8pIbQiLdQxed5ue1wb8bP7PQu4= -github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= -github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8= -github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= -github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= -github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= -github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= -github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= -github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v0.0.0-20210324211415-d5c4544f0433/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= -github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= -github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= -github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE= -github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= -github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= -github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.9.2 h1:GDaNjuWSGu09guE9Oql0MSTNhNCLlWwO8y/xM5BzcbM= +github.com/bytedance/sonic v1.9.2/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= -github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/cznic/mathutil v0.0.0-20180504122225-ca4c9f2c1369/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM= -github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= -github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= -github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= -github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= -github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dhui/dktest v0.3.10 h1:0frpeeoM9pHouHjhLeZDuDTJ0PqjDTrycaHaMmkJAo8= -github.com/dhui/dktest v0.3.10/go.mod h1:h5Enh0nG3Qbo9WjNFRrwmKUaePEBhXMOygbz3Ww7Sz0= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= -github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= -github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.13+incompatible h1:5s7uxnKZG+b8hYWlPYUi6x1Sjpq2MSt96d15eLZeHyw= -github.com/docker/docker v20.10.13+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= +github.com/dhui/dktest v0.3.16 h1:i6gq2YQEtcrjKbeJpBkWjE8MmLZPYllcjOFbTZuPDnw= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPaAiuPgIfVyI3dYE= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= -github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.5+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsouza/fake-gcs-server v1.17.0/go.mod h1:D1rTE4YCyHFNa99oyJJ5HyclvN/0uQR+pM/VdlL83bw= -github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= -github.com/gabriel-vasile/mimetype v1.3.1/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8= -github.com/gabriel-vasile/mimetype v1.4.0/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8= -github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/getkin/kin-openapi v0.106.0 h1:hrqfqJPAvWvuO/V0lCr/xyQOq4Gy21mcr28JJOSRcEI= -github.com/getkin/kin-openapi v0.106.0/go.mod h1:9Dhr+FasATJZjS4iOLvB0hkaxgYdulrNYm2e9epLWOo= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/getkin/kin-openapi v0.118.0 h1:z43njxPmJ7TaPpMSCQb7PN0dEYno4tyBPQcrFdHoLuM= +github.com/getkin/kin-openapi v0.118.0/go.mod h1:l5e9PaFUo9fyLJCPGQeXI2ML8c3P8BHOEV2VaAVf/pc= github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4= github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= @@ -430,745 +40,199 @@ github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm github.com/gin-contrib/timeout v0.0.3 h1:ysZQ7kChgqlzBkuLgwTTDjTPP2uqdI68XxRyqIFK68g= github.com/gin-contrib/timeout v0.0.3/go.mod h1:F3fjkmFc4I1QdF7MyVwtO6ZkPueBckNoiOVpU73HGgU= github.com/gin-gonic/gin v1.7.2/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= -github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= -github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= -github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= -github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= -github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= -github.com/go-openapi/spec v0.20.7 h1:1Rlu/ZrOCCob0n+JKKJAWhNWMPW8bOZRg8FJaY+0SKI= -github.com/go-openapi/spec v0.20.7/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/spec v0.20.9 h1:xnlYNQAwKd2VQRRfwTEI0DcK+2cbuvI/0c7jx3gA8/8= +github.com/go-openapi/spec v0.20.9/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= -github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-playground/validator/v10 v10.14.1 h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k= +github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/gocarina/gocsv v0.0.0-20200330101823-46266ca37bd3 h1:B7k6N+JlLM/u1xrIkpifUfE7GRJsZIYHoHbiAa5cSP4= -github.com/gocarina/gocsv v0.0.0-20200330101823-46266ca37bd3/go.mod h1:5YoVOkjYAQumqlV356Hj3xeYh4BdZuLE0/nRkf2NKkI= +github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/gocarina/gocsv v0.0.0-20230513223533-9ddd7fd60602 h1:HSpPf+lPYwzoJNup34uegmOQk5Qm83S+wpu8anTDJkg= +github.com/gocarina/gocsv v0.0.0-20230513223533-9ddd7fd60602/go.mod h1:5YoVOkjYAQumqlV356Hj3xeYh4BdZuLE0/nRkf2NKkI= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= -github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gocql/gocql v0.0.0-20210515062232-b7ef815b4556/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= -github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= -github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-migrate/migrate/v4 v4.15.2 h1:vU+M05vs6jWHKDdmE1Ecwj0BznygFc4QsdRe2E/L7kc= -github.com/golang-migrate/migrate/v4 v4.15.2/go.mod h1:f2toGLkYqD3JH+Todi4aZ2ZdbeUNx4sIwiOK96rE9Lw= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang-migrate/migrate/v4 v4.16.2 h1:8coYbMKUyInrFk1lfGfRovTLAW7PhWp8qQDT2iKfuoA= +github.com/golang-migrate/migrate/v4 v4.16.2/go.mod h1:pfcJX4nPHaVdc5nmdCikFBWtm+UBpiZjRNNsyBbp0/o= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= -github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/golang-lru/v2 v2.0.3 h1:kmRrRLlInXvng0SmLxmQpQkpbYAvcXm7NPDrgxJa9mE= +github.com/hashicorp/golang-lru/v2 v2.0.3/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= github.com/invopop/yaml v0.1.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= -github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= -github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= -github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= -github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= -github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= -github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= -github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= -github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5lahk= -github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= -github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= -github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.13.0 h1:3L1XMNV2Zvca/8BYhzcRFS70Lr0WlDg16Di6SFGAbys= -github.com/jackc/pgconn v1.13.0/go.mod h1:AnowpAqO4CMIIJNZl2VJp+KrkAZciAkhEl0W0JIobpI= -github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451/go.mod h1:a/s9Lp5W7n/DD0VrVoyJ00FbP2ytTPDVOivvn2bMlds= -github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= -github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= -github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= -github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= -github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= -github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= -github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.7/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.3.1 h1:nwj7qwf0S+Q7ISFfBndqeLwSwxs+4DPsbRFjECT1Y4Y= -github.com/jackc/pgproto3/v2 v2.3.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= -github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= -github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= -github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0= -github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po= -github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ= -github.com/jackc/pgtype v1.6.2/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig= -github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.12.0 h1:Dlq8Qvcch7kiehm8wPGIW0W3KsCCHJnRacKW0UM8n5w= -github.com/jackc/pgtype v1.12.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= -github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= -github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= -github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= -github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXgo+kA= -github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o= -github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= -github.com/jackc/pgx/v4 v4.10.1/go.mod h1:QlrWebbs3kqEZPHCTGyxecvzG6tvIsYu+A5b1raylkA= -github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.17.2 h1:0Ut0rpeKwvIVbMQ1KbMBU4h6wxehBI535LK6Flheh8E= -github.com/jackc/pgx/v4 v4.17.2/go.mod h1:lcxIZN44yMIrWI78a5CpucdD14hX0SBDbNRvjDBItsw= -github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU= +github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/jmoiron/sqlx v1.3.1/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= -github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= -github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/k0kubun/pp v2.3.0+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.7/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= -github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= +github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/ktrysmt/go-bitbucket v0.6.4/go.mod h1:9u0v3hsd2rqCHRIpbir1oP7F58uo5dq19sBYvuMoyQ4= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lestrrat-go/backoff v1.0.1 h1:Gphaach0QvvtaHmR9U8hwXNHXWckPyD8V6S+V+D184c= github.com/lestrrat-go/backoff v1.0.1/go.mod h1:5QVJKC49Q5yQvCrpup0ZqzDGHEO/O4H82cnDuYdumkw= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= -github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= -github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/pkger v0.15.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/matttproud/golang_protobuf_extensions v1.0.2 h1:hAHbPm5IJGijwng3PWk09JkG9WeqChjprR5s9bBZ+OM= -github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= -github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= -github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= -github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= -github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= -github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mutecomm/go-sqlcipher/v4 v4.4.0/go.mod h1:PyN04SaWalavxRGH9E8ZftG6Ju7rsPrGmQRjrEaVpiY= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8/go.mod h1:86wM1zFnC6/uDBfZGNwB65O+pR2OFi5q/YQaEUid1qA= -github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/neo4j/neo4j-go-driver v1.8.1-0.20200803113522-b626aa943eba/go.mod h1:ncO5VaFWh0Nrt+4KT4mOZboaczBZcLuHrG+/sUeP8gI= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= -github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= -github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= -github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= -github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= -github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= -github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= -github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= -github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= -github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= -github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= -github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= -github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/perimeterx/marshmallow v1.1.4 h1:pZLDH9RjlLGGorbXhcaQLhfuV0pFMNfPO55FuFkxqLw= +github.com/perimeterx/marshmallow v1.1.4/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc= github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= -github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= -github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= +github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= +github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/redhatinsights/app-common-go v1.6.6 h1:daOwCpGtW6IxGd9iO6TY3yoaV/HaHKjo/j/05dV0hHM= github.com/redhatinsights/app-common-go v1.6.6/go.mod h1:6gzRyg8ZyejwMCksukeAhh2ZXOB3uHSmBsbP06fG2PQ= github.com/redhatinsights/identity v0.0.0-20220719174832-36a7b1cbeff1 h1:oCJ53EClFw5LdNWLKYmwGeqkUoYLV0Wy6ZaZlwjDYDY= github.com/redhatinsights/identity v0.0.0-20220719174832-36a7b1cbeff1/go.mod h1:B0Dwuuaghxyqo8ltmLZyLpKQFKU6r8cE2YRrO0bVdXM= github.com/redhatinsights/platform-go-middlewares v0.20.0 h1:qwK9ArGYRlORsZ56PXXLJrGvzTsMe3bk2lR+WN5aIjM= github.com/redhatinsights/platform-go-middlewares v0.20.0/go.mod h1:i5gVDZJ/quCQhs5AW5CwkRPXlz1HfDBvyNtXHnlXZfM= -github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= -github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= -github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= -github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= -github.com/segmentio/kafka-go v0.4.35 h1:TAsQ7q1SjS39PcFvU0zDJhCuVAxHomy7xOAfbdSuhzs= -github.com/segmentio/kafka-go v0.4.35/go.mod h1:GAjxBQJdQMB5zfNA21AhpaqOB2Mu+w3De4ni3Gbm8y0= -github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/segmentio/kafka-go v0.4.40 h1:sszW7c0/uyv7+VcTW5trx2ZC7kMWDTxuR/6Zn8U1bm8= +github.com/segmentio/kafka-go v0.4.40/go.mod h1:naFEZc5MQKdeL3W6NkZIAn48Y6AazqjRFDhnXeg3h94= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/snowflakedb/gosnowflake v1.6.3/go.mod h1:6hLajn6yxuJ4xUHZegMekpq9rnQbGJ7TMwXjgTmA6lg= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= -github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1176,758 +240,145 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a h1:kAe4YSu0O0UFn1DowNo2MY5p6xzqtJ/wQ7LZynSvGaY= -github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= -github.com/swaggo/gin-swagger v1.5.3 h1:8mWmHLolIbrhJJTflsaFoZzRBYVmEE7JZGIq08EiC0Q= -github.com/swaggo/gin-swagger v1.5.3/go.mod h1:3XJKSfHjDMB5dBo/0rrTXidPmgLeqsX89Yp4uA50HpI= -github.com/swaggo/swag v1.8.1/go.mod h1:ugemnJsPZm/kRwFUnzBlbHRd0JY9zE1M4F+uy2pAaPQ= -github.com/swaggo/swag v1.8.6 h1:2rgOaLbonWu1PLP6G+/rYjSvPg0jQE0HtrEKuE380eg= -github.com/swaggo/swag v1.8.6/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg= -github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE= +github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg= +github.com/swaggo/gin-swagger v1.6.0 h1:y8sxvQ3E20/RCyrXeFfg60r6H0Z+SwpTjMYsMm+zy8M= +github.com/swaggo/gin-swagger v1.6.0/go.mod h1:BG00cCEy294xtVpyIAHG6+e2Qzj/xKlRdOqDkvq0uzo= +github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= +github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= -github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= -github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= -github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= -github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVThkpGiXrs= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/xdg/scram v1.0.5 h1:TuS0RFmt5Is5qm9Tm2SoD89OPqe4IRiFtyFY4iwWXsw= -github.com/xdg/scram v1.0.5/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v1.0.3 h1:cmL5Enob4W83ti/ZHuZLuKD/xqJfus4fVPwE+/BDm+4= -github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= -github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zsais/go-gin-prometheus v0.1.0 h1:bkLv1XCdzqVgQ36ScgRi09MA2UC1t3tAB6nsfErsGO4= github.com/zsais/go-gin-prometheus v0.1.0/go.mod h1:Slirjzuz8uM8Cw0jmPNqbneoqcUtY2GGjn2bEd4NRLY= -gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.mongodb.org/mongo-driver v1.7.0/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= -go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0/go.mod h1:vEhqr0m4eTc+DWxfsXoXue2GBgV2uUwVznkGIHW/e5w= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= -go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0/go.mod h1:hO1KLR7jcKaDDKDkvI9dP/FIhpmna5lkqPUQdEjFAM8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0/go.mod h1:keUU7UfnwWTWpJ+FWnyqmogPa82nuU5VUANFq49hlMY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0/go.mod h1:QNX1aly8ehqqX1LEa6YniTU7VY9I6R3X/oPxhGdTceE= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= -go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= -go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= -go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= +go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc= +golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20221012134737-56aed061732a h1:NmSIgad6KjE6VvHciPZuNRTKxGhlPfD6OA87W/PLkqg= -golang.org/x/crypto v0.0.0-20221012134737-56aed061732a/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= -golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190225153610-fe579d43d832/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220706163947-c90051bbdb60/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180224232135-f6cff0780e54/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210818153620-00dd8d7831e7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220317061510-51cd9980dadf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= +golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= -google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= -google.golang.org/appengine v1.0.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210630183607-d20f26d13c79/go.mod h1:yiaVoXHpRzHGyxV3o4DktVWY4mSUErTKaeEOq6C3t3U= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220111164026-67b88f271998/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106 h1:ErU+UA6wxadoU8nWrsy5MZUVBs75K17zUCsUCIfrXCE= -google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= @@ -1938,107 +389,11 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/postgres v1.0.8/go.mod h1:4eOzrI1MUfm6ObJU/UcmbXyiHSs8jSwH95G5P5dxcAg= -gorm.io/driver/postgres v1.4.4 h1:zt1fxJ+C+ajparn0SteEnkoPg0BQ6wOWXEQ99bteAmw= -gorm.io/driver/postgres v1.4.4/go.mod h1:whNfh5WhhHs96honoLjBAMwJGYEuA3m1hvgUbNXhPCw= -gorm.io/gorm v1.20.12/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.21.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.23.7/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= -gorm.io/gorm v1.24.0 h1:j/CoiSm6xpRpmzbFJsQHYj+I8bGYWLXVHeYEyyKlF74= -gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= -k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= -k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= -k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= -k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= -k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= -k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= -k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= -k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= -k8s.io/apiserver v0.22.5/go.mod h1:s2WbtgZAkTKt679sYtSudEQrTGWUSQAPe6MupLnlmaQ= -k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= -k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= -k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= -k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= -k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= -k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= -k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= -k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= -k8s.io/component-base v0.22.5/go.mod h1:VK3I+TjuF9eaa+Ln67dKxhGar5ynVbwnGrUiNF4MqCI= -k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= -k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= -k8s.io/cri-api v0.23.1/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -modernc.org/b v1.0.0/go.mod h1:uZWcZfRj1BpYzfN9JTerzlNUnnPsV9O2ZA8JsRcubNg= -modernc.org/cc/v3 v3.32.4/go.mod h1:0R6jl1aZlIl2avnYfbfHBS1QB6/f+16mihBObaBC878= -modernc.org/ccgo/v3 v3.9.2/go.mod h1:gnJpy6NIVqkETT+L5zPsQFj7L2kkhfPMzOghRNv/CFo= -modernc.org/db v1.0.0/go.mod h1:kYD/cO29L/29RM0hXYl4i3+Q5VojL31kTUVpVJDw0s8= -modernc.org/file v1.0.0/go.mod h1:uqEokAEn1u6e+J45e54dsEA/pw4o7zLrA2GwyntZzjw= -modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/internal v1.0.0/go.mod h1:VUD/+JAkhCpvkUitlEOnhpVxCgsBI90oTzSCRcqQVSM= -modernc.org/libc v1.7.13-0.20210308123627-12f642a52bb8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= -modernc.org/libc v1.9.5/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= -modernc.org/lldb v1.0.0/go.mod h1:jcRvJGWfCGodDZz8BPwiKMJxGJngQ/5DrRapkQnLob8= -modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +gorm.io/driver/postgres v1.5.2 h1:ytTDxxEv+MplXOfFe3Lzm7SjG09fcdb3Z/c056DTBx0= +gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBpCgl8= +gorm.io/gorm v1.25.1 h1:nsSALe5Pr+cM3V1qwwQ7rOkw+6UeLrX5O4v3llhHa64= +gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= -modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= -modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/ql v1.0.0/go.mod h1:xGVyrLIatPcO2C1JvI/Co8c0sr6y91HKFNy4pt9JXEY= -modernc.org/sortutil v1.1.0/go.mod h1:ZyL98OQHJgH9IEfN71VsamvJgrtRX9Dj2gX+vH86L1k= -modernc.org/sqlite v1.10.6/go.mod h1:Z9FEjUtZP4qFEg6/SiADg9XCER7aYy9a/j7Pg9P7CPs= -modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= -modernc.org/tcl v1.5.2/go.mod h1:pmJYOLgpiys3oI4AeAafkcUfE+TKKilminxNyU/+Zlo= -modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.0.1-0.20210308123920-1f282aa71362/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA= -modernc.org/z v1.0.1/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA= -modernc.org/zappy v1.0.0/go.mod h1:hHe+oGahLVII/aTTyWK/b53VDHMAGCBYYeZ9sn83HC4= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/listener/common_test.go b/listener/common_test.go index 3131b95e7..18928eb40 100644 --- a/listener/common_test.go +++ b/listener/common_test.go @@ -131,15 +131,16 @@ func assertSystemReposInDB(t *testing.T, systemID int64, repos []string) { assert.Equal(t, c, int64(len(repos))) } -func assertYumUpdatesInDB(t *testing.T, inventoryID string, yumUpdates []byte) { +func assertYumUpdatesInDB(t *testing.T, inventoryID string, yumUpdates *YumUpdates) { var system models.SystemPlatform assert.NoError(t, database.Db.Where("inventory_id = ?::uuid", inventoryID).Find(&system).Error) assert.Equal(t, system.InventoryID, inventoryID) - var systemYumUpdatesParsed vmaas.UpdatesV2Response - var yumUpdatesParsed vmaas.UpdatesV2Response + var systemYumUpdatesParsed vmaas.UpdatesV3Response + var yumUpdatesParsed vmaas.UpdatesV3Response err := json.Unmarshal(system.YumUpdates, &systemYumUpdatesParsed) assert.Nil(t, err) - err = json.Unmarshal(yumUpdates, &yumUpdatesParsed) + err = json.Unmarshal(yumUpdates.RawParsed, &yumUpdatesParsed) assert.Nil(t, err) assert.Equal(t, systemYumUpdatesParsed, yumUpdatesParsed) + assert.Equal(t, yumUpdates.BuiltPkgcache, system.BuiltPkgcache) } diff --git a/listener/listener.go b/listener/listener.go index 1e07f7957..9ab455a3c 100644 --- a/listener/listener.go +++ b/listener/listener.go @@ -86,6 +86,9 @@ func runReaders(wg *sync.WaitGroup, readerBuilder mqueue.CreateReader) { func RunListener() { var wg sync.WaitGroup + + go utils.RunProfiler() + runReaders(&wg, mqueue.NewKafkaReaderFromEnv) wg.Wait() utils.LogInfo("listener completed") diff --git a/listener/listener_test.go b/listener/listener_test.go index b7f130f52..37aaa5767 100644 --- a/listener/listener_test.go +++ b/listener/listener_test.go @@ -2,8 +2,9 @@ package listener import ( "app/base/utils" - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestLoadValidReporters(t *testing.T) { @@ -12,8 +13,9 @@ func TestLoadValidReporters(t *testing.T) { configure() reporter := loadValidReporters() - assert.Equal(t, 3, len(reporter)) + assert.Equal(t, 4, len(reporter)) assert.Equal(t, 1, reporter["puptoo"]) assert.Equal(t, 2, reporter["rhsm-conduit"]) assert.Equal(t, 3, reporter["yupana"]) + assert.Equal(t, 4, reporter["rhsm-system-profile-bridge"]) } diff --git a/listener/upload.go b/listener/upload.go index 8e30d4f91..2131dbe00 100644 --- a/listener/upload.go +++ b/listener/upload.go @@ -17,6 +17,7 @@ import ( "fmt" "net/http" "strings" + "sync" "time" "github.com/pkg/errors" @@ -76,6 +77,27 @@ type HostCustomMetadata struct { YumUpdatesS3URL *string `json:"yum_updates_s3url,omitempty"` } +type YumUpdates struct { + RawParsed json.RawMessage + BuiltPkgcache bool +} + +// GetRawParsed returns prepared parsed raw yumupdates +func (y *YumUpdates) GetRawParsed() json.RawMessage { + if y == nil { + return nil + } + return y.RawParsed +} + +// GetBuiltPkgcache returns boolean for build_pkgcache from yum_updates +func (y *YumUpdates) GetBuiltPkgcache() bool { + if y == nil { + return false + } + return y.BuiltPkgcache +} + //nolint:funlen func HandleUpload(event HostEvent) error { tStart := time.Now() @@ -125,7 +147,7 @@ func HandleUpload(event HostEvent) error { // don't fail, use vmaas evaluation utils.LogError("err", err, "Could not get yum updates") } - utils.LogTrace("inventoryID", event.Host.ID, "yum_updates", string(yumUpdates)) + utils.LogTrace("inventoryID", event.Host.ID, "yum_updates", string(yumUpdates.GetRawParsed())) if len(event.Host.SystemProfile.GetInstalledPackages()) == 0 && yumUpdates == nil { utils.LogWarn("inventoryID", event.Host.ID, WarnSkippingNoPackages) @@ -187,9 +209,15 @@ func sendPayloadStatus(w mqueue.Writer, event mqueue.PayloadTrackerEvent, status // accumulate events and create group PlatformEvents to save some resources var evalBufferSize = 5 * mqueue.BatchSize - -var evalBuffer = make(mqueue.EvalDataSlice, 0, evalBufferSize+1) -var ptBuffer = make(mqueue.PayloadTrackerEvents, 0, evalBufferSize+1) +var eBuffer = struct { + EvalBuffer mqueue.EvalDataSlice + PtBuffer mqueue.PayloadTrackerEvents + Lock sync.Mutex +}{ + EvalBuffer: make(mqueue.EvalDataSlice, 0, evalBufferSize+1), + PtBuffer: make(mqueue.PayloadTrackerEvents, 0, evalBufferSize+1), + Lock: sync.Mutex{}, +} var flushTimer = time.AfterFunc(87600*time.Hour, func() { utils.LogInfo(FlushedTimeoutBuffer) flushEvalEvents() @@ -199,16 +227,20 @@ var flushTimer = time.AfterFunc(87600*time.Hour, func() { func bufferEvalEvents(inventoryID string, rhAccountID int, ptEvent *mqueue.PayloadTrackerEvent) { tStart := time.Now() defer utils.ObserveSecondsSince(tStart, messagePartDuration.WithLabelValues("buffer-eval-events")) + + eBuffer.Lock.Lock() evalData := mqueue.EvalData{ InventoryID: inventoryID, RhAccountID: rhAccountID, OrgID: ptEvent.OrgID, RequestID: *ptEvent.RequestID, } - evalBuffer = append(evalBuffer, evalData) - ptBuffer = append(ptBuffer, *ptEvent) + eBuffer.EvalBuffer = append(eBuffer.EvalBuffer, evalData) + eBuffer.PtBuffer = append(eBuffer.PtBuffer, *ptEvent) + eBuffer.Lock.Unlock() + flushTimer.Reset(uploadEvalTimeout) - if len(evalBuffer) >= evalBufferSize { + if len(eBuffer.EvalBuffer) >= evalBufferSize { utils.LogInfo(FlushedFullBuffer) flushEvalEvents() } @@ -216,19 +248,21 @@ func bufferEvalEvents(inventoryID string, rhAccountID int, ptEvent *mqueue.Paylo func flushEvalEvents() { tStart := time.Now() - err := mqueue.SendMessages(base.Context, evalWriter, evalBuffer) + eBuffer.Lock.Lock() + defer eBuffer.Lock.Unlock() + err := mqueue.SendMessages(base.Context, evalWriter, eBuffer.EvalBuffer) if err != nil { utils.LogError("err", err.Error(), ErrorKafkaSend) } utils.ObserveSecondsSince(tStart, messagePartDuration.WithLabelValues("buffer-sent-evaluator")) - err = mqueue.SendMessages(base.Context, ptWriter, ptBuffer) + err = mqueue.SendMessages(base.Context, ptWriter, eBuffer.PtBuffer) if err != nil { utils.LogWarn("err", err.Error(), WarnPayloadTracker) } utils.ObserveSecondsSince(tStart, messagePartDuration.WithLabelValues("buffer-sent-payload-tracker")) // empty buffer - evalBuffer = evalBuffer[:0] - ptBuffer = ptBuffer[:0] + eBuffer.EvalBuffer = eBuffer.EvalBuffer[:0] + eBuffer.PtBuffer = eBuffer.PtBuffer[:0] } func updateReporterCounter(reporter string) { @@ -243,7 +277,7 @@ func updateReporterCounter(reporter string) { // nolint: funlen // Stores or updates base system profile, returing internal system id func updateSystemPlatform(tx *gorm.DB, inventoryID string, accountID int, host *Host, - yumUpdates []byte, updatesReq *vmaas.UpdatesV3Request) (*models.SystemPlatform, error) { + yumUpdates *YumUpdates, updatesReq *vmaas.UpdatesV3Request) (*models.SystemPlatform, error) { tStart := time.Now() defer utils.ObserveSecondsSince(tStart, messagePartDuration.WithLabelValues("update-system-platform")) updatesReqJSON, err := json.Marshal(updatesReq) @@ -253,7 +287,7 @@ func updateSystemPlatform(tx *gorm.DB, inventoryID string, accountID int, host * hash := sha256.Sum256(updatesReqJSON) jsonChecksum := hex.EncodeToString(hash[:]) - hash = sha256.Sum256(yumUpdates) + hash = sha256.Sum256(yumUpdates.GetRawParsed()) yumChecksum := hex.EncodeToString(hash[:]) var colsToUpdate = []string{ @@ -263,6 +297,8 @@ func updateSystemPlatform(tx *gorm.DB, inventoryID string, accountID int, host * "stale_timestamp", "stale_warning_timestamp", "culled_timestamp", + "satellite_managed", + "built_pkgcache", } now := time.Now() @@ -285,7 +321,9 @@ func updateSystemPlatform(tx *gorm.DB, inventoryID string, accountID int, host * CulledTimestamp: host.CulledTimestamp.Time(), Stale: staleWarning != nil && staleWarning.Before(time.Now()), ReporterID: getReporterID(host.Reporter), - YumUpdates: yumUpdates, + YumUpdates: yumUpdates.GetRawParsed(), + SatelliteManaged: host.SystemProfile.SatelliteManaged, + BuiltPkgcache: yumUpdates.GetBuiltPkgcache(), } var oldChecksums map[string]string @@ -310,11 +348,6 @@ func updateSystemPlatform(tx *gorm.DB, inventoryID string, accountID int, host * colsToUpdate = append(colsToUpdate, "yum_updates") } - if err := database.OnConflictUpdateMulti(tx, []string{"rh_account_id", "inventory_id"}, colsToUpdate...). - Save(&systemPlatform).Error; err != nil { - return nil, errors.Wrap(err, "Unable to save or update system in database") - } - if err := storeOrUpdateSysPlatform(tx, &systemPlatform, colsToUpdate); err != nil { return nil, errors.Wrap(err, "Unable to save or update system in database") } @@ -344,6 +377,14 @@ func storeOrUpdateSysPlatform(tx *gorm.DB, system *models.SystemPlatform, colsTo utils.LogWarn("err", errSelect, "couldn't find system for update") } + // return system_platform record after update + tx = tx.Clauses(clause.Returning{ + Columns: []clause.Column{ + {Name: "id"}, {Name: "inventory_id"}, {Name: "rh_account_id"}, + {Name: "unchanged_since"}, {Name: "last_evaluation"}, + }, + }) + if system.ID != 0 { // update system err = tx.Select(colsToUpdate).Updates(system).Error @@ -520,7 +561,7 @@ func processModules(systemProfile *inventory.SystemProfile) *[]vmaas.UpdatesV3Re } // We have received new upload, update stored host data, and re-evaluate the host against VMaaS -func processUpload(host *Host, yumUpdates []byte) (*models.SystemPlatform, error) { +func processUpload(host *Host, yumUpdates *YumUpdates) (*models.SystemPlatform, error) { tStart := time.Now() defer utils.ObserveSecondsSince(tStart, messagePartDuration.WithLabelValues("upload-processing")) // Ensure we have account stored @@ -542,6 +583,9 @@ func processUpload(host *Host, yumUpdates []byte) (*models.SystemPlatform, error // use rhsm version if set releasever := systemProfile.Rhsm.Version + if releasever == "" && systemProfile.Releasever != nil { + releasever = *systemProfile.Releasever + } if len(releasever) > 0 { updatesReq.SetReleasever(releasever) } @@ -571,8 +615,9 @@ func processUpload(host *Host, yumUpdates []byte) (*models.SystemPlatform, error return sys, nil } -func getYumUpdates(event HostEvent, client *api.Client) ([]byte, error) { - var parsed vmaas.UpdatesV2Response +func getYumUpdates(event HostEvent, client *api.Client) (*YumUpdates, error) { + var parsed vmaas.UpdatesV3Response + res := &YumUpdates{} yumUpdates := event.PlatformMetadata.CustomMetadata.YumUpdates yumUpdatesURL := event.PlatformMetadata.CustomMetadata.YumUpdatesS3URL @@ -586,7 +631,7 @@ func getYumUpdates(event HostEvent, client *api.Client) ([]byte, error) { } } - if (parsed == vmaas.UpdatesV2Response{}) { + if (parsed == vmaas.UpdatesV3Response{}) { utils.LogWarn("yum_updates_s3url", yumUpdatesURL, "No yum updates on S3, getting legacy yum_updates field") err := json.Unmarshal(yumUpdates, &parsed) if err != nil { @@ -597,13 +642,15 @@ func getYumUpdates(event HostEvent, client *api.Client) ([]byte, error) { updatesMap := parsed.GetUpdateList() if len(updatesMap) == 0 { // system does not have any yum updates - return yumUpdates, nil + res.RawParsed = yumUpdates + res.BuiltPkgcache = parsed.GetBuildPkgcache() + return res, nil } // we need to get all packages to show up-to-date packages installedPkgs := event.Host.SystemProfile.GetInstalledPackages() for _, pkg := range installedPkgs { if _, has := updatesMap[pkg]; !has { - updatesMap[pkg] = vmaas.UpdatesV2ResponseUpdateList{} + updatesMap[pkg] = &vmaas.UpdatesV3ResponseUpdateList{} } } parsed.UpdateList = &updatesMap @@ -615,7 +662,10 @@ func getYumUpdates(event HostEvent, client *api.Client) ([]byte, error) { if err != nil { return nil, errors.Wrap(err, "unable to marshall yum updates") } - return yumUpdates, nil + res.RawParsed = yumUpdates + res.BuiltPkgcache = parsed.GetBuildPkgcache() + + return res, nil } func (host *Host) GetOrgID() string { diff --git a/listener/upload_test.go b/listener/upload_test.go index 03739e05a..0d100c648 100644 --- a/listener/upload_test.go +++ b/listener/upload_test.go @@ -83,6 +83,7 @@ func TestUpdateSystemPlatform(t *testing.T) { assert.Equal(t, sys1.ID, sys2.ID) assert.Equal(t, sys1.InventoryID, sys2.InventoryID) assert.Equal(t, sys1.Stale, sys2.Stale) + assert.Equal(t, sys1.SatelliteManaged, sys2.SatelliteManaged) assert.NotNil(t, sys1.StaleTimestamp) assert.Nil(t, sys1.StaleWarningTimestamp) assert.Nil(t, sys1.CulledTimestamp) @@ -295,7 +296,7 @@ func TestUpdateSystemPlatformYumUpdates(t *testing.T) { assertYumUpdatesInDB(t, id, yumUpdates) // check that yumUpdates has been updated - yumUpdates = []byte("{}") + yumUpdates.RawParsed = []byte("{}") _, err = updateSystemPlatform(database.Db, id, accountID1, createTestInvHost(t), yumUpdates, &req) assert.Nil(t, err) assertYumUpdatesInDB(t, id, yumUpdates) @@ -314,13 +315,14 @@ func TestStoreOrUpdateSysPlatform(t *testing.T) { database.Db.Model(&models.SystemPlatform{}).Select("count(*)").Find(&oldCount) database.Db.Raw("select nextval('system_platform_id_seq')").Find(&nextval) - colsToUpdate := []string{"vmaas_json", "json_checksum", "reporter_id"} + colsToUpdate := []string{"vmaas_json", "json_checksum", "reporter_id", "satellite_managed"} json := "this_is_json" inStore := models.SystemPlatform{ - InventoryID: "99990000-0000-0000-0000-000000000001", - RhAccountID: 1, - VmaasJSON: &json, - DisplayName: "display_name", + InventoryID: "99990000-0000-0000-0000-000000000001", + RhAccountID: 1, + VmaasJSON: &json, + DisplayName: "display_name", + SatelliteManaged: false, } // insert new row err := storeOrUpdateSysPlatform(database.Db, &inStore, colsToUpdate) @@ -333,6 +335,7 @@ func TestStoreOrUpdateSysPlatform(t *testing.T) { assert.Equal(t, inStore.InventoryID, outStore.InventoryID) assert.Equal(t, inStore.RhAccountID, outStore.RhAccountID) assert.Equal(t, *inStore.VmaasJSON, *outStore.VmaasJSON) + assert.Equal(t, inStore.SatelliteManaged, outStore.SatelliteManaged) updateJSON := "updated_json" reporter := 2 @@ -341,6 +344,8 @@ func TestStoreOrUpdateSysPlatform(t *testing.T) { inUpdate.JSONChecksum = &updateJSON inUpdate.ReporterID = &reporter inUpdate.DisplayName = "should_not_be_updated" + inUpdate.SatelliteManaged = true + // update row err = storeOrUpdateSysPlatform(database.Db, &inUpdate, colsToUpdate) assert.Nil(t, err) @@ -352,6 +357,7 @@ func TestStoreOrUpdateSysPlatform(t *testing.T) { assert.Equal(t, *inUpdate.VmaasJSON, *outUpdate.VmaasJSON) assert.Equal(t, *inUpdate.JSONChecksum, *outUpdate.JSONChecksum) assert.Equal(t, *inUpdate.ReporterID, *outUpdate.ReporterID) + assert.Equal(t, inUpdate.SatelliteManaged, outUpdate.SatelliteManaged) // it should update the row assert.Equal(t, outStore.ID, outUpdate.ID) // DisplayName is not in colsToUpdate, it should not be updated diff --git a/main.go b/main.go index 83e8400ef..1a09b6bd6 100644 --- a/main.go +++ b/main.go @@ -15,6 +15,8 @@ import ( "app/turnpike" "log" "os" + + _ "go.uber.org/automaxprocs" // automatically sets GOMAXPROCS based on the CPU limit ) // nolint: funlen diff --git a/manager/controllers/advisories.go b/manager/controllers/advisories.go index f719495d3..cfdef4c75 100644 --- a/manager/controllers/advisories.go +++ b/manager/controllers/advisories.go @@ -2,6 +2,7 @@ package controllers import ( "app/base/database" + "app/base/rbac" "app/manager/middlewares" "net/http" "time" @@ -14,11 +15,16 @@ var AdvisoriesFields = database.MustGetQueryAttrs(&AdvisoriesDBLookupV3{}) var AdvisoriesSelectV2 = database.MustGetSelect(&AdvisoriesDBLookupV2{}) var AdvisoriesSelectV3 = database.MustGetSelect(&AdvisoriesDBLookupV3{}) var AdvisoriesOpts = ListOpts{ - Fields: AdvisoriesFields, - DefaultFilters: nil, - DefaultSort: "-public_date", - StableSort: "id", - SearchFields: []string{"am.name", "am.cve_list", "synopsis"}, + Fields: AdvisoriesFields, + DefaultFilters: map[string]FilterData{ + "applicable_systems": { + Operator: "gt", + Values: []string{"0"}, + }, + }, + DefaultSort: "-public_date", + StableSort: "id", + SearchFields: []string{"am.name", "am.cve_list", "synopsis"}, } type AdvisoryID struct { @@ -114,14 +120,16 @@ type AdvisoriesResponseV3 struct { func advisoriesCommon(c *gin.Context) (*gorm.DB, *ListMeta, []string, error) { db := middlewares.DBFromContext(c) account := c.GetInt(middlewares.KeyAccount) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) var query *gorm.DB - filters, err := ParseTagsFilters(c) + filters, err := ParseAllFilters(c, AdvisoriesOpts) if err != nil { return nil, nil, nil, err } - if disableCachedCounts || HasTags(c) { + + if disableCachedCounts || HasInventoryFilter(filters) || len(groups[rbac.KeyGrouped]) != 0 { var err error - query = buildQueryAdvisoriesTagged(db, filters, account) + query = buildQueryAdvisoriesTagged(db, filters, account, groups) if err != nil { return nil, nil, nil, err } // Error handled in method itself @@ -143,20 +151,20 @@ func advisoriesCommon(c *gin.Context) (*gorm.DB, *ListMeta, []string, error) { // @Produce json // @Param limit query int false "Limit for paging, set -1 to return all" // @Param offset query int false "Offset for paging" -// @Param sort query string false "Sort field" Enums(id,name,advisory_type,synopsis,public_date,applicable_systems) +// @Param sort query string false "Sort field" Enums(id,advisory_type_name,synopsis,public_date,severity,installable_systems,applicable_systems) // @Param search query string false "Find matching text" // @Param filter[id] query string false "Filter " // @Param filter[description] query string false "Filter" // @Param filter[public_date] query string false "Filter" // @Param filter[synopsis] query string false "Filter" -// @Param filter[advisory_type] query string false "Filter" // @Param filter[advisory_type_name] query string false "Filter" // @Param filter[severity] query string false "Filter" // @Param filter[installable_systems] query string false "Filter" // @Param filter[applicable_systems] query string false "Filter" // @Param tags query []string false "Tag filter" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" // @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" -// @Param filter[system_profile][sap_sids][in] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" // @Param filter[system_profile][ansible] query string false "Filter systems by ansible" // @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" // @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" @@ -222,8 +230,9 @@ func AdvisoriesListHandler(c *gin.Context) { // @Param filter[installable_systems] query string false "Filter" // @Param filter[applicable_systems] query string false "Filter" // @Param tags query []string false "Tag filter" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" // @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" -// @Param filter[system_profile][sap_sids][in] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" // @Param filter[system_profile][ansible] query string false "Filter systems by ansible" // @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" // @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" @@ -258,8 +267,8 @@ func buildQueryAdvisories(db *gorm.DB, account int) *gorm.DB { return query } -func buildAdvisoryAccountDataQuery(db *gorm.DB, account int) *gorm.DB { - query := database.SystemAdvisories(db, account). +func buildAdvisoryAccountDataQuery(db *gorm.DB, account int, groups map[string]string) *gorm.DB { + query := database.SystemAdvisories(db, account, groups). Select(`sa.advisory_id, sp.rh_account_id as rh_account_id, count(sp.*) filter (where sa.status_id = 0) as systems_installable, count(sp.*) as systems_applicable`). @@ -269,9 +278,10 @@ func buildAdvisoryAccountDataQuery(db *gorm.DB, account int) *gorm.DB { return query } -func buildQueryAdvisoriesTagged(db *gorm.DB, filters map[string]FilterData, account int) *gorm.DB { - subq := buildAdvisoryAccountDataQuery(db, account) - subq, _ = ApplyTagsFilter(filters, subq, "sp.inventory_id") +func buildQueryAdvisoriesTagged(db *gorm.DB, filters map[string]FilterData, account int, groups map[string]string, +) *gorm.DB { + subq := buildAdvisoryAccountDataQuery(db, account, groups) + subq, _ = ApplyInventoryFilter(filters, subq, "sp.inventory_id") query := db.Table("advisory_metadata am"). Select(AdvisoriesSelectV3). diff --git a/manager/controllers/advisories_export.go b/manager/controllers/advisories_export.go index d6c14b2c4..e3ca77cb2 100644 --- a/manager/controllers/advisories_export.go +++ b/manager/controllers/advisories_export.go @@ -1,6 +1,7 @@ package controllers import ( + "app/base/rbac" "app/manager/middlewares" "github.com/gin-gonic/gin" @@ -28,15 +29,17 @@ import ( // @Router /export/advisories [get] func AdvisoriesExportHandler(c *gin.Context) { account := c.GetInt(middlewares.KeyAccount) - filters, err := ParseTagsFilters(c) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) + filters, err := ParseAllFilters(c, AdvisoriesOpts) if err != nil { return } db := middlewares.DBFromContext(c) var query *gorm.DB - if disableCachedCounts || HasTags(c) { + + if disableCachedCounts || HasInventoryFilter(filters) || len(groups[rbac.KeyGrouped]) != 0 { var err error - query = buildQueryAdvisoriesTagged(db, filters, account) + query = buildQueryAdvisoriesTagged(db, filters, account, groups) if err != nil { return } // Error handled in method itself diff --git a/manager/controllers/advisories_export_test.go b/manager/controllers/advisories_export_test.go index c0602308c..c14df717b 100644 --- a/manager/controllers/advisories_export_test.go +++ b/manager/controllers/advisories_export_test.go @@ -48,21 +48,23 @@ func TestAdvisoriesExportWrongFormat(t *testing.T) { assert.Equal(t, http.StatusUnsupportedMediaType, w.Code) body := w.Body.String() - exp := `{"error":"Invalid content type 'test-format', use 'application/json' or 'text/csv'"}` - assert.Equal(t, exp, body) + assert.Equal(t, InvalidContentTypeErr, body) } func TestAdvisoriesExportCSVFilter(t *testing.T) { core.SetupTest(t) - w := CreateRequest("GET", "/?filter[id]=RH-1", nil, "text/csv", AdvisoriesExportHandler) - assert.Equal(t, http.StatusOK, w.Code) - body := w.Body.String() - lines := strings.Split(body, "\n") + for _, URL := range []string{"/?filter[id]=RH-1", "/?filter[synopsis]=adv-1-syn"} { + w := CreateRequest("GET", URL, nil, "text/csv", AdvisoriesExportHandler) + + assert.Equal(t, http.StatusOK, w.Code) + body := w.Body.String() + lines := strings.Split(body, "\n") - assert.Equal(t, 3, len(lines)) - assert.Equal(t, "RH-1,adv-1-des,2016-09-22T16:00:00Z,adv-1-syn,enhancement,,0,false,\"7.0,7Server\",4,6", lines[1]) - assert.Equal(t, "", lines[2]) + assert.Equal(t, 3, len(lines)) + assert.Equal(t, "RH-1,adv-1-des,2016-09-22T16:00:00Z,adv-1-syn,enhancement,,0,false,\"7.0,7Server\",4,6", lines[1]) + assert.Equal(t, "", lines[2]) + } } func TestAdvisoriesExportTagsInvalid(t *testing.T) { diff --git a/manager/controllers/advisories_test.go b/manager/controllers/advisories_test.go index 2f1107b6d..42b50d09c 100644 --- a/manager/controllers/advisories_test.go +++ b/manager/controllers/advisories_test.go @@ -47,8 +47,8 @@ func TestAdvisoriesDefault(t *testing.T) { assert.Equal(t, false, output.Data[3].Attributes.RebootRequired) // links - assert.Equal(t, "/?offset=0&limit=20&sort=-public_date", output.Links.First) - assert.Equal(t, "/?offset=0&limit=20&sort=-public_date", output.Links.Last) + assert.Equal(t, "/?offset=0&limit=20&filter[applicable_systems]=gt:0&sort=-public_date", output.Links.First) + assert.Equal(t, "/?offset=0&limit=20&filter[applicable_systems]=gt:0&sort=-public_date", output.Links.Last) assert.Nil(t, output.Links.Next) assert.Nil(t, output.Links.Previous) @@ -153,9 +153,11 @@ func TestAdvisoriesFilterTypeID1(t *testing.T) { assert.Equal(t, "RH-4", output.Data[1].ID) assert.Equal(t, "RH-7", output.Data[2].ID) assert.Equal(t, FilterData{Values: []string{"enhancement"}, Operator: "eq"}, output.Meta.Filter["advisory_type_name"]) - assert.Equal(t, - "/?offset=0&limit=20&filter[advisory_type_name]=eq:enhancement&sort=id", - output.Links.First) + assert.Equal(t, 101, len(output.Links.First)) + assert.Contains(t, output.Links.First, "?offset=0&limit=20") + assert.Contains(t, output.Links.First, "filter[advisory_type_name]=eq:enhancement") + assert.Contains(t, output.Links.First, "filter[applicable_systems]=gt:0") + assert.Contains(t, output.Links.First, "sort=id") } func TestAdvisoriesFilterTypeID2(t *testing.T) { @@ -184,14 +186,6 @@ func TestAdvisoriesFilterTypeID4(t *testing.T) { } func TestAdvisoriesFilterTypeID5(t *testing.T) { - output := testAdvisories(t, "/?filter[advisory_type_name]!=other") - assert.Equal(t, 4, len(output.Data)) - for _, advisory := range output.Data { - assert.NotContains(t, "bugfix enhancement security", advisory.Attributes.AdvisoryTypeName) - } -} - -func TestAdvisoriesFilterTypeID6(t *testing.T) { output := testAdvisories(t, "/?filter[advisory_type_name]=in:other,bugfix") assert.Equal(t, 7, len(output.Data)) for _, advisory := range output.Data { @@ -217,7 +211,7 @@ func TestAdvisoriesPossibleSorts(t *testing.T) { core.SetupTest(t) for sort := range AdvisoriesFields { - if sort == "ReleaseVersions" { + if sort == "releaseversions" { // this fiesd is not sortable, skip it continue } @@ -250,9 +244,9 @@ func TestAdvisoriesSearch(t *testing.T) { assert.Equal(t, 1, output.Data[0].Attributes.ApplicableSystems) // links - assert.Equal(t, "/?offset=0&limit=20&sort=-public_date&search=h-3", + assert.Equal(t, "/?offset=0&limit=20&filter[applicable_systems]=gt:0&sort=-public_date&search=h-3", output.Links.First) - assert.Equal(t, "/?offset=0&limit=20&sort=-public_date&search=h-3", + assert.Equal(t, "/?offset=0&limit=20&filter[applicable_systems]=gt:0&sort=-public_date&search=h-3", output.Links.Last) assert.Nil(t, output.Links.Next) assert.Nil(t, output.Links.Previous) @@ -280,7 +274,11 @@ func TestAdvisoriesTags(t *testing.T) { assert.Equal(t, 8, len(output.Data)) assert.Equal(t, 1, output.Data[0].Attributes.InstallableSystems) assert.Equal(t, 2, output.Data[0].Attributes.ApplicableSystems) - assert.Equal(t, "/?offset=0&limit=20&sort=id&tags=ns1/k2=val2", output.Links.First) + assert.Equal(t, 76, len(output.Links.First)) + assert.Contains(t, output.Links.First, "?offset=0&limit=20") + assert.Contains(t, output.Links.First, "tags=ns1/k2=val2") + assert.Contains(t, output.Links.First, "filter[applicable_systems]=gt:0") + assert.Contains(t, output.Links.First, "sort=id") } func TestListAdvisoriesTagsInvalid(t *testing.T) { @@ -314,8 +312,9 @@ func TestAdvisoryTagsInMetadata(t *testing.T) { CheckResponse(t, w, http.StatusOK, &output) testMap := map[string]FilterData{ - "ns1/k1": {"eq", []string{"val1"}}, - "ns1/k3": {"eq", []string{"val4"}}, + "ns1/k1": {Operator: "eq", Values: []string{"val1"}}, + "ns1/k3": {Operator: "eq", Values: []string{"val4"}}, + "applicable_systems": {Operator: "gt", Values: []string{"0"}}, } assert.Equal(t, testMap, output.Meta.Filter) } diff --git a/manager/controllers/advisory_detail.go b/manager/controllers/advisory_detail.go index b04a714bf..3ddc03037 100644 --- a/manager/controllers/advisory_detail.go +++ b/manager/controllers/advisory_detail.go @@ -11,7 +11,7 @@ import ( "time" "github.com/gin-gonic/gin" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" "github.com/pkg/errors" "gorm.io/gorm" ) @@ -100,7 +100,7 @@ func AdvisoryDetailHandler(c *gin.Context) { var err error var respV2 *AdvisoryDetailResponseV2 db := middlewares.DBFromContext(c) - respV2, err = getAdvisoryV2(db, advisoryName) + respV2, err = getAdvisoryV2(db, advisoryName, false) if err != nil { if errors.Is(err, gorm.ErrRecordNotFound) { LogAndRespNotFound(c, err, "advisory not found") @@ -234,13 +234,13 @@ func pkgsV2topkgsV1(pkgsV2 packagesV2) packagesV1 { return pkgsV1 } -func initAdvisoryDetailCache() *lru.Cache { +func initAdvisoryDetailCache() *lru.Cache[string, AdvisoryDetailResponseV2] { middlewares.AdvisoryDetailGauge.Set(0) if !enableAdvisoryDetailCache { return nil } - cache, err := lru.New(advisoryDetailCacheSize) + cache, err := lru.New[string, AdvisoryDetailResponseV2](advisoryDetailCacheSize) if err != nil { panic(err) } @@ -265,7 +265,7 @@ func PreloadAdvisoryCacheItems() { progress, count := utils.LogProgress("Advisory detail cache preload", logProgressDuration, int64(len(advisoryNames))) for _, advisoryName := range advisoryNames { - _, err = getAdvisoryV2(database.Db, advisoryName) + _, err = getAdvisoryV2(database.Db, advisoryName, true) if err != nil { utils.LogError("advisoryName", advisoryName, "err", err.Error(), "can not re-load item to cache - V2") } @@ -284,9 +284,8 @@ func tryGetAdvisoryFromCacheV2(advisoryName string) *AdvisoryDetailResponseV2 { middlewares.AdvisoryDetailCnt.WithLabelValues("miss").Inc() return nil } - resp := val.(AdvisoryDetailResponseV2) middlewares.AdvisoryDetailCnt.WithLabelValues("hit").Inc() - return &resp + return &val } func tryAddAdvisoryToCacheV2(advisoryName string, resp *AdvisoryDetailResponseV2) { @@ -294,15 +293,19 @@ func tryAddAdvisoryToCacheV2(advisoryName string, resp *AdvisoryDetailResponseV2 return } evicted := advisoryDetailCacheV2.Add(advisoryName, *resp) - middlewares.AdvisoryDetailGauge.Inc() + if !evicted { + middlewares.AdvisoryDetailGauge.Inc() + } utils.LogDebug("evictedV2", evicted, "advisoryName", advisoryName, "saved to cache") } -func getAdvisoryV2(db *gorm.DB, advisoryName string) (*AdvisoryDetailResponseV2, error) { - resp := tryGetAdvisoryFromCacheV2(advisoryName) - if resp != nil { - utils.LogDebug("advisoryName", advisoryName, "found in cache") - return resp, nil // return data found in cache +func getAdvisoryV2(db *gorm.DB, advisoryName string, isPreload bool) (*AdvisoryDetailResponseV2, error) { + if !isPreload { + resp := tryGetAdvisoryFromCacheV2(advisoryName) + if resp != nil { + utils.LogDebug("advisoryName", advisoryName, "found in cache") + return resp, nil // return data found in cache + } } resp, err := getAdvisoryFromDBV2(db, advisoryName) // search for data in database diff --git a/manager/controllers/advisory_systems.go b/manager/controllers/advisory_systems.go index 6b08cf225..89c1e256a 100644 --- a/manager/controllers/advisory_systems.go +++ b/manager/controllers/advisory_systems.go @@ -35,6 +35,7 @@ var AdvisorySystemOpts = ListOpts{ func advisorySystemsCommon(c *gin.Context) (*gorm.DB, *ListMeta, []string, error) { account := c.GetInt(middlewares.KeyAccount) apiver := c.GetInt(middlewares.KeyApiver) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) advisoryName := c.Param("advisory_id") if advisoryName == "" { @@ -56,13 +57,17 @@ func advisorySystemsCommon(c *gin.Context) (*gorm.DB, *ListMeta, []string, error return nil, nil, nil, err } - query := buildAdvisorySystemsQuery(db, account, advisoryName, apiver) - filters, err := ParseTagsFilters(c) + query := buildAdvisorySystemsQuery(db, account, groups, advisoryName, apiver) + opts := AdvisorySystemOptsV3 + if apiver < 3 { + opts = AdvisorySystemOpts + } + filters, err := ParseAllFilters(c, opts) if err != nil { return nil, nil, nil, err } // Error handled in method itself - query, _ = ApplyTagsFilter(filters, query, "sp.inventory_id") - query, meta, params, err := ListCommon(query, c, filters, AdvisorySystemOpts) + query, _ = ApplyInventoryFilter(filters, query, "sp.inventory_id") + query, meta, params, err := ListCommon(query, c, filters, opts) // Error handled in method itself return query, meta, params, err } @@ -77,7 +82,7 @@ func advisorySystemsCommon(c *gin.Context) (*gorm.DB, *ListMeta, []string, error // @Param advisory_id path string true "Advisory ID" // @Param limit query int false "Limit for paging, set -1 to return all" // @Param offset query int false "Offset for paging" -// @Param sort query string false "Sort field" Enums(id,display_name,last_evaluation,last_upload,stale,status,template) +// @Param sort query string false "Sort field" Enums(id,display_name,last_evaluation,last_upload,stale,status,template,groups) // @Param search query string false "Find matching text" // @Param filter[id] query string false "Filter" // @Param filter[display_name] query string false "Filter" @@ -86,8 +91,9 @@ func advisorySystemsCommon(c *gin.Context) (*gorm.DB, *ListMeta, []string, error // @Param filter[template] query string false "Filter" // @Param filter[os] query string false "Filter OS version" // @Param tags query []string false "Tag filter" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" // @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" -// @Param filter[system_profile][sap_sids][in] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" // @Param filter[system_profile][ansible] query string false "Filter systems by ansible" // @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" // @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" @@ -144,7 +150,7 @@ func advisorySystemsListHandler(c *gin.Context) { // @Param advisory_id path string true "Advisory ID" // @Param limit query int false "Limit for paging, set -1 to return all" // @Param offset query int false "Offset for paging" -// @Param sort query string false "Sort field" Enums(id,display_name,last_evaluation,last_upload,rhsa_count,rhba_count,rhea_count,other_count,stale) +// @Param sort query string false "Sort field" Enums(id,display_name,last_evaluation,last_upload,rhsa_count,rhba_count,rhea_count,other_count,satellite_managed,stale,built_pkgcache) // @Param search query string false "Find matching text" // @Param filter[id] query string false "Filter" // @Param filter[insights_id] query string false "Filter" @@ -155,6 +161,7 @@ func advisorySystemsListHandler(c *gin.Context) { // @Param filter[rhba_count] query string false "Filter" // @Param filter[rhea_count] query string false "Filter" // @Param filter[other_count] query string false "Filter" +// @Param filter[satellite_managed] query string false "Filter" // @Param filter[stale] query string false "Filter" // @Param filter[stale_timestamp] query string false "Filter" // @Param filter[stale_warning_timestamp] query string false "Filter" @@ -164,48 +171,54 @@ func advisorySystemsListHandler(c *gin.Context) { // @Param filter[osminor] query string false "Filter" // @Param filter[osmajor] query string false "Filter" // @Param filter[os] query string false "Filter OS version" +// @Param filter[built_pkgcache] query string false "Filter" // @Param tags query []string false "Tag filter" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" // @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" -// @Param filter[system_profile][sap_sids][in] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" // @Param filter[system_profile][ansible] query string false "Filter systems by ansible" // @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" // @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" // @Param filter[system_profile][mssql][version] query string false "Filter systems by mssql version" -// @Success 200 {object} IDsResponse +// @Success 200 {object} IDsStatusResponse // @Failure 400 {object} utils.ErrorResponse // @Failure 404 {object} utils.ErrorResponse // @Failure 500 {object} utils.ErrorResponse // @Router /ids/advisories/{advisory_id}/systems [get] func AdvisorySystemsListIDsHandler(c *gin.Context) { + apiver := c.GetInt(middlewares.KeyApiver) query, meta, _, err := advisorySystemsCommon(c) if err != nil { return } // Error handled in method itself - var sids []SystemsID + var sids []SystemsStatusID if err = query.Scan(&sids).Error; err != nil { LogAndRespError(c, err, "database error") return } - ids, err := systemsIDs(c, sids, meta) + resp, err := systemsIDsStatus(c, sids, meta) if err != nil { return // Error handled in method itself } - var resp = IDsResponse{IDs: ids} + if apiver < 3 { + c.JSON(http.StatusOK, &resp.IDsResponse) + return + } c.JSON(http.StatusOK, &resp) } -func buildAdvisorySystemsQuery(db *gorm.DB, account int, advisoryName string, apiver int) *gorm.DB { +func buildAdvisorySystemsQuery(db *gorm.DB, account int, groups map[string]string, advisoryName string, apiver int, +) *gorm.DB { selectQuery := AdvisorySystemsSelect if apiver < 3 { selectQuery = SystemsSelectV2 } - query := database.SystemAdvisories(db, account). + query := database.SystemAdvisories(db, account, groups). Select(selectQuery). Joins("JOIN advisory_metadata am ON am.id = sa.advisory_id"). - Joins("JOIN inventory.hosts ih ON ih.id = sp.inventory_id"). Joins("LEFT JOIN status st ON sa.status_id = st.id"). Joins("LEFT JOIN baseline bl ON sp.baseline_id = bl.id AND sp.rh_account_id = bl.rh_account_id"). Where("am.name = ?", advisoryName). diff --git a/manager/controllers/advisory_systems_export.go b/manager/controllers/advisory_systems_export.go index 9f0d449ff..9edcfb202 100644 --- a/manager/controllers/advisory_systems_export.go +++ b/manager/controllers/advisory_systems_export.go @@ -22,8 +22,9 @@ import ( // @Param filter[id] query string false "Filter" // @Param filter[display_name] query string false "Filter" // @Param filter[stale] query string false "Filter" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" // @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" -// @Param filter[system_profile][sap_sids][in] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" // @Param filter[system_profile][ansible] query string false "Filter systems by ansible" // @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" // @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" @@ -38,8 +39,10 @@ import ( // @Router /export/advisories/{advisory_id}/systems [get] func AdvisorySystemsExportHandler(c *gin.Context) { account := c.GetInt(middlewares.KeyAccount) - advisoryName := c.Param("advisory_id") apiver := c.GetInt(middlewares.KeyApiver) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) + + advisoryName := c.Param("advisory_id") if advisoryName == "" { c.JSON(http.StatusBadRequest, utils.ErrorResponse{Error: "advisory_id param not found"}) return @@ -57,12 +60,12 @@ func AdvisorySystemsExportHandler(c *gin.Context) { return } - query := buildAdvisorySystemsQuery(db, account, advisoryName, apiver) - filters, err := ParseTagsFilters(c) + query := buildAdvisorySystemsQuery(db, account, groups, advisoryName, apiver) + filters, err := ParseAllFilters(c, AdvisorySystemOpts) if err != nil { return } // Error handled in method itself - query, _ = ApplyTagsFilter(filters, query, "sp.inventory_id") + query, _ = ApplyInventoryFilter(filters, query, "sp.inventory_id") query = query.Order("sp.id") query, err = ExportListCommon(query, c, AdvisorySystemOpts) diff --git a/manager/controllers/advisory_systems_export_test.go b/manager/controllers/advisory_systems_export_test.go index 724ac3d31..02a480b88 100644 --- a/manager/controllers/advisory_systems_export_test.go +++ b/manager/controllers/advisory_systems_export_test.go @@ -32,10 +32,11 @@ func TestAdvisorySystemsExportCSV(t *testing.T) { assert.Equal(t, 8, len(lines)) assert.Equal(t, "display_name,last_upload,stale,os,rhsm,stale_timestamp,stale_warning_timestamp,culled_timestamp,created,tags,"+ - "baseline_id,baseline_name,status,id", lines[0]) + "groups,baseline_id,baseline_name,status,satellite_managed,built_pkgcache,id", lines[0]) assert.Equal(t, "00000000-0000-0000-0000-000000000001,2020-09-22T16:00:00Z,false,RHEL 8.10,8.10,2018-08-26T16:00:00Z,"+ "2018-09-02T16:00:00Z,2018-09-09T16:00:00Z,2018-08-26T16:00:00Z,\"[{'key':'k1','namespace':'ns1','value':'val1'},"+ - "{'key':'k2','namespace':'ns1','value':'val2'}]\",1,baseline_1-1,Installable,00000000-0000-0000-0000-000000000001", + "{'key':'k2','namespace':'ns1','value':'val2'}]\",\"[{'id':'inventory-group-1','name':'group1'}]\","+ + "1,baseline_1-1,Installable,false,false,00000000-0000-0000-0000-000000000001", lines[1]) } diff --git a/manager/controllers/advisory_systems_test.go b/manager/controllers/advisory_systems_test.go index f54ae47b3..8ed10f1da 100644 --- a/manager/controllers/advisory_systems_test.go +++ b/manager/controllers/advisory_systems_test.go @@ -30,16 +30,21 @@ func TestAdvisorySystemsDefault(t *testing.T) { //nolint:dupl assert.Equal(t, SystemTagsList{{"k1", "ns1", "val1"}, {"k2", "ns1", "val2"}}, output.Data[0].Attributes.Tags) assert.Equal(t, "baseline_1-1", output.Data[0].Attributes.BaselineName) assert.Equal(t, int64(1), output.Data[0].Attributes.BaselineID) + assert.False(t, output.Data[0].Attributes.SatelliteManaged) + assert.False(t, output.Data[0].Attributes.BuiltPkgcache) } func TestAdvisorySystemsIDsDefault(t *testing.T) { //nolint:dupl core.SetupTest(t) w := CreateRequestRouterWithPath("GET", "/RH-1", nil, "", AdvisorySystemsListIDsHandler, "/:advisory_id") - var output IDsResponse + var output IDsStatusResponse CheckResponse(t, w, http.StatusOK, &output) assert.Equal(t, 6, len(output.IDs)) assert.Equal(t, "00000000-0000-0000-0000-000000000001", output.IDs[0]) + assert.Equal(t, 6, len(output.Data)) + assert.Equal(t, "00000000-0000-0000-0000-000000000001", output.Data[0].ID) + assert.Equal(t, "Installable", output.Data[0].Status) } func TestAdvisorySystemsNotFound(t *testing.T) { //nolint:dupl @@ -75,7 +80,7 @@ func TestAdvisorySystemsOffsetOverflow(t *testing.T) { func TestAdvisorySystemsSorts(t *testing.T) { core.SetupTest(t) - for sort := range SystemsFields { + for sort := range AdvisorySystemsFields { w := CreateRequestRouterWithPath("GET", fmt.Sprintf("/RH-1?sort=%v", sort), nil, "", AdvisorySystemsListHandler, "/:advisory_id") @@ -148,9 +153,9 @@ func TestAdvisorySystemsTagsInMetadata(t *testing.T) { CheckResponse(t, w, http.StatusOK, &output) testMap := map[string]FilterData{ - "ns1/k1": {"eq", []string{"val1"}}, - "ns1/k3": {"eq", []string{"val4"}}, - "stale": {"eq", []string{"false"}}, + "ns1/k1": {Operator: "eq", Values: []string{"val1"}}, + "ns1/k3": {Operator: "eq", Values: []string{"val4"}}, + "stale": {Operator: "eq", Values: []string{"false"}}, } assert.Equal(t, testMap, output.Meta.Filter) } diff --git a/manager/controllers/advisory_systems_v3.go b/manager/controllers/advisory_systems_v3.go index a33cb9d50..e24326def 100644 --- a/manager/controllers/advisory_systems_v3.go +++ b/manager/controllers/advisory_systems_v3.go @@ -6,6 +6,7 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/pkg/errors" ) var AdvisorySystemsFields = database.MustGetQueryAttrs(&AdvisorySystemDBLookup{}) @@ -38,9 +39,17 @@ type AdvisorySystemItemAttributes struct { OSAttributes SystemTimestamps SystemTags + SystemGroups BaselineIDAttr BaselineNameAttr SystemAdvisoryStatus + SystemSatelliteManaged + SystemBuiltPkgcache +} + +type SystemsStatusID struct { + SystemsID + SystemAdvisoryStatus } var AdvisorySystemOptsV3 = ListOpts{ @@ -92,10 +101,12 @@ func buildAdvisorySystemsData(fields []AdvisorySystemDBLookup) ([]AdvisorySystem } data := make([]AdvisorySystemItem, len(fields)) for i, as := range fields { - as.AdvisorySystemItemAttributes.Tags, err = parseSystemTags(as.TagsStr) - if err != nil { + if err = parseSystemItems(as.TagsStr, &as.AdvisorySystemItemAttributes.Tags); err != nil { utils.LogDebug("err", err.Error(), "inventory_id", as.ID, "system tags parsing failed") } + if err = parseSystemItems(as.GroupsStr, &as.AdvisorySystemItemAttributes.Groups); err != nil { + utils.LogDebug("err", err.Error(), "inventory_id", as.ID, "system groups parsing failed") + } data[i] = AdvisorySystemItem{ Attributes: as.AdvisorySystemItemAttributes, ID: as.ID, @@ -104,3 +115,28 @@ func buildAdvisorySystemsData(fields []AdvisorySystemDBLookup) ([]AdvisorySystem } return data, total } + +func systemsIDsStatus(c *gin.Context, systems []SystemsStatusID, meta *ListMeta) (IDsStatusResponse, error) { + var total int + resp := IDsStatusResponse{} + if len(systems) > 0 { + total = systems[0].Total + } + if meta.Offset > total { + err := errors.New("Offset") + LogAndRespBadRequest(c, err, InvalidOffsetMsg) + return resp, err + } + if systems == nil { + return resp, nil + } + ids := make([]string, len(systems)) + data := make([]IDStatus, len(systems)) + for i, x := range systems { + ids[i] = x.ID + data[i] = IDStatus{x.ID, x.Status} + } + resp.IDs = ids + resp.Data = data + return resp, nil +} diff --git a/manager/controllers/baseline_create.go b/manager/controllers/baseline_create.go index 5ae77528f..d192dd1f4 100644 --- a/manager/controllers/baseline_create.go +++ b/manager/controllers/baseline_create.go @@ -38,8 +38,13 @@ type CreateBaselineResponse struct { BaselineID int64 `json:"baseline_id" example:"1"` // Updated baseline unique ID, it can not be changed } +type SystemBaselineDBLookup struct { + InventoryID string `query:"sp.inventory_id"` + SatelliteManaged bool `query:"sp.satellite_managed"` +} + // @Summary Create a baseline for my set of systems -// @Description Create a baseline for my set of systems +// @Description Create a baseline for my set of systems. System cannot be satellite managed. // @ID createBaseline // @Security RhIdentity // @Accept json @@ -74,13 +79,17 @@ func CreateBaselineHandler(c *gin.Context) { request.Description = utils.EmptyToNil(request.Description) db := middlewares.DBFromContext(c) - missingIDs, err := checkInventoryIDs(db, accountID, request.InventoryIDs) + missingIDs, satelliteManagedIDs, err := checkInventoryIDs(db, accountID, request.InventoryIDs) if err != nil { LogAndRespError(c, err, "Database error") return } - if len(missingIDs) > 0 { + if enableSatelliteFunctionality && len(satelliteManagedIDs) > 0 { + msg := fmt.Sprintf("Attempting to add satellite managed systems to baseline: %v", satelliteManagedIDs) + LogAndRespBadRequest(c, errors.New(msg), msg) + return + } else if len(missingIDs) > 0 { msg := fmt.Sprintf("Missing inventory_ids: %v", missingIDs) LogAndRespNotFound(c, errors.New(msg), msg) return @@ -88,7 +97,7 @@ func CreateBaselineHandler(c *gin.Context) { baselineID, err := buildCreateBaselineQuery(db, request, accountID) if err != nil { - if database.IsPgErrorCode(err, database.PgErrorDuplicateKey) { + if database.IsPgErrorCode(db, err, gorm.ErrDuplicatedKey) { LogAndRespBadRequest(c, err, DuplicateBaselineNameErr) return } @@ -141,22 +150,23 @@ func buildCreateBaselineQuery(db *gorm.DB, request CreateBaselineRequest, accoun return baseline.ID, err } -func checkInventoryIDs(db *gorm.DB, accountID int, inventoryIDs []string) (missingIDs []string, err error) { - var containingIDs []string +func checkInventoryIDs(db *gorm.DB, accountID int, inventoryIDs []string, +) (missingIDs, satelliteManagedIDs []string, err error) { + var containingSystems []SystemBaselineDBLookup err = db.Table("system_platform sp"). Where("rh_account_id = ? AND inventory_id::text IN (?)", accountID, inventoryIDs). - Pluck("sp.inventory_id", &containingIDs).Error + Scan(&containingSystems).Error if err != nil { - return nil, err + return nil, nil, err } - if len(inventoryIDs) == len(containingIDs) { - return []string{}, nil // all inventoryIDs found in database - } + containingIDsMap := make(map[string]bool, len(containingSystems)) + for _, containingSystem := range containingSystems { + containingIDsMap[containingSystem.InventoryID] = true - containingIDsMap := make(map[string]bool, len(containingIDs)) - for _, containingID := range containingIDs { - containingIDsMap[containingID] = true + if containingSystem.SatelliteManaged { + satelliteManagedIDs = append(satelliteManagedIDs, containingSystem.InventoryID) + } } for _, inventoryID := range inventoryIDs { @@ -164,6 +174,9 @@ func checkInventoryIDs(db *gorm.DB, accountID int, inventoryIDs []string) (missi missingIDs = append(missingIDs, inventoryID) } } + sort.Strings(missingIDs) - return missingIDs, nil + sort.Strings(satelliteManagedIDs) + + return missingIDs, satelliteManagedIDs, nil } diff --git a/manager/controllers/baseline_create_test.go b/manager/controllers/baseline_create_test.go index bbe6a5f2c..2f7f4b119 100644 --- a/manager/controllers/baseline_create_test.go +++ b/manager/controllers/baseline_create_test.go @@ -3,6 +3,7 @@ package controllers import ( "app/base/core" "app/base/database" + "app/base/models" "app/base/utils" "bytes" "net/http" @@ -108,3 +109,33 @@ func TestCreateBaselineDescriptionSpaces(t *testing.T) { var err utils.ErrorResponse CheckResponse(t, w, http.StatusBadRequest, &err) } + +func TestCreateBaselineSatelliteSystem(t *testing.T) { + core.SetupTest(t) + + system := models.SystemPlatform{ + InventoryID: "99999999-0000-0000-0000-000000000015", + DisplayName: "satellite_system_test", + RhAccountID: 1, + BuiltPkgcache: true, + SatelliteManaged: true, + } + tx := database.Db.Create(&system) + assert.Nil(t, tx.Error) + defer database.Db.Delete(system) + + data := `{ + "name": "baseline_satellite", + "inventory_ids": [ + "00000000-0000-0000-0000-000000000005", + "99999999-0000-0000-0000-000000000015" + ], + "config": {"to_time": "2022-12-31T12:00:00-04:00"}, + "description": "desc" + }` + + w := CreateRequestRouterWithParams("PUT", "/", bytes.NewBufferString(data), "", + CreateBaselineHandler, 1, "PUT", "/") + var err utils.ErrorResponse + CheckResponse(t, w, http.StatusBadRequest, &err) +} diff --git a/manager/controllers/baseline_systems.go b/manager/controllers/baseline_systems.go index 09d8a0e9e..430738cab 100644 --- a/manager/controllers/baseline_systems.go +++ b/manager/controllers/baseline_systems.go @@ -51,6 +51,7 @@ type BaselineSystemAttributes struct { InstallableAdvisories ApplicableAdvisories SystemTags + SystemGroups SystemLastUpload } @@ -85,6 +86,57 @@ type BaselineSystemsResponse struct { Meta ListMeta `json:"meta"` } +func queryBaselineSystems(c *gin.Context, account, apiver int, groups map[string]string) (*gorm.DB, error) { + baselineID := c.Param("baseline_id") + id, err := strconv.ParseInt(baselineID, 10, 64) + if err != nil { + LogAndRespBadRequest(c, err, fmt.Sprintf("Invalid baseline_id: %s", baselineID)) + return nil, err + } + + db := middlewares.DBFromContext(c) + var exists int64 + err = db.Model(&models.Baseline{}). + Where("id = ? ", id).Count(&exists).Error + if err != nil { + LogAndRespError(c, err, "database error") + return nil, err + } + if exists == 0 { + LogAndRespNotFound(c, errors.New("Baseline not found"), "Baseline not found") + return nil, err + } + + query := buildQueryBaselineSystems(db, account, groups, id, apiver) + filters, err := ParseAllFilters(c, BaselineSystemOpts) + if err != nil { + return nil, err + } // Error handled in method itself + query, _ = ApplyInventoryFilter(filters, query, "sp.inventory_id") + return query, nil +} + +func baselineSystemsCommon(c *gin.Context, account, apiver int, groups map[string]string, +) (*gorm.DB, *ListMeta, []string, error) { + query, err := queryBaselineSystems(c, account, apiver, groups) + if err != nil { + return nil, nil, nil, err + } // Error handled in method itself + + filters, err := ParseAllFilters(c, PackageSystemsOpts) + if err != nil { + // Error handled in method itself + return nil, nil, nil, err + } + query, meta, params, err := ListCommon(query, c, filters, BaselineSystemOpts) + if err != nil { + // Error handling and setting of result code & content is done in ListCommon + return nil, nil, nil, err + } + + return query, meta, params, err +} + // nolint: lll // @Summary Show me all systems belonging to a baseline // @Description Show me all systems applicable to a baseline @@ -95,11 +147,18 @@ type BaselineSystemsResponse struct { // @Param baseline_id path int true "Baseline ID" // @Param limit query int false "Limit for paging, set -1 to return all" // @Param offset query int false "Offset for paging" -// @Param sort query string false "Sort field" Enums(id,display_name,os,installable_rhsa_count,installable_rhba_count,installable_rhea_count,installable_other_count,applicable_rhsa_count,applicable_rhba_count,applicable_rhea_count,applicable_other_count,last_upload) +// @Param sort query string false "Sort field" Enums(id,display_name,os,installable_rhsa_count,installable_rhba_count,installable_rhea_count,installable_other_count,applicable_rhsa_count,applicable_rhba_count,applicable_rhea_count,applicable_other_count,last_upload,groups) // @Param search query string false "Find matching text" // @Param filter[display_name] query string false "Filter" // @Param filter[os] query string false "Filter" // @Param tags query []string false "Tag filter" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" +// @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][ansible] query string false "Filter systems by ansible" +// @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" +// @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" +// @Param filter[system_profile][mssql][version] query string false "Filter systems by mssql version" // @Success 200 {object} BaselineSystemsResponse // @Failure 400 {object} utils.ErrorResponse // @Failure 404 {object} utils.ErrorResponse @@ -108,39 +167,12 @@ type BaselineSystemsResponse struct { func BaselineSystemsListHandler(c *gin.Context) { account := c.GetInt(middlewares.KeyAccount) apiver := c.GetInt(middlewares.KeyApiver) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) - baselineID := c.Param("baseline_id") - id, err := strconv.ParseInt(baselineID, 10, 64) - if err != nil { - LogAndRespBadRequest(c, err, fmt.Sprintf("Invalid baseline_id: %s", baselineID)) - return - } - - db := middlewares.DBFromContext(c) - var exists int64 - err = db.Model(&models.Baseline{}). - Where("id = ? ", id).Count(&exists).Error - if err != nil { - LogAndRespError(c, err, "database error") - return - } - if exists == 0 { - LogAndRespNotFound(c, errors.New("Baseline not found"), "Baseline not found") - return - } - - query := buildQueryBaselineSystems(db, account, id, apiver) - filters, err := ParseTagsFilters(c) + query, meta, params, err := baselineSystemsCommon(c, account, apiver, groups) if err != nil { return } // Error handled in method itself - query, _ = ApplyTagsFilter(filters, query, "sp.inventory_id") - - query, meta, params, err := ListCommon(query, c, nil, BaselineSystemOpts) - if err != nil { - // Error handling and setting of result code & content is done in ListCommon - return - } var baselineSystems []BaselineSystemsDBLookup err = query.Find(&baselineSystems).Error @@ -167,10 +199,59 @@ func BaselineSystemsListHandler(c *gin.Context) { c.JSON(http.StatusOK, &resp) } -func buildQueryBaselineSystems(db *gorm.DB, account int, baselineID int64, apiver int) *gorm.DB { - query := db.Table("system_platform AS sp"). - Joins("JOIN inventory.hosts ih ON ih.id = sp.inventory_id"). - Where("sp.rh_account_id = ? AND sp.baseline_id = ?", account, baselineID) +// nolint: lll +// @Summary Show me all systems belonging to a baseline +// @Description Show me all systems applicable to a baseline +// @ID listBaselineSystemsIds +// @Security RhIdentity +// @Accept json +// @Produce json +// @Param baseline_id path int true "Baseline ID" +// @Param limit query int false "Limit for paging, set -1 to return all" +// @Param offset query int false "Offset for paging" +// @Param sort query string false "Sort field" Enums(id,display_name,os,installable_rhsa_count,installable_rhba_count,installable_rhea_count,installable_other_count,applicable_rhsa_count,applicable_rhba_count,applicable_rhea_count,applicable_other_count,last_upload) +// @Param search query string false "Find matching text" +// @Param filter[display_name] query string false "Filter" +// @Param filter[os] query string false "Filter" +// @Param tags query []string false "Tag filter" +// @Success 200 {object} IDsResponse +// @Failure 400 {object} utils.ErrorResponse +// @Failure 404 {object} utils.ErrorResponse +// @Failure 500 {object} utils.ErrorResponse +// @Router /ids/baselines/{baseline_id}/systems [get] +func BaselineSystemsListIDsHandler(c *gin.Context) { + account := c.GetInt(middlewares.KeyAccount) + apiver := c.GetInt(middlewares.KeyApiver) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) + if apiver < 3 { + c.AbortWithStatus(404) + return + } + + query, meta, _, err := baselineSystemsCommon(c, account, apiver, groups) + if err != nil { + return + } // Error handled in method itself + + var sids []SystemsID + + if err = query.Scan(&sids).Error; err != nil { + LogAndRespError(c, err, "db error") + return + } + + ids, err := systemsIDs(c, sids, meta) + if err != nil { + return // Error handled in method itself + } + var resp = IDsResponse{IDs: ids} + c.JSON(http.StatusOK, &resp) +} + +func buildQueryBaselineSystems(db *gorm.DB, account int, groups map[string]string, baselineID int64, apiver int, +) *gorm.DB { + query := database.Systems(db, account, groups). + Where("sp.baseline_id = ?", baselineID) if apiver < 3 { query.Select(BaselineSystemSelectV2) } else { @@ -181,16 +262,17 @@ func buildQueryBaselineSystems(db *gorm.DB, account int, baselineID int64, apive func buildBaselineSystemData(baselineSystems []BaselineSystemsDBLookup) ([]BaselineSystemItem, int) { var total int - var err error if len(baselineSystems) > 0 { total = baselineSystems[0].Total } data := make([]BaselineSystemItem, len(baselineSystems)) for i := 0; i < len(baselineSystems); i++ { - baselineSystems[i].Tags, err = parseSystemTags(baselineSystems[i].TagsStr) - if err != nil { + if err := parseSystemItems(baselineSystems[i].TagsStr, &baselineSystems[i].Tags); err != nil { utils.LogDebug("err", err.Error(), "inventory_id", baselineSystems[i].ID, "system tags parsing failed") } + if err := parseSystemItems(baselineSystems[i].GroupsStr, &baselineSystems[i].Groups); err != nil { + utils.LogDebug("err", err.Error(), "inventory_id", baselineSystems[i].ID, "system groups parsing failed") + } data[i] = BaselineSystemItem{ Attributes: baselineSystems[i].BaselineSystemAttributes, BaselineSystemItemCommon: BaselineSystemItemCommon{ diff --git a/manager/controllers/baseline_systems_export.go b/manager/controllers/baseline_systems_export.go new file mode 100644 index 000000000..a5eee0ff3 --- /dev/null +++ b/manager/controllers/baseline_systems_export.go @@ -0,0 +1,64 @@ +package controllers + +import ( + "app/manager/middlewares" + "fmt" + + "github.com/gin-gonic/gin" +) + +// nolint: lll +// @Summary Export systems belonging to a baseline +// @Description Export systems applicable to a baseline +// @ID exportBaselineSystems +// @Security RhIdentity +// @Accept json +// @Produce json,text/csv +// @Param baseline_id path int true "Baseline ID" +// @Param search query string false "Find matching text" +// @Param filter[display_name] query string false "Filter" +// @Param filter[os] query string false "Filter" +// @Param tags query []string false "Tag filter" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" +// @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][ansible] query string false "Filter systems by ansible" +// @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" +// @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" +// @Param filter[system_profile][mssql][version] query string false "Filter systems by mssql version" +// @Success 200 {array} BaselineSystemsDBLookup +// @Failure 400 {object} utils.ErrorResponse +// @Failure 404 {object} utils.ErrorResponse +// @Failure 415 {object} utils.ErrorResponse +// @Failure 500 {object} utils.ErrorResponse +// @Router /export/baselines/{baseline_id}/systems [get] +func BaselineSystemsExportHandler(c *gin.Context) { + account := c.GetInt(middlewares.KeyAccount) + apiver := c.GetInt(middlewares.KeyApiver) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) + if apiver < 3 { + err := fmt.Errorf("endpoint does not exist in v%d API, use API >= v3", apiver) + LogAndRespNotFound(c, err, err.Error()) + return + } + + query, err := queryBaselineSystems(c, account, apiver, groups) + if err != nil { + return + } // Error handled in method itself + + query, err = ExportListCommon(query, c, BaselineSystemOpts) + if err != nil { + return + } // Error handled in method itself + + var baselineSystems BaselineSystemsDBLookupSlice + err = query.Find(&baselineSystems).Error + if err != nil { + LogAndRespError(c, err, err.Error()) + return + } + + baselineSystems.ParseAndFillTags() + OutputExportData(c, baselineSystems) +} diff --git a/manager/controllers/baseline_systems_export_test.go b/manager/controllers/baseline_systems_export_test.go new file mode 100644 index 000000000..58a568567 --- /dev/null +++ b/manager/controllers/baseline_systems_export_test.go @@ -0,0 +1,127 @@ +package controllers + +import ( + "app/base/core" + "app/base/utils" + "fmt" + "net/http" + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestBaselineSystemsExportJSON(t *testing.T) { + core.SetupTest(t) + w := CreateRequestRouterWithPath("GET", "/1/systems", nil, "application/json", BaselineSystemsExportHandler, + "/:baseline_id/systems") + + var output []BaselineSystemsDBLookup + CheckResponse(t, w, http.StatusOK, &output) + assert.Equal(t, 2, len(output)) + + assert.Equal(t, "00000000-0000-0000-0000-000000000001", output[0].ID) + assert.Equal(t, "00000000-0000-0000-0000-000000000001", output[0].DisplayName) + assert.Equal(t, "RHEL 8.10", output[0].OS) + assert.Equal(t, "8.10", output[0].Rhsm) + assert.Equal(t, 2, output[0].InstallableRhsaCount) + assert.Equal(t, 2, output[0].InstallableRhbaCount) + assert.Equal(t, 1, output[0].InstallableRheaCount) + assert.Equal(t, 0, output[0].InstallableOtherCount) + assert.Equal(t, 2, output[0].ApplicableRhsaCount) + assert.Equal(t, 3, output[0].ApplicableRhbaCount) + assert.Equal(t, 3, output[0].ApplicableRheaCount) + assert.Equal(t, 0, output[0].ApplicableOtherCount) + assert.Equal(t, "00000000-0000-0000-0000-000000000002", output[1].ID) + assert.Equal(t, "00000000-0000-0000-0000-000000000002", output[1].DisplayName) +} + +func TestBaselineSystemsExportCSV(t *testing.T) { + core.SetupTest(t) + w := CreateRequestRouterWithPath("GET", "/1/systems", nil, "text/csv", BaselineSystemsExportHandler, + "/:baseline_id/systems") + + assert.Equal(t, http.StatusOK, w.Code) + body := w.Body.String() + lines := strings.Split(body, "\n") + + assert.Equal(t, 4, len(lines)) + assert.Equal(t, + "id,display_name,os,rhsm,installable_rhsa_count,installable_rhba_count,installable_rhea_count,"+ + "installable_other_count,applicable_rhsa_count,applicable_rhba_count,applicable_rhea_count,"+ + "applicable_other_count,tags,groups,last_upload", + lines[0]) + + assert.Equal(t, "00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000001,RHEL 8.10,"+ + "8.10,2,2,1,0,2,3,3,0,\"[{'key':'k1','namespace':'ns1','value':'val1'},"+ + "{'key':'k2','namespace':'ns1','value':'val2'}]\","+ + "\"[{'id':'inventory-group-1','name':'group1'}]\",2020-09-22T16:00:00Z", + lines[1]) +} + +func TestBaselineSystemsExportWrongFormat(t *testing.T) { + core.SetupTest(t) + w := CreateRequestRouterWithPath("GET", "/1/systems", nil, "test-format", BaselineSystemsExportHandler, + "/:baseline_id/systems") + + assert.Equal(t, http.StatusUnsupportedMediaType, w.Code) + body := w.Body.String() + assert.Equal(t, InvalidContentTypeErr, body) +} + +func TestBaselineSystemsExportCSVFilter(t *testing.T) { + core.SetupTest(t) + w := CreateRequestRouterWithPath("GET", "/1/systems?filter[display_name]=nonexistant", nil, "text/csv", + BaselineSystemsExportHandler, "/:baseline_id/systems") + + assert.Equal(t, http.StatusOK, w.Code) + body := w.Body.String() + lines := strings.Split(body, "\n") + + assert.Equal(t, + "id,display_name,os,rhsm,installable_rhsa_count,installable_rhba_count,installable_rhea_count,"+ + "installable_other_count,applicable_rhsa_count,applicable_rhba_count,applicable_rhea_count,"+ + "applicable_other_count,tags,groups,last_upload", + lines[0]) + assert.Equal(t, "", lines[1]) +} + +func TestExportBaselineSystemsTags(t *testing.T) { + core.SetupTest(t) + w := CreateRequestRouterWithPath("GET", "/1/systems?tags=ns1/k2=val2", nil, "application/json", + BaselineSystemsExportHandler, "/:baseline_id/systems") + + var output []BaselineSystemsDBLookup + CheckResponse(t, w, http.StatusOK, &output) + + assert.Equal(t, 2, len(output)) + assert.Equal(t, "00000000-0000-0000-0000-000000000001", output[0].ID) +} + +func TestExportBaselineSystemsTagsInvalid(t *testing.T) { + core.SetupTest(t) + w := CreateRequestRouterWithPath("GET", "/1/systems?tags=ns1/k3=val4&tags=invalidTag", nil, "application/json", + BaselineSystemsExportHandler, "/:baseline_id/systems") + + var errResp utils.ErrorResponse + CheckResponse(t, w, http.StatusBadRequest, &errResp) + assert.Equal(t, fmt.Sprintf(InvalidTagMsg, "invalidTag"), errResp.Error) +} + +func TestBaselineSystemsExportWorkloads(t *testing.T) { + core.SetupTest(t) + w := CreateRequestRouterWithPath( + "GET", + "/1/systems?filter[system_profile][sap_system]=true&filter[system_profile][sap_sids]=ABC", + nil, + "application/json", + BaselineSystemsExportHandler, + "/:baseline_id/systems", + ) + + var output []BaselineSystemsDBLookup + CheckResponse(t, w, http.StatusOK, &output) + + assert.Equal(t, 2, len(output)) + assert.Equal(t, "00000000-0000-0000-0000-000000000001", output[0].ID) +} diff --git a/manager/controllers/baseline_systems_remove.go b/manager/controllers/baseline_systems_remove.go index 200ee745a..14270837c 100644 --- a/manager/controllers/baseline_systems_remove.go +++ b/manager/controllers/baseline_systems_remove.go @@ -3,6 +3,7 @@ package controllers import ( "app/base/models" "app/base/utils" + "app/manager/kafka" "app/manager/middlewares" "net/http" @@ -52,6 +53,10 @@ func BaselineSystemsRemoveHandler(c *gin.Context) { return } + // re-evaluate systems removed from baselines + inventoryAIDs := kafka.InventoryIDs2InventoryAIDs(account, req.InventoryIDs) + kafka.EvaluateBaselineSystems(inventoryAIDs) + c.Status(http.StatusOK) } diff --git a/manager/controllers/baseline_update.go b/manager/controllers/baseline_update.go index d59ca0ba4..e15a253fe 100644 --- a/manager/controllers/baseline_update.go +++ b/manager/controllers/baseline_update.go @@ -38,7 +38,7 @@ type UpdateBaselineResponse struct { // nolint: funlen // @Summary Update a baseline for my set of systems -// @Description Update a baseline for my set of systems +// @Description Update a baseline for my set of systems. System cannot be satellite managed. // @ID updateBaseline // @Security RhIdentity // @Accept json @@ -90,13 +90,17 @@ func BaselineUpdateHandler(c *gin.Context) { } inventoryIDsList := map2list(req.InventoryIDs) - missingIDs, err := checkInventoryIDs(db, account, inventoryIDsList) + missingIDs, satelliteManagedIDs, err := checkInventoryIDs(db, account, inventoryIDsList) if err != nil { LogAndRespError(c, err, "Database error") return } - if len(missingIDs) > 0 { + if enableSatelliteFunctionality && len(satelliteManagedIDs) > 0 { + msg := fmt.Sprintf("Attempting to add satellite managed systems to baseline: %v", satelliteManagedIDs) + LogAndRespBadRequest(c, errors.New(msg), msg) + return + } else if len(missingIDs) > 0 { msg := fmt.Sprintf("Missing inventory_ids: %v", missingIDs) LogAndRespNotFound(c, errors.New(msg), msg) return @@ -109,7 +113,7 @@ func BaselineUpdateHandler(c *gin.Context) { LogAndRespBadRequest(c, err, "Invalid inventory IDs: "+e) return } - if database.IsPgErrorCode(err, database.PgErrorDuplicateKey) { + if database.IsPgErrorCode(db, err, gorm.ErrDuplicatedKey) { LogAndRespBadRequest(c, err, DuplicateBaselineNameErr) return } diff --git a/manager/controllers/baseline_update_test.go b/manager/controllers/baseline_update_test.go index f055357a3..4cc498254 100644 --- a/manager/controllers/baseline_update_test.go +++ b/manager/controllers/baseline_update_test.go @@ -3,6 +3,7 @@ package controllers import ( "app/base/core" "app/base/database" + "app/base/models" "app/base/utils" "bytes" "fmt" @@ -269,3 +270,35 @@ func TestUpdateBaselineSpacesDescription(t *testing.T) { var err utils.ErrorResponse CheckResponse(t, w, http.StatusBadRequest, &err) } + +func TestUpdateBaselineSatelliteSystem(t *testing.T) { + core.SetupTestEnvironment() + + baselineName := "baseline_satellite" + desc := "satellite baseline" + baselineID := database.CreateBaseline(t, baselineName, []string{}, &desc) + defer database.DeleteBaseline(t, baselineID) + + system := models.SystemPlatform{ + InventoryID: "99999999-0000-0000-0000-000000000015", + DisplayName: "satellite_system_test", + RhAccountID: 1, + BuiltPkgcache: true, + SatelliteManaged: true, + } + tx := database.Db.Create(&system) + assert.Nil(t, tx.Error) + defer database.Db.Delete(system) + + data := `{ + "inventory_ids": { + "00000000-0000-0000-0000-000000000001": true, + "99999999-0000-0000-0000-000000000015": true + } + }` + + w := CreateRequestRouterWithParams("PUT", fmt.Sprintf("/%v", baselineID), bytes.NewBufferString(data), "", + BaselineUpdateHandler, 1, "PUT", "/:baseline_id") + var err utils.ErrorResponse + CheckResponse(t, w, http.StatusBadRequest, &err) +} diff --git a/manager/controllers/baselines.go b/manager/controllers/baselines.go index 71e061e88..a0ee51345 100644 --- a/manager/controllers/baselines.go +++ b/manager/controllers/baselines.go @@ -83,13 +83,14 @@ type BaselinesResponse struct { func BaselinesListHandler(c *gin.Context) { account := c.GetInt(middlewares.KeyAccount) apiver := c.GetInt(middlewares.KeyApiver) - filters, err := ParseTagsFilters(c) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) + filters, err := ParseAllFilters(c, BaselineOpts) if err != nil { return } db := middlewares.DBFromContext(c) - query := buildQueryBaselines(db, filters, account) + query := buildQueryBaselines(db, filters, account, groups) if err != nil { return } // Error handled in method itself @@ -128,14 +129,12 @@ func BaselinesListHandler(c *gin.Context) { c.JSON(http.StatusOK, &resp) } -func buildQueryBaselines(db *gorm.DB, filters map[string]FilterData, account int) *gorm.DB { - subq := db.Table("system_platform sp"). +func buildQueryBaselines(db *gorm.DB, filters map[string]FilterData, account int, groups map[string]string) *gorm.DB { + subq := database.Systems(db, account, groups). Select("sp.baseline_id, count(sp.inventory_id) as systems"). - Joins("JOIN inventory.hosts ih ON ih.id = sp.inventory_id"). - Where("sp.rh_account_id = ?", account). Group("sp.baseline_id") - subq, _ = ApplyTagsFilter(filters, subq, "sp.inventory_id") + subq, _ = ApplyInventoryFilter(filters, subq, "sp.inventory_id") query := db.Table("baseline as bl"). Select(BaselineSelect). diff --git a/manager/controllers/common_attributes.go b/manager/controllers/common_attributes.go index 61d3c60f4..181d9a2ab 100644 --- a/manager/controllers/common_attributes.go +++ b/manager/controllers/common_attributes.go @@ -6,6 +6,7 @@ import "time" type SystemsMetaTagTotal struct { MetaTotalHelper TagsStrHelper + GroupsStrHelper } type TagsStrHelper struct { @@ -13,6 +14,11 @@ type TagsStrHelper struct { TagsStr string `json:"-" csv:"-" query:"ih.tags" gorm:"column:tags_str"` } +type GroupsStrHelper struct { + // Just helper field to get Groups from db in plain string, then parsed to "Groups" attr., excluded from output data. + GroupsStr string `json:"-" csv:"-" query:"ih.groups" gorm:"column:groups_str"` +} + type MetaTotalHelper struct { // a helper to get total number of systems Total int `json:"-" csv:"-" query:"count(*) over ()" gorm:"column:total"` @@ -34,6 +40,10 @@ type SystemTags struct { Tags SystemTagsList `json:"tags" csv:"tags" gorm:"-"` } +type SystemGroups struct { + Groups SystemGroupsList `json:"groups" csv:"groups" gorm:"-" order_query:"ih.groups->>0"` +} + type BaselineAttributes struct { BaselineNameAttr BaselineUpToDateAttr @@ -68,7 +78,15 @@ type SystemIDAttribute struct { } type SystemAdvisoryStatus struct { - Status string `json:"status" csv:"status" query:"st.name" gorm:"column:name"` + Status string `json:"status" csv:"status" query:"st.name" gorm:"column:status"` +} + +type SystemSatelliteManaged struct { + SatelliteManaged bool `json:"satellite_managed" csv:"satellite_managed" query:"sp.satellite_managed" gorm:"column:satellite_managed"` +} + +type SystemBuiltPkgcache struct { + BuiltPkgcache bool `json:"built_pkgcache" csv:"built_pkgcache" query:"sp.built_pkgcache" gorm:"column:built_pkgcache"` } // nolint: lll diff --git a/manager/controllers/filter.go b/manager/controllers/filter.go index 75bcdad8e..d09816039 100644 --- a/manager/controllers/filter.go +++ b/manager/controllers/filter.go @@ -3,20 +3,30 @@ package controllers import ( "app/base/database" "fmt" + "strings" + "github.com/pkg/errors" "gorm.io/gorm" - "strings" +) + +type FilterType int8 + +const ( + ColumnFilter FilterType = iota + InventoryFilter + TagFilter ) type FilterData struct { - Operator string `json:"op"` - Values []string `json:"values"` + Type FilterType `json:"-"` + Operator string `json:"op"` + Values []string `json:"values"` } type Filters map[string]FilterData // Parse a filter from field name and field value specification -func ParseFilterValue(val string) (FilterData, error) { +func ParseFilterValue(ftype FilterType, val string) FilterData { idx := strings.Index(val, ":") var operator string @@ -33,9 +43,10 @@ func ParseFilterValue(val string) (FilterData, error) { values := strings.Split(value, ",") return FilterData{ + Type: ftype, Operator: operator, Values: values, - }, nil + } } func checkValueCount(operator string, nValues int) bool { @@ -88,9 +99,6 @@ func (t *FilterData) ToWhere(fieldName string, attributes database.AttrMap) (str case "leq": return fmt.Sprintf("%s <= ? ", attributes[fieldName].DataQuery), values, nil case "between": - if len(transformedValues) != 2 { - return "", []interface{}{}, errors.New("the `between` filter needs 2 values") - } return fmt.Sprintf("%s BETWEEN ? AND ? ", attributes[fieldName].DataQuery), values, nil case "in": return fmt.Sprintf("%s IN (?) ", attributes[fieldName].DataQuery), []interface{}{values}, nil @@ -136,13 +144,20 @@ func (t Filters) ToQueryParams() string { parts := make([]string, 0, len(t)) for name, v := range t { values := strings.Join(v.Values, ",") - parts = append(parts, fmt.Sprintf("filter[%s]=%s:%s", name, v.Operator, values)) + if v.Type == TagFilter { + parts = append(parts, fmt.Sprintf("tags=%s=%s", name, values)) + } else { + parts = append(parts, fmt.Sprintf("filter[%s]=%s:%s", name, v.Operator, values)) + } } return strings.Join(parts, "&") } func (t Filters) Apply(tx *gorm.DB, fields database.AttrMap) (*gorm.DB, error) { for name, f := range t { + if f.Type != ColumnFilter { + continue + } query, args, err := f.ToWhere(name, fields) if err != nil { return nil, err @@ -151,3 +166,11 @@ func (t Filters) Apply(tx *gorm.DB, fields database.AttrMap) (*gorm.DB, error) { } return tx, nil } + +func (t Filters) Update(ftype FilterType, key string, value string) { + data := ParseFilterValue(ftype, value) + if fdata, ok := t[key]; ok { + data.Values = append(data.Values, fdata.Values...) + } + t[key] = data +} diff --git a/manager/controllers/filter_test.go b/manager/controllers/filter_test.go index c3368bb24..e9177016f 100644 --- a/manager/controllers/filter_test.go +++ b/manager/controllers/filter_test.go @@ -34,8 +34,7 @@ func TestFilterParse(t *testing.T) { } for i, f := range testFilters { - filter, err := ParseFilterValue(f) - assert.Equal(t, nil, err) + filter := ParseFilterValue(ColumnFilter, f) assert.Equal(t, operators[i], filter.Operator) assert.Equal(t, values[i], filter.Values) } @@ -52,8 +51,7 @@ func TestFilterToSql(t *testing.T) { } for i, f := range testFilters { - filter, err := ParseFilterValue(f) - assert.Equal(t, nil, err) + filter := ParseFilterValue(ColumnFilter, f) attrMap := database.AttrMap{"test": {DataQuery: "test", OrderQuery: "test", Parser: dummyParser}} query, _, err := filter.ToWhere("test", attrMap) @@ -73,8 +71,7 @@ func TestFilterToSqlAdvanced(t *testing.T) { } for i, f := range testFilters { - filter, err := ParseFilterValue(f) - assert.Equal(t, nil, err) + filter := ParseFilterValue(ColumnFilter, f) attrMap := database.AttrMap{"test": {DataQuery: "(NOT test)", OrderQuery: "(NOT test)", Parser: dummyParser}} query, _, err := filter.ToWhere("test", attrMap) assert.Equal(t, nil, err) @@ -84,11 +81,10 @@ func TestFilterToSqlAdvanced(t *testing.T) { // Filter out null characters func TestFilterInvalidValue(t *testing.T) { - filter, err := ParseFilterValue("eq:aa\u0000aa") - assert.NoError(t, err) + filter := ParseFilterValue(ColumnFilter, "eq:aa\u0000aa") attrMap, _, err := database.GetQueryAttrs(struct{ V string }{""}) assert.NoError(t, err) - _, value, err := filter.ToWhere("V", attrMap) + _, value, err := filter.ToWhere("v", attrMap) assert.NoError(t, err) assert.Equal(t, []interface{}{"aaaa"}, value) } diff --git a/manager/controllers/package_systems.go b/manager/controllers/package_systems.go index 2198606ee..e85c8c647 100644 --- a/manager/controllers/package_systems.go +++ b/manager/controllers/package_systems.go @@ -23,26 +23,45 @@ var PackageSystemsOpts = ListOpts{ } //nolint:lll -type PackageSystemItem struct { +type PackageSystemItemCommon struct { SystemIDAttribute SystemDisplayName InstalledEVRA string `json:"installed_evra" csv:"installed_evra" query:"p.evra" gorm:"column:installed_evra"` AvailableEVRA string `json:"available_evra" csv:"available_evra" query:"spkg.latest_evra" gorm:"column:available_evra"` - Updatable bool `json:"updatable" csv:"updatable" query:"spkg.latest_evra IS NOT NULL" gorm:"column:updatable"` + Updatable bool `json:"updatable" csv:"updatable" query:"(update_status(spkg.update_data) = 'Installable')" gorm:"column:updatable"` Tags SystemTagsList `json:"tags" csv:"tags" query:"null" gorm:"-"` BaselineAttributes } +type PackageSystemItemV2 struct { + PackageSystemItemCommon +} + +//nolint:lll +type PackageSystemItemV3 struct { + PackageSystemItemCommon + BaselineIDAttr + OSAttributes + UpdateStatus string `json:"update_status" csv:"update_status" query:"update_status(spkg.update_data)" gorm:"column:update_status"` + SystemGroups +} + type PackageSystemDBLookup struct { SystemsMetaTagTotal - PackageSystemItem + PackageSystemItemV3 } -type PackageSystemsResponse struct { - Data []PackageSystemItem `json:"data"` - Links Links `json:"links"` - Meta ListMeta `json:"meta"` +type PackageSystemsResponseV2 struct { + Data []PackageSystemItemV2 `json:"data"` + Links Links `json:"links"` + Meta ListMeta `json:"meta"` +} + +type PackageSystemsResponseV3 struct { + Data []PackageSystemItemV3 `json:"data"` + Links Links `json:"links"` + Meta ListMeta `json:"meta"` } func packagesByNameQuery(db *gorm.DB, pkgName string) *gorm.DB { @@ -51,10 +70,10 @@ func packagesByNameQuery(db *gorm.DB, pkgName string) *gorm.DB { Where("pn.name = ?", pkgName) } -func packageSystemsQuery(db *gorm.DB, acc int, packageName string, packageIDs []int) *gorm.DB { - query := database.SystemPackages(db, acc). +func packageSystemsQuery(db *gorm.DB, acc int, groups map[string]string, packageName string, packageIDs []int, +) *gorm.DB { + query := database.SystemPackages(db, acc, groups). Select(PackageSystemsSelect). - Joins("JOIN inventory.hosts ih ON ih.id = sp.inventory_id"). Joins("LEFT JOIN baseline bl ON sp.baseline_id = bl.id AND sp.rh_account_id = bl.rh_account_id"). Where("sp.stale = false"). Where("pn.name = ?", packageName). @@ -65,6 +84,7 @@ func packageSystemsQuery(db *gorm.DB, acc int, packageName string, packageIDs [] func packageSystemsCommon(db *gorm.DB, c *gin.Context) (*gorm.DB, *ListMeta, []string, error) { account := c.GetInt(middlewares.KeyAccount) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) var filters map[string]FilterData packageName := c.Param("package_name") @@ -84,12 +104,12 @@ func packageSystemsCommon(db *gorm.DB, c *gin.Context) (*gorm.DB, *ListMeta, []s return nil, nil, nil, errors.New("package not found") } - query := packageSystemsQuery(db, account, packageName, packageIDs) - filters, err := ParseTagsFilters(c) + query := packageSystemsQuery(db, account, groups, packageName, packageIDs) + filters, err := ParseAllFilters(c, PackageSystemsOpts) if err != nil { return nil, nil, nil, err } // Error handled in method itself - query, _ = ApplyTagsFilter(filters, query, "sp.inventory_id") + query, _ = ApplyInventoryFilter(filters, query, "sp.inventory_id") query, meta, params, err := ListCommon(query, c, filters, PackageSystemsOpts) // Error handled in method itself return query, meta, params, err @@ -106,19 +126,23 @@ func packageSystemsCommon(db *gorm.DB, c *gin.Context) (*gorm.DB, *ListMeta, []s // @Param offset query int false "Offset for paging" // @Param package_name path string true "Package name" // @Param tags query []string false "Tag filter" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" // @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" -// @Param filter[system_profile][sap_sids][in] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" // @Param filter[system_profile][ansible] query string false "Filter systems by ansible" // @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" // @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" // @Param filter[system_profile][mssql][version] query string false "Filter systems by mssql version" -// @Success 200 {object} PackageSystemsResponse +// @Param filter[updatable] query bool false "Filter" +// @Success 200 {object} PackageSystemsResponseV3 // @Failure 400 {object} utils.ErrorResponse // @Failure 404 {object} utils.ErrorResponse // @Failure 500 {object} utils.ErrorResponse // @Router /packages/{package_name}/systems [get] func PackageSystemsListHandler(c *gin.Context) { db := middlewares.DBFromContext(c) + apiver := c.GetInt(middlewares.KeyApiver) + query, meta, params, err := packageSystemsCommon(db, c) if err != nil { return @@ -131,17 +155,29 @@ func PackageSystemsListHandler(c *gin.Context) { return } - outputItems, total := packageSystemDBLookups2PackageSystemItems(systems) + outputItems, total := packageSystemDBLookups2PackageSystemItemsV3(systems) meta, links, err := UpdateMetaLinks(c, meta, total, nil, params...) if err != nil { return // Error handled in method itself } - c.JSON(http.StatusOK, PackageSystemsResponse{ + if apiver < 3 { + dataV2 := packageSystemItemV3toV2(outputItems) + var resp = PackageSystemsResponseV2{ + Data: dataV2, + Links: *links, + Meta: *meta, + } + c.JSON(http.StatusOK, &resp) + return + } + + response := PackageSystemsResponseV3{ Data: outputItems, Links: *links, Meta: *meta, - }) + } + c.JSON(http.StatusOK, response) } // nolint: dupl @@ -155,52 +191,69 @@ func PackageSystemsListHandler(c *gin.Context) { // @Param offset query int false "Offset for paging" // @Param package_name path string true "Package name" // @Param tags query []string false "Tag filter" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" // @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" -// @Param filter[system_profile][sap_sids][in] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" // @Param filter[system_profile][ansible] query string false "Filter systems by ansible" // @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" // @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" // @Param filter[system_profile][mssql][version] query string false "Filter systems by mssql version" -// @Success 200 {object} IDsResponse +// @Success 200 {object} IDsStatusResponse // @Failure 400 {object} utils.ErrorResponse // @Failure 404 {object} utils.ErrorResponse // @Failure 500 {object} utils.ErrorResponse // @Router /ids/packages/{package_name}/systems [get] func PackageSystemsListIDsHandler(c *gin.Context) { db := middlewares.DBFromContext(c) + apiver := c.GetInt(middlewares.KeyApiver) query, meta, _, err := packageSystemsCommon(db, c) if err != nil { return } // Error handled in method itself - var sids []SystemsID + var sids []SystemsStatusID err = query.Find(&sids).Error if err != nil { LogAndRespError(c, err, "database error") return } - ids, err := systemsIDs(c, sids, meta) + resp, err := systemsIDsStatus(c, sids, meta) if err != nil { return // Error handled in method itself } - var resp = IDsResponse{IDs: ids} + if apiver < 3 { + c.JSON(http.StatusOK, &resp.IDsResponse) + return + } c.JSON(http.StatusOK, &resp) } -func packageSystemDBLookups2PackageSystemItems(systems []PackageSystemDBLookup) ([]PackageSystemItem, int) { +func packageSystemDBLookups2PackageSystemItemsV3(systems []PackageSystemDBLookup) ([]PackageSystemItemV3, int) { var total int if len(systems) > 0 { total = systems[0].Total } - data := make([]PackageSystemItem, len(systems)) - var err error + data := make([]PackageSystemItemV3, len(systems)) for i, system := range systems { - system.PackageSystemItem.Tags, err = parseSystemTags(system.TagsStr) - if err != nil { + if err := parseSystemItems(system.TagsStr, &system.PackageSystemItemV3.Tags); err != nil { utils.LogDebug("err", err.Error(), "inventory_id", system.ID, "system tags parsing failed") } - data[i] = system.PackageSystemItem + if err := parseSystemItems(system.GroupsStr, &system.PackageSystemItemV3.Groups); err != nil { + utils.LogDebug("err", err.Error(), "inventory_id", system.ID, "system groups parsing failed") + } + data[i] = system.PackageSystemItemV3 } return data, total } + +func packageSystemItemV3toV2(systems []PackageSystemItemV3) []PackageSystemItemV2 { + nSystems := len(systems) + systemsV2 := make([]PackageSystemItemV2, nSystems) + for i := 0; i < nSystems; i++ { + systemsV2[i] = PackageSystemItemV2{ + PackageSystemItemCommon: systems[i].PackageSystemItemCommon, + } + } + return systemsV2 +} diff --git a/manager/controllers/package_systems_export.go b/manager/controllers/package_systems_export.go index 5bca82e37..f07bf9db5 100644 --- a/manager/controllers/package_systems_export.go +++ b/manager/controllers/package_systems_export.go @@ -16,14 +16,15 @@ import ( // @Accept json // @Produce json // @Param package_name path string true "Package name" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" // @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" -// @Param filter[system_profile][sap_sids][in] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" // @Param filter[system_profile][ansible] query string false "Filter systems by ansible" // @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" // @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" // @Param filter[system_profile][mssql][version] query string false "Filter systems by mssql version" // @Param tags query []string false "Tag filter" -// @Success 200 {array} PackageSystemItem +// @Success 200 {array} PackageSystemItemV3 // @Failure 400 {object} utils.ErrorResponse // @Failure 404 {object} utils.ErrorResponse // @Failure 415 {object} utils.ErrorResponse @@ -31,6 +32,8 @@ import ( // @Router /export/packages/{package_name}/systems [get] func PackageSystemsExportHandler(c *gin.Context) { account := c.GetInt(middlewares.KeyAccount) + apiver := c.GetInt(middlewares.KeyApiver) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) packageName := c.Param("package_name") if packageName == "" { @@ -50,12 +53,12 @@ func PackageSystemsExportHandler(c *gin.Context) { return } - query := packageSystemsQuery(db, account, packageName, packageIDs) - filters, err := ParseTagsFilters(c) + query := packageSystemsQuery(db, account, groups, packageName, packageIDs) + filters, err := ParseAllFilters(c, PackageSystemsOpts) if err != nil { return } // Error handled in method itself - query, _ = ApplyTagsFilter(filters, query, "sp.inventory_id") + query, _ = ApplyInventoryFilter(filters, query, "sp.inventory_id") query, err = ExportListCommon(query, c, PackageSystemsOpts) if err != nil { return @@ -68,6 +71,12 @@ func PackageSystemsExportHandler(c *gin.Context) { return } - outputItems, _ := packageSystemDBLookups2PackageSystemItems(systems) + outputItems, _ := packageSystemDBLookups2PackageSystemItemsV3(systems) + if apiver < 3 { + itemsV2 := packageSystemItemV3toV2(outputItems) + OutputExportData(c, itemsV2) + return + } + OutputExportData(c, outputItems) } diff --git a/manager/controllers/package_systems_export_test.go b/manager/controllers/package_systems_export_test.go index 9caf2a3b6..5aa100fe0 100644 --- a/manager/controllers/package_systems_export_test.go +++ b/manager/controllers/package_systems_export_test.go @@ -15,9 +15,9 @@ func TestPackageSystemsExportHandlerJSON(t *testing.T) { w := CreateRequestRouterWithParams("GET", "/kernel/systems?sort=id", nil, "application/json", PackageSystemsExportHandler, 3, "GET", "/:package_name/systems") - var output []PackageSystemItem + var output []PackageSystemItemV3 CheckResponse(t, w, http.StatusOK, &output) - assert.Equal(t, 2, len(output)) + assert.Equal(t, 3, len(output)) assert.Equal(t, "00000000-0000-0000-0000-000000000012", output[0].ID) assert.Equal(t, "5.6.13-200.fc31.x86_64", output[0].InstalledEVRA) assert.Equal(t, "5.10.13-200.fc31.x86_64", output[0].AvailableEVRA) @@ -35,14 +35,16 @@ func TestPackageSystemsExportHandlerCSV(t *testing.T) { body := w.Body.String() lines := strings.Split(body, "\n") - assert.Equal(t, 4, len(lines)) + assert.Equal(t, 5, len(lines)) assert.Equal(t, "id,display_name,installed_evra,available_evra,updatable,tags,"+ - "baseline_name,baseline_uptodate", lines[0]) + "baseline_name,baseline_uptodate,baseline_id,os,rhsm,update_status,groups", lines[0]) assert.Equal(t, "00000000-0000-0000-0000-000000000012,00000000-0000-0000-0000-000000000012,"+ - "5.6.13-200.fc31.x86_64,5.10.13-200.fc31.x86_64,true,\"[{'key':'k1','namespace':'ns1','value':'val1'}]\",,", + "5.6.13-200.fc31.x86_64,5.10.13-200.fc31.x86_64,true,"+ + "\"[{'key':'k1','namespace':'ns1','value':'val1'}]\",,,0,RHEL 8.1,8.1,Installable,[]", lines[1]) assert.Equal(t, "00000000-0000-0000-0000-000000000013,00000000-0000-0000-0000-000000000013,"+ - "5.6.13-200.fc31.x86_64,,false,\"[{'key':'k1','namespace':'ns1','value':'val1'}]\",,", lines[2]) + "5.6.13-200.fc31.x86_64,,false,\"[{'key':'k1','namespace':'ns1','value':'val1'}]\",,,"+ + "0,RHEL 8.2,8.2,None,[]", lines[2]) } func TestPackageSystemsExportInvalidName(t *testing.T) { diff --git a/manager/controllers/package_systems_test.go b/manager/controllers/package_systems_test.go index 20aeb748e..40433c1fc 100644 --- a/manager/controllers/package_systems_test.go +++ b/manager/controllers/package_systems_test.go @@ -12,7 +12,7 @@ import ( func TestPackageSystems(t *testing.T) { output := testPackageSystems(t, "/kernel/systems?sort=id", 3) - assert.Equal(t, 2, len(output.Data)) + assert.Equal(t, 3, len(output.Data)) assert.Equal(t, "00000000-0000-0000-0000-000000000012", output.Data[0].ID) assert.Equal(t, "00000000-0000-0000-0000-000000000012", output.Data[0].DisplayName) assert.Equal(t, "5.6.13-200.fc31.x86_64", output.Data[0].InstalledEVRA) @@ -24,7 +24,7 @@ func TestPackageSystems(t *testing.T) { func TestPackageIDsSystems(t *testing.T) { output := testPackageIDsSystems(t, "/kernel/systems?sort=id", 3) - assert.Equal(t, 2, len(output.IDs)) + assert.Equal(t, 3, len(output.IDs)) assert.Equal(t, "00000000-0000-0000-0000-000000000012", output.IDs[0]) } @@ -44,12 +44,12 @@ func TestPackageSystemsInvalidName(t *testing.T) { assert.Equal(t, "package not found", errResp.Error) } -func testPackageSystems(t *testing.T, url string, account int) PackageSystemsResponse { +func testPackageSystems(t *testing.T, url string, account int) PackageSystemsResponseV3 { core.SetupTest(t) w := CreateRequestRouterWithParams("GET", url, nil, "", PackageSystemsListHandler, account, "GET", "/:package_name/systems") - var output PackageSystemsResponse + var output PackageSystemsResponseV3 CheckResponse(t, w, http.StatusOK, &output) return output } @@ -79,12 +79,12 @@ func TestPackageSystemsTagsInMetadata(t *testing.T) { w := CreateRequestRouterWithParams("GET", "/kernel/systems?tags=ns1/k3=val4&tags=ns1/k1=val1", nil, "", PackageSystemsListHandler, 3, "GET", "/:package_name/systems") - var output PackageSystemsResponse + var output PackageSystemsResponseV3 ParseResponseBody(t, w.Body.Bytes(), &output) testMap := map[string]FilterData{ - "ns1/k1": {"eq", []string{"val1"}}, - "ns1/k3": {"eq", []string{"val4"}}, + "ns1/k1": {Operator: "eq", Values: []string{"val1"}}, + "ns1/k3": {Operator: "eq", Values: []string{"val4"}}, } assert.Equal(t, testMap, output.Meta.Filter) } diff --git a/manager/controllers/package_versions.go b/manager/controllers/package_versions.go index 804e80956..c9ef686e2 100644 --- a/manager/controllers/package_versions.go +++ b/manager/controllers/package_versions.go @@ -45,8 +45,8 @@ func packagesNameID(db *gorm.DB, pkgName string) *gorm.DB { Where("pn.name = ?", pkgName) } -func packageVersionsQuery(db *gorm.DB, acc int, packageNameIDs []int) *gorm.DB { - query := database.SystemPackages(db, acc). +func packageVersionsQuery(db *gorm.DB, acc int, groups map[string]string, packageNameIDs []int) *gorm.DB { + query := database.SystemPackages(db, acc, groups). Distinct(PackageVersionSelect). Where("sp.stale = false"). Where("spkg.name_id in (?)", packageNameIDs) @@ -69,6 +69,7 @@ func packageVersionsQuery(db *gorm.DB, acc int, packageNameIDs []int) *gorm.DB { // @Router /packages/{package_name}/versions [get] func PackageVersionsListHandler(c *gin.Context) { account := c.GetInt(middlewares.KeyAccount) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) packageName := c.Param("package_name") if packageName == "" { @@ -88,7 +89,7 @@ func PackageVersionsListHandler(c *gin.Context) { return } - query := packageVersionsQuery(db, account, packageNameIDs) + query := packageVersionsQuery(db, account, groups, packageNameIDs) // we don't support tags and filters for this endpoint query, meta, params, err := ListCommon(query, c, nil, PackageVersionsOpts) if err != nil { diff --git a/manager/controllers/packages.go b/manager/controllers/packages.go index f3437180e..c3b5efaf8 100644 --- a/manager/controllers/packages.go +++ b/manager/controllers/packages.go @@ -2,6 +2,7 @@ package controllers import ( "app/base/database" + "app/base/rbac" "app/base/utils" "app/manager/middlewares" "net/http" @@ -27,15 +28,43 @@ type PackageDBLookup struct { // a helper to get total number of systems MetaTotalHelper - PackageItem + PackageItemCommon + PackageItemV2Only + PackageItemV3Only } -//nolint:lll -type PackageItem struct { +// nolint: lll +type PackageItemCommon struct { Name string `json:"name" csv:"name" query:"pn.name" gorm:"column:name"` - SystemsInstalled int `json:"systems_installed" csv:"systems_installed" query:"res.systems_installed" gorm:"column:systems_installed"` - SystemsUpdatable int `json:"systems_updatable" csv:"systems_updatable" query:"res.systems_updatable" gorm:"column:systems_updatable"` Summary string `json:"summary" csv:"summary" query:"pn.summary" gorm:"column:summary"` + SystemsInstalled int `json:"systems_installed" csv:"systems_installed" query:"res.systems_installed" gorm:"column:systems_installed"` +} + +// nolint: lll +type PackageItemV3Only struct { + SystemsInstallable int `json:"systems_installable" csv:"systems_installable" query:"res.systems_installable" gorm:"column:systems_installable"` + SystemsApplicable int `json:"systems_applicable" csv:"systems_applicable" query:"res.systems_applicable" gorm:"column:systems_applicable"` +} + +type PackageItem struct { + PackageItemCommon + PackageItemV3Only +} + +// nolint: lll +type PackageItemV2Only struct { + SystemsUpdatable int `json:"systems_updatable" csv:"systems_updatable" query:"res.systems_installable" gorm:"column:systems_updatable"` +} + +type PackageItemV2 struct { + PackageItemCommon + PackageItemV2Only +} + +type PackagesResponseV2 struct { + Data []PackageItemV2 `json:"data"` + Links Links `json:"links"` + Meta ListMeta `json:"meta"` } type PackagesResponse struct { @@ -47,33 +76,29 @@ type PackagesResponse struct { // nolint: lll // Used as a for subquery performing the actual calculation which is joined with latest summaries type queryItem struct { - NameID int `query:"spkg.name_id" gorm:"column:name_id"` - SystemsInstalled int `json:"systems_installed" query:"count(*)" gorm:"column:systems_installed"` - SystemsUpdatable int `json:"systems_updatable" query:"count(*) filter (where spkg.latest_evra IS NOT NULL)" gorm:"column:systems_updatable"` + NameID int `query:"spkg.name_id" gorm:"column:name_id"` + SystemsInstalled int `json:"systems_installed" query:"count(*)" gorm:"column:systems_installed"` + SystemsInstallable int `json:"systems_installable" query:"count(*) filter (where update_status(spkg.update_data) = 'Installable')" gorm:"column:systems_installable"` + SystemsApplicable int `json:"systems_applicable" query:"count(*) filter (where update_status(spkg.update_data) != 'None')" gorm:"column:systems_applicable"` } var queryItemSelect = database.MustGetSelect(&queryItem{}) -func packagesQuery(db *gorm.DB, filters map[string]FilterData, acc int) *gorm.DB { - var validCache bool - err := db.Table("rh_account"). - Select("valid_package_cache"). - Where("id = ?", acc). - Scan(&validCache).Error - if err == nil && validCache && len(filters) == 0 && enabledPackageCache { - // use cache only when tag filter is not used +// nolint: lll +func packagesQuery(db *gorm.DB, filters map[string]FilterData, acc int, groups map[string]string, useCache bool) *gorm.DB { + if useCache { q := db.Table("package_account_data res"). Select(PackagesSelect). Joins("JOIN package_name pn ON res.package_name_id = pn.id"). Where("rh_account_id = ?", acc) return q } - systemsWithPkgsInstalledQ := database.Systems(db, acc). - Select("id"). + systemsWithPkgsInstalledQ := database.Systems(db, acc, groups). + Select("sp.id"). Where("sp.stale = false AND sp.packages_installed > 0") // We need to apply tag filtering on subquery - systemsWithPkgsInstalledQ, _ = ApplyTagsFilter(filters, systemsWithPkgsInstalledQ, "sp.inventory_id") + systemsWithPkgsInstalledQ, _ = ApplyInventoryFilter(filters, systemsWithPkgsInstalledQ, "sp.inventory_id") subQ := database.SystemPackagesShort(db, acc). Select(queryItemSelect). Where("spkg.system_id IN (?)", systemsWithPkgsInstalledQ). @@ -85,23 +110,26 @@ func packagesQuery(db *gorm.DB, filters map[string]FilterData, acc int) *gorm.DB Joins("JOIN (?) res ON res.name_id = pn.id", subQ) } +// nolint: lll // @Summary Show me all installed packages across my systems // @Description Show me all installed packages across my systems // @ID listPackages // @Security RhIdentity // @Accept json // @Produce json -// @Param limit query int false "Limit for paging, set -1 to return all" -// @Param offset query int false "Offset for paging" -// @Param sort query string false "Sort field" Enums(id,name,systems_installed,systems_updatable) -// @Param search query string false "Find matching text" -// @Param filter[name] query string false "Filter" -// @Param filter[systems_installed] query string false "Filter" -// @Param filter[systems_updatable] query string false "Filter" -// @Param filter[summary] query string false "Filter" -// @Param tags query []string false "Tag filter" +// @Param limit query int false "Limit for paging, set -1 to return all" +// @Param offset query int false "Offset for paging" +// @Param sort query string false "Sort field" Enums(id,name,systems_installed,systems_installable,systems_applicable) +// @Param search query string false "Find matching text" +// @Param filter[name] query string false "Filter" +// @Param filter[systems_installed] query string false "Filter" +// @Param filter[systems_installable] query string false "Filter" +// @Param filter[systems_applicable] query string false "Filter" +// @Param filter[summary] query string false "Filter" +// @Param tags query []string false "Tag filter" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" // @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" -// @Param filter[system_profile][sap_sids][in] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" // @Param filter[system_profile][ansible] query string false "Filter systems by ansible" // @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" // @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" @@ -114,14 +142,22 @@ func packagesQuery(db *gorm.DB, filters map[string]FilterData, acc int) *gorm.DB func PackagesListHandler(c *gin.Context) { var filters map[string]FilterData account := c.GetInt(middlewares.KeyAccount) + apiver := c.GetInt(middlewares.KeyApiver) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) - filters, err := ParseTagsFilters(c) + filters, err := ParseAllFilters(c, PackagesOpts) if err != nil { return } db := middlewares.DBFromContext(c) - query := packagesQuery(db, filters, account) + useCache := shouldUseCache(db, account, filters, groups) + if !useCache { + db.Exec("SET work_mem TO '?'", utils.Cfg.DBWorkMem) + defer db.Exec("RESET work_mem") + } + + query := packagesQuery(db, filters, account, groups, useCache) if err != nil { return } // Error handled in method itself @@ -142,6 +178,15 @@ func PackagesListHandler(c *gin.Context) { if err != nil { return // Error handled in method itself } + if apiver < 3 { + dataV2 := packages2PackagesV2(data) + c.JSON(http.StatusOK, PackagesResponseV2{ + Data: dataV2, + Links: *links, + Meta: *meta, + }) + return + } c.JSON(http.StatusOK, PackagesResponse{ Data: data, @@ -157,7 +202,35 @@ func PackageDBLookup2Item(packages []PackageDBLookup) ([]PackageItem, int) { } data := make([]PackageItem, len(packages)) for i, v := range packages { - data[i] = v.PackageItem + data[i] = PackageItem{v.PackageItemCommon, v.PackageItemV3Only} } return data, total } + +func packages2PackagesV2(data []PackageItem) []PackageItemV2 { + v2 := make([]PackageItemV2, len(data)) + for i, x := range data { + v2[i] = PackageItemV2{ + PackageItemCommon: x.PackageItemCommon, + PackageItemV2Only: PackageItemV2Only{x.SystemsInstallable}, + } + } + return v2 +} + +// use cache only when tag filter is not used, there are no inventory groups and cache is valid +func shouldUseCache(db *gorm.DB, acc int, filters map[string]FilterData, groups map[string]string) bool { + if !enabledPackageCache { + return false + } + if HasInventoryFilter(filters) || len(groups[rbac.KeyGrouped]) != 0 { + return false + } + + var validCache bool + err := db.Table("rh_account"). + Select("valid_package_cache"). + Where("id = ?", acc). + Scan(&validCache).Error + return err == nil && validCache +} diff --git a/manager/controllers/packages_export.go b/manager/controllers/packages_export.go index e4401d4a3..ac1547b19 100644 --- a/manager/controllers/packages_export.go +++ b/manager/controllers/packages_export.go @@ -1,6 +1,7 @@ package controllers import ( + "app/base/utils" "app/manager/middlewares" "github.com/gin-gonic/gin" @@ -24,13 +25,20 @@ import ( // @Router /export/packages [get] func PackagesExportHandler(c *gin.Context) { account := c.GetInt(middlewares.KeyAccount) - filters, err := ParseTagsFilters(c) + apiver := c.GetInt(middlewares.KeyApiver) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) + filters, err := ParseAllFilters(c, PackagesOpts) if err != nil { return } db := middlewares.DBFromContext(c) - query := packagesQuery(db, filters, account) + useCache := shouldUseCache(db, account, filters, groups) + if !useCache { + db.Exec("SET work_mem TO '?'", utils.Cfg.DBWorkMem) + defer db.Exec("RESET work_mem") + } + query := packagesQuery(db, filters, account, groups, useCache) if err != nil { return } @@ -48,6 +56,11 @@ func PackagesExportHandler(c *gin.Context) { LogAndRespError(c, err, "db error") return } + if apiver < 3 { + itemsV2 := packages2PackagesV2(items) + OutputExportData(c, itemsV2) + return + } OutputExportData(c, items) } diff --git a/manager/controllers/packages_export_test.go b/manager/controllers/packages_export_test.go index c19dd2879..ea2882a1d 100644 --- a/manager/controllers/packages_export_test.go +++ b/manager/controllers/packages_export_test.go @@ -28,7 +28,7 @@ func TestPackageExportCSV(t *testing.T) { lines := strings.Split(body, "\n") assert.Equal(t, 6, len(lines)) - assert.Equal(t, "name,systems_installed,systems_updatable,summary", lines[0]) + assert.Equal(t, "name,summary,systems_installed,systems_installable,systems_applicable", lines[0]) - assert.Equal(t, "kernel,2,1,The Linux kernel", lines[1]) + assert.Equal(t, "kernel,The Linux kernel,3,2,2", lines[1]) } diff --git a/manager/controllers/packages_test.go b/manager/controllers/packages_test.go index 6c0e06cc5..87a263872 100644 --- a/manager/controllers/packages_test.go +++ b/manager/controllers/packages_test.go @@ -38,8 +38,13 @@ func TestPackagesEmptyResponse(t *testing.T) { assert.Equal(t, "{\"data\":[]", respStr[:10]) } -func TestPackagesFilterUpdatable(t *testing.T) { - output := doTestPackages(t, "/?filter[systems_updatable]=4") +func TestPackagesFilterInstallable(t *testing.T) { + output := doTestPackages(t, "/?filter[systems_installable]=4") + assert.Equal(t, 0, len(output.Data)) +} + +func TestPackagesFilterApplicable(t *testing.T) { + output := doTestPackages(t, "/?filter[systems_applicable]=4") assert.Equal(t, 0, len(output.Data)) } @@ -48,15 +53,17 @@ func TestPackagesFilterSummary(t *testing.T) { assert.Equal(t, 1, len(output.Data)) assert.Equal(t, "firefox", output.Data[0].Name) assert.Equal(t, 2, output.Data[0].SystemsInstalled) - assert.Equal(t, 2, output.Data[0].SystemsUpdatable) + assert.Equal(t, 2, output.Data[0].SystemsInstallable) + assert.Equal(t, 2, output.Data[0].SystemsApplicable) } func TestPackagesFilterSAP(t *testing.T) { - output := doTestPackages(t, "/?filter[system_profile][is_sap][eq]=true") + output := doTestPackages(t, "/?filter[system_profile][sap_system]=true") assert.Equal(t, 4, len(output.Data)) assert.Equal(t, "kernel", output.Data[3].Name) assert.Equal(t, 2, output.Data[3].SystemsInstalled) - assert.Equal(t, 1, output.Data[3].SystemsUpdatable) + assert.Equal(t, 1, output.Data[3].SystemsInstallable) + assert.Equal(t, 1, output.Data[3].SystemsApplicable) } func TestSearchPackages(t *testing.T) { @@ -88,8 +95,8 @@ func TestPackageTagsInMetadata(t *testing.T) { CheckResponse(t, w, http.StatusOK, &output) testMap := map[string]FilterData{ - "ns1/k1": {"eq", []string{"val1"}}, - "ns1/k3": {"eq", []string{"val4"}}, + "ns1/k1": {Operator: "eq", Values: []string{"val1"}}, + "ns1/k3": {Operator: "eq", Values: []string{"val4"}}, } assert.Equal(t, testMap, output.Meta.Filter) } diff --git a/manager/controllers/structures.go b/manager/controllers/structures.go index 5bab1afdf..b748d4b75 100644 --- a/manager/controllers/structures.go +++ b/manager/controllers/structures.go @@ -36,3 +36,20 @@ type ListMeta struct { type IDsResponse struct { IDs []string `json:"ids"` } + +type IDStatus struct { + ID string `json:"id"` + Status string `json:"status"` +} + +type IDsStatusResponse struct { + Data []IDStatus `json:"data"` + // backward compatibility + // TODO: delete later once UI is using only the new `data` field + IDsResponse +} + +type SystemGroup struct { + ID string `json:"id"` + Name string `json:"name"` +} diff --git a/manager/controllers/system_advisories.go b/manager/controllers/system_advisories.go index c2b6e4b64..740a8c395 100644 --- a/manager/controllers/system_advisories.go +++ b/manager/controllers/system_advisories.go @@ -52,12 +52,18 @@ type SystemAdvisoriesResponse struct { Meta ListMeta `json:"meta"` } +type AdvisoryStatusID struct { + AdvisoryID + SystemAdvisoryStatus +} + func (v RelList) String() string { return strings.Join(v, ",") } func systemAdvisoriesCommon(c *gin.Context) (*gorm.DB, *ListMeta, []string, error) { account := c.GetInt(middlewares.KeyAccount) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) inventoryID := c.Param("inventory_id") if inventoryID == "" { @@ -70,9 +76,14 @@ func systemAdvisoriesCommon(c *gin.Context) (*gorm.DB, *ListMeta, []string, erro return nil, nil, nil, errors.New("incorrect inventory_id format") } + filters, err := ParseAllFilters(c, SystemAdvisoriesOpts) + if err != nil { + return nil, nil, nil, err + } // Error handled method itself + db := middlewares.DBFromContext(c) var exists int64 - err := db.Model(&models.SystemPlatform{}).Where("inventory_id = ?::uuid ", inventoryID). + err = db.Model(&models.SystemPlatform{}).Where("inventory_id = ?::uuid ", inventoryID). Count(&exists).Error if err != nil { @@ -85,8 +96,8 @@ func systemAdvisoriesCommon(c *gin.Context) (*gorm.DB, *ListMeta, []string, erro return nil, nil, nil, err } - query := buildSystemAdvisoriesQuery(db, account, inventoryID) - query, meta, params, err := ListCommon(query, c, nil, SystemAdvisoriesOpts) + query := buildSystemAdvisoriesQuery(db, account, groups, inventoryID) + query, meta, params, err := ListCommon(query, c, filters, SystemAdvisoriesOpts) // Error handling and setting of result code & content is done in ListCommon return query, meta, params, err } @@ -161,30 +172,34 @@ func SystemAdvisoriesHandler(c *gin.Context) { // @Param filter[advisory_type] query string false "Filter" // @Param filter[advisory_type_name] query string false "Filter" // @Param filter[severity] query string false "Filter" -// @Success 200 {object} IDsResponse +// @Success 200 {object} IDsStatusResponse // @Failure 400 {object} utils.ErrorResponse // @Failure 404 {object} utils.ErrorResponse // @Failure 500 {object} utils.ErrorResponse // @Router /ids/systems/{inventory_id}/advisories [get] func SystemAdvisoriesIDsHandler(c *gin.Context) { + apiver := c.GetInt(middlewares.KeyApiver) query, _, _, err := systemAdvisoriesCommon(c) if err != nil { return } // Error handled in method itself - var aids []AdvisoryID + var aids []AdvisoryStatusID err = query.Find(&aids).Error if err != nil { LogAndRespError(c, err, "db error") } - ids := advisoriesIDs(aids) - var resp = IDsResponse{IDs: ids} + resp := advisoriesStatusIDs(aids) + if apiver < 3 { + c.JSON(http.StatusOK, &resp.IDsResponse) + return + } c.JSON(http.StatusOK, &resp) } -func buildSystemAdvisoriesQuery(db *gorm.DB, account int, inventoryID string) *gorm.DB { - query := database.SystemAdvisoriesByInventoryID(db, account, inventoryID). +func buildSystemAdvisoriesQuery(db *gorm.DB, account int, groups map[string]string, inventoryID string) *gorm.DB { + query := database.SystemAdvisoriesByInventoryID(db, account, groups, inventoryID). Joins("JOIN advisory_metadata am on am.id = sa.advisory_id"). Joins("JOIN advisory_type at ON am.advisory_type_id = at.id"). Joins("JOIN status ON sa.status_id = status.id"). diff --git a/manager/controllers/system_advisories_export.go b/manager/controllers/system_advisories_export.go index 567096508..f52c0b083 100644 --- a/manager/controllers/system_advisories_export.go +++ b/manager/controllers/system_advisories_export.go @@ -33,6 +33,7 @@ import ( // @Router /export/systems/{inventory_id}/advisories [get] func SystemAdvisoriesExportHandler(c *gin.Context) { account := c.GetInt(middlewares.KeyAccount) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) inventoryID := c.Param("inventory_id") if inventoryID == "" { @@ -58,9 +59,9 @@ func SystemAdvisoriesExportHandler(c *gin.Context) { return } - query := buildSystemAdvisoriesQuery(db, account, inventoryID) + query := buildSystemAdvisoriesQuery(db, account, groups, inventoryID) query = query.Order("id") - query, err = ExportListCommon(query, c, AdvisoriesOpts) + query, err = ExportListCommon(query, c, SystemAdvisoriesOpts) if err != nil { // Error handling and setting of result code & content is done in ListCommon return diff --git a/manager/controllers/system_advisories_test.go b/manager/controllers/system_advisories_test.go index 4208515d2..e8ea738c2 100644 --- a/manager/controllers/system_advisories_test.go +++ b/manager/controllers/system_advisories_test.go @@ -36,10 +36,13 @@ func TestSystemAdvisoriesIDsDefault(t *testing.T) { w := CreateRequestRouterWithPath("GET", "/00000000-0000-0000-0000-000000000001", nil, "", SystemAdvisoriesIDsHandler, "/:inventory_id") - var output IDsResponse + var output IDsStatusResponse CheckResponse(t, w, http.StatusOK, &output) assert.Equal(t, 8, len(output.IDs)) assert.Equal(t, "RH-7", output.IDs[0]) + assert.Equal(t, 8, len(output.Data)) + assert.Equal(t, "RH-7", output.Data[0].ID) + assert.Equal(t, "Applicable", output.Data[0].Status) } func TestSystemAdvisoriesNotFound(t *testing.T) { //nolint:dupl @@ -74,10 +77,13 @@ func TestSystemAdvisoriesIDsOffsetLimit(t *testing.T) { w := CreateRequestRouterWithPath("GET", "/00000000-0000-0000-0000-000000000001?offset=4&limit=3", nil, "", SystemAdvisoriesIDsHandler, "/:inventory_id") - var output IDsResponse + var output IDsStatusResponse CheckResponse(t, w, http.StatusOK, &output) assert.Equal(t, 3, len(output.IDs)) assert.Equal(t, "RH-1", output.IDs[0]) + assert.Equal(t, 3, len(output.Data)) + assert.Equal(t, "RH-1", output.Data[0].ID) + assert.Equal(t, "Installable", output.Data[0].Status) } func TestSystemAdvisoriesOffsetOverflow(t *testing.T) { @@ -94,7 +100,7 @@ func TestSystemAdvisoriesPossibleSorts(t *testing.T) { core.SetupTest(t) for sort := range SystemAdvisoriesFields { - if sort == "ReleaseVersions" { + if sort == "releaseversions" { // this field is not sortable, skip it continue } diff --git a/manager/controllers/system_detail.go b/manager/controllers/system_detail.go index 997245d26..8660beab8 100644 --- a/manager/controllers/system_detail.go +++ b/manager/controllers/system_detail.go @@ -2,8 +2,11 @@ package controllers import ( "app/base/database" + "app/base/models" "app/base/utils" + "app/base/vmaas" "app/manager/middlewares" + "encoding/json" "errors" "net/http" @@ -23,6 +26,15 @@ type SystemDetailResponse struct { type SystemDetailLookup struct { SystemItemAttributesAll TagsStrHelper + GroupsStrHelper +} + +type SystemVmaasJSONResponse struct { + Data vmaas.UpdatesV3Request `json:"data"` +} + +type SystemYumUpdatesResponse struct { + Data vmaas.UpdatesV3Response `json:"data"` } // nolint: funlen @@ -41,6 +53,7 @@ type SystemDetailLookup struct { func SystemDetailHandler(c *gin.Context) { account := c.GetInt(middlewares.KeyAccount) apiver := c.GetInt(middlewares.KeyApiver) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) inventoryID := c.Param("inventory_id") if inventoryID == "" { @@ -59,9 +72,8 @@ func SystemDetailHandler(c *gin.Context) { var systemDetail SystemDetailLookup db := middlewares.DBFromContext(c) - query := database.Systems(db, account). + query := database.Systems(db, account, groups). Select(database.MustGetSelect(&systemDetail)). - Joins("JOIN inventory.hosts ih ON ih.id = inventory_id"). Joins("LEFT JOIN baseline bl ON sp.baseline_id = bl.id AND sp.rh_account_id = bl.rh_account_id"). Where("sp.inventory_id = ?::uuid", inventoryID) @@ -76,11 +88,14 @@ func SystemDetailHandler(c *gin.Context) { return } - systemDetail.Tags, err = parseSystemTags(systemDetail.TagsStr) - if err != nil { + if err := parseSystemItems(systemDetail.TagsStr, &systemDetail.Tags); err != nil { utils.LogDebug("err", err.Error(), "inventory_id", inventoryID, "system tags parsing failed") } + if err := parseSystemItems(systemDetail.GroupsStr, &systemDetail.Groups); err != nil { + utils.LogDebug("err", err.Error(), "inventory_id", inventoryID, "system groups parsing failed") + } + if apiver < 3 { resp := SystemDetailResponseV2{ Data: SystemItemV2{ @@ -102,3 +117,101 @@ func SystemDetailHandler(c *gin.Context) { }} c.JSON(http.StatusOK, &resp) } + +// @Summary Show me system's json request for VMaaS +// @Description Show me system's json request for VMaaS +// @ID systemVmaasJson +// @Security RhIdentity +// @Accept json +// @Produce json +// @Param inventory_id path string true "Inventory ID" +// @Success 200 {object} SystemVmaasJSONResponse +// @Failure 400 {object} utils.ErrorResponse +// @Failure 404 {object} utils.ErrorResponse +// @Failure 500 {object} utils.ErrorResponse +// @Router /systems/{inventory_id}/vmaas_json [get] +func SystemVmaasJSONHandler(c *gin.Context) { + system := systemJSONsCommon(c, "sp.vmaas_json") + if system == nil { + return // abort handled by `systemJSONsCommon` + } + data, err := utils.ParseVmaasJSON(system) + if err != nil { + LogAndRespError(c, err, "couldn't parse vmaas json") + return + } + + resp := SystemVmaasJSONResponse{data} + c.JSON(http.StatusOK, &resp) +} + +// @Summary Show me system's yum_updates (client side evaluation data) +// @Description Show me system's yum_updates (client side evaluation data) +// @ID systemYumUpdates +// @Security RhIdentity +// @Accept json +// @Produce json +// @Param inventory_id path string true "Inventory ID" +// @Success 200 {object} SystemYumUpdatesResponse +// @Failure 400 {object} utils.ErrorResponse +// @Failure 404 {object} utils.ErrorResponse +// @Failure 500 {object} utils.ErrorResponse +// @Router /systems/{inventory_id}/yum_updates [get] +func SystemYumUpdatesHandler(c *gin.Context) { + system := systemJSONsCommon(c, "sp.yum_updates") + if system == nil { + return // abort handled by `systemJSONsCommon` + } + + var resp SystemYumUpdatesResponse + if system.YumUpdates == nil { + c.JSON(http.StatusOK, &resp) + return + } + + err := json.Unmarshal(system.YumUpdates, &resp.Data) + if err != nil { + LogAndRespError(c, err, "unable to unmarshall yum updates") + return + } + + c.JSON(http.StatusOK, &resp) +} + +func systemJSONsCommon(c *gin.Context, column string) *models.SystemPlatform { + account := c.GetInt(middlewares.KeyAccount) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) + + inventoryID := c.Param("inventory_id") + if inventoryID == "" { + c.JSON(http.StatusBadRequest, utils.ErrorResponse{Error: "inventory_id param not found"}) + return nil + } + + if !utils.IsValidUUID(inventoryID) { + LogAndRespBadRequest(c, errors.New("bad request"), "incorrect inventory_id format") + return nil + } + + if !isFilterInURLValid(c) { + return nil + } + + var system models.SystemPlatform + db := middlewares.DBFromContext(c) + query := database.Systems(db, account, groups). + Select(column). + Where("sp.inventory_id = ?::uuid", inventoryID) + + err := query.Take(&system).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + LogAndRespNotFound(c, err, "inventory not found") + return nil + } + + if err != nil { + LogAndRespError(c, err, "database error") + return nil + } + return &system +} diff --git a/manager/controllers/system_packages.go b/manager/controllers/system_packages.go index b521249a2..7c9fbe133 100644 --- a/manager/controllers/system_packages.go +++ b/manager/controllers/system_packages.go @@ -5,7 +5,6 @@ import ( "app/base/models" "app/base/utils" "app/manager/middlewares" - "encoding/json" "errors" "net/http" @@ -14,26 +13,49 @@ import ( ) // nolint: lll -type SystemPackagesAttrs struct { +type SystemPackagesAttrsCommon struct { Name string `json:"name" csv:"name" query:"pn.name" gorm:"column:name"` EVRA string `json:"evra" csv:"evra" query:"p.evra" gorm:"column:evra"` Summary string `json:"summary" csv:"summary" query:"sum.value" gorm:"column:summary"` Description string `json:"description" csv:"description" query:"descr.value" gorm:"column:description"` - Updatable bool `json:"updatable" csv:"updatable" query:"(COALESCE(json_array_length(spkg.update_data::json),0) > 0)" gorm:"column:updatable"` + Updatable bool `json:"updatable" csv:"updatable" query:"(update_status(spkg.update_data) = 'Installable')" gorm:"column:updatable"` } -type SystemPackageData struct { - SystemPackagesAttrs +type SystemPackageUpdates struct { Updates []models.PackageUpdate `json:"updates"` } -type SystemPackageResponse struct { - Data []SystemPackageData `json:"data"` - Meta ListMeta `json:"meta"` - Links Links `json:"links"` + +type SystemPackagesAttrsV2 struct { + SystemPackagesAttrsCommon +} + +// nolint: lll +type SystemPackagesAttrsV3 struct { + SystemPackagesAttrsCommon + UpdateStatus string `json:"update_status" csv:"update_status" query:"update_status(spkg.update_data)" gorm:"column:update_status"` +} + +type SystemPackageDataV2 struct { + SystemPackagesAttrsV2 + SystemPackageUpdates +} +type SystemPackageDataV3 struct { + SystemPackagesAttrsV3 + SystemPackageUpdates +} +type SystemPackageResponseV2 struct { + Data []SystemPackageDataV2 `json:"data"` + Meta ListMeta `json:"meta"` + Links Links `json:"links"` +} +type SystemPackageResponseV3 struct { + Data []SystemPackageDataV3 `json:"data"` + Meta ListMeta `json:"meta"` + Links Links `json:"links"` } var SystemPackagesSelect = database.MustGetSelect(&SystemPackageDBLoad{}) -var SystemPackagesFields = database.MustGetQueryAttrs(&SystemPackagesAttrs{}) +var SystemPackagesFields = database.MustGetQueryAttrs(&SystemPackagesAttrsV3{}) var SystemPackagesOpts = ListOpts{ Fields: SystemPackagesFields, DefaultFilters: nil, @@ -43,14 +65,14 @@ var SystemPackagesOpts = ListOpts{ } type SystemPackageDBLoad struct { - SystemPackagesAttrs + SystemPackagesAttrsV3 Updates []byte `json:"updates" query:"spkg.update_data" gorm:"column:updates"` // a helper to get total number of systems MetaTotalHelper } -func systemPackageQuery(db *gorm.DB, account int, inventoryID string) *gorm.DB { - query := database.SystemPackages(db, account). +func systemPackageQuery(db *gorm.DB, account int, groups map[string]string, inventoryID string) *gorm.DB { + query := database.SystemPackages(db, account, groups). Joins("LEFT JOIN strings AS descr ON p.description_hash = descr.id"). Joins("LEFT JOIN strings AS sum ON p.summary_hash = sum.id"). Select(SystemPackagesSelect). @@ -74,13 +96,16 @@ func systemPackageQuery(db *gorm.DB, account int, inventoryID string) *gorm.DB { // @Param filter[evra] query string false "Filter" // @Param filter[summary] query string false "Filter" // @Param filter[updatable] query bool false "Filter" -// @Success 200 {object} SystemPackageResponse +// @Param filter[update_status] query string false "Filter" +// @Success 200 {object} SystemPackageResponseV3 // @Failure 400 {object} utils.ErrorResponse // @Failure 404 {object} utils.ErrorResponse // @Failure 500 {object} utils.ErrorResponse // @Router /systems/{inventory_id}/packages [get] func SystemPackagesHandler(c *gin.Context) { account := c.GetInt(middlewares.KeyAccount) + apiver := c.GetInt(middlewares.KeyApiver) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) inventoryID := c.Param("inventory_id") if inventoryID == "" { @@ -92,11 +117,15 @@ func SystemPackagesHandler(c *gin.Context) { LogAndRespBadRequest(c, errors.New("bad request"), "incorrect inventory_id format") return } - + filters, err := ParseAllFilters(c, SystemPackagesOpts) + if err != nil { + // Error handled in method itself + return + } var loaded []SystemPackageDBLoad db := middlewares.DBFromContext(c) - q := systemPackageQuery(db, account, inventoryID) - q, meta, params, err := ListCommon(q, c, nil, SystemPackagesOpts) + q := systemPackageQuery(db, account, groups, inventoryID) + q, meta, params, err := ListCommon(q, c, filters, SystemPackagesOpts) if err != nil { return } @@ -112,29 +141,63 @@ func SystemPackagesHandler(c *gin.Context) { return } + total, data := buildSystemPackageData(loaded) + meta, links, err := UpdateMetaLinks(c, meta, total, nil, params...) + if err != nil { + return // Error handled in method itself + } + if apiver < 3 { + dataV2 := systemPackageV3toV2(data) + var resp = SystemPackageResponseV2{ + Data: dataV2, + Links: *links, + Meta: *meta, + } + c.JSON(http.StatusOK, &resp) + return + } + response := SystemPackageResponseV3{ + Data: data, + Meta: *meta, + Links: *links, + } + + c.JSON(http.StatusOK, response) +} + +func buildSystemPackageData(loaded []SystemPackageDBLoad) (int, []SystemPackageDataV3) { var total int if len(loaded) > 0 { total = loaded[0].Total } - data := make([]SystemPackageData, len(loaded)) + data := make([]SystemPackageDataV3, len(loaded)) for i, sp := range loaded { - data[i].SystemPackagesAttrs = sp.SystemPackagesAttrs + data[i].SystemPackagesAttrsV3 = sp.SystemPackagesAttrsV3 if sp.Updates == nil { continue } - if err := json.Unmarshal(sp.Updates, &data[i].Updates); err != nil { - panic(err) + // keep only latest installable and applicable + installable, applicable := findLatestEVRA(sp) + if installable.EVRA != sp.EVRA { + data[i].Updates = append(data[i].Updates, installable) + } + if applicable.EVRA != sp.EVRA { + data[i].Updates = append(data[i].Updates, applicable) } } - meta, links, err := UpdateMetaLinks(c, meta, total, nil, params...) - if err != nil { - return // Error handled in method itself - } - response := SystemPackageResponse{ - Data: data, - Meta: *meta, - Links: *links, - } + return total, data +} - c.JSON(http.StatusOK, response) +func systemPackageV3toV2(pkgs []SystemPackageDataV3) []SystemPackageDataV2 { + nPkgs := len(pkgs) + pkgsV2 := make([]SystemPackageDataV2, nPkgs) + for i := 0; i < nPkgs; i++ { + pkgsV2[i] = SystemPackageDataV2{ + SystemPackagesAttrsV2: SystemPackagesAttrsV2{ + SystemPackagesAttrsCommon: pkgs[i].SystemPackagesAttrsCommon, + }, + SystemPackageUpdates: pkgs[i].SystemPackageUpdates, + } + } + return pkgsV2 } diff --git a/manager/controllers/system_packages_export.go b/manager/controllers/system_packages_export.go index f082765d3..6e15fa8b8 100644 --- a/manager/controllers/system_packages_export.go +++ b/manager/controllers/system_packages_export.go @@ -12,11 +12,17 @@ import ( "gorm.io/gorm" ) -type SystemPackageInline struct { - SystemPackagesAttrs +type SystemPackageInlineV2 struct { + SystemPackagesAttrsV2 LatestEVRA string `json:"latest_evra" csv:"latest_evra"` } +type SystemPackageInlineV3 struct { + SystemPackagesAttrsV3 + LatestInstallable string `json:"latest_installable" csv:"latest_installable"` + LatestApplicable string `json:"latest_applicable" csv:"latest_applicable"` +} + // @Summary Show me details about a system packages by given inventory id // @Description Show me details about a system packages by given inventory id // @ID exportSystemPackages @@ -30,7 +36,7 @@ type SystemPackageInline struct { // @Param filter[evra] query string false "Filter" // @Param filter[summary] query string false "Filter" // @Param filter[updatable] query bool false "Filter" -// @Success 200 {array} SystemPackageInline +// @Success 200 {array} SystemPackageInlineV3 // @Failure 400 {object} utils.ErrorResponse // @Failure 404 {object} utils.ErrorResponse // @Failure 415 {object} utils.ErrorResponse @@ -38,6 +44,8 @@ type SystemPackageInline struct { // @Router /export/systems/{inventory_id}/packages [get] func SystemPackagesExportHandler(c *gin.Context) { account := c.GetInt(middlewares.KeyAccount) + apiver := c.GetInt(middlewares.KeyApiver) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) inventoryID := c.Param("inventory_id") if inventoryID == "" { @@ -52,7 +60,7 @@ func SystemPackagesExportHandler(c *gin.Context) { var loaded []SystemPackageDBLoad db := middlewares.DBFromContext(c) - q := systemPackageQuery(db, account, inventoryID) + q := systemPackageQuery(db, account, groups, inventoryID) q, err := ExportListCommon(q, c, SystemPackagesOpts) if err != nil { // Error handling and setting of result code & content is done in ListCommon @@ -70,25 +78,57 @@ func SystemPackagesExportHandler(c *gin.Context) { return } - data := convertToOutputArray(&loaded) + if apiver < 3 { + data := buildSystemPackageInlineV2(loaded) + OutputExportData(c, data) + return + } + data := buildSystemPackageInlineV3(loaded) OutputExportData(c, data) } -func convertToOutputArray(inArr *[]SystemPackageDBLoad) *[]SystemPackageInline { - outData := make([]SystemPackageInline, len(*inArr)) - for i, v := range *inArr { - outData[i].SystemPackagesAttrs = v.SystemPackagesAttrs - if v.Updates == nil { - outData[i].LatestEVRA = v.SystemPackagesAttrs.EVRA - continue - } - var updates []models.PackageUpdate - if err := json.Unmarshal(v.Updates, &updates); err != nil { - panic(err) - } - if len(updates) > 0 { - outData[i].LatestEVRA = updates[len(updates)-1].EVRA +func findLatestEVRA(pkg SystemPackageDBLoad) (installable models.PackageUpdate, applicable models.PackageUpdate) { + installable = models.PackageUpdate{ + EVRA: pkg.EVRA, + } + applicable = installable + if pkg.Updates == nil { + return + } + var updates []models.PackageUpdate + if err := json.Unmarshal(pkg.Updates, &updates); err != nil { + panic(err) + } + nUpdates := len(updates) + if nUpdates > 0 { + applicable = updates[nUpdates-1] + for i := nUpdates - 1; i >= 0; i-- { + if updates[i].Status == "Installable" { + installable = updates[i] + break + } } } - return &outData + return +} + +func buildSystemPackageInlineV2(pkgs []SystemPackageDBLoad) []SystemPackageInlineV2 { + data := make([]SystemPackageInlineV2, len(pkgs)) + for i, v := range pkgs { + data[i].SystemPackagesAttrsCommon = v.SystemPackagesAttrsCommon + installable, _ := findLatestEVRA(v) + data[i].LatestEVRA = installable.EVRA + } + return data +} + +func buildSystemPackageInlineV3(pkgs []SystemPackageDBLoad) []SystemPackageInlineV3 { + data := make([]SystemPackageInlineV3, len(pkgs)) + for i, v := range pkgs { + data[i].SystemPackagesAttrsV3 = v.SystemPackagesAttrsV3 + latestInstallable, latestApplicable := findLatestEVRA(v) + data[i].LatestInstallable = latestInstallable.EVRA + data[i].LatestApplicable = latestApplicable.EVRA + } + return data } diff --git a/manager/controllers/system_packages_export_test.go b/manager/controllers/system_packages_export_test.go index 382482908..4918e8f53 100644 --- a/manager/controllers/system_packages_export_test.go +++ b/manager/controllers/system_packages_export_test.go @@ -14,12 +14,13 @@ func TestSystemPackagesExportHandlerJSON(t *testing.T) { w := CreateRequestRouterWithParams("GET", "/00000000-0000-0000-0000-000000000013/packages", nil, "application/json", SystemPackagesExportHandler, 3, "GET", "/:inventory_id/packages") - var output []SystemPackageInline + var output []SystemPackageInlineV3 CheckResponse(t, w, http.StatusOK, &output) assert.Equal(t, 4, len(output)) assert.Equal(t, output[0].Name, "kernel") assert.Equal(t, output[0].EVRA, "5.6.13-200.fc31.x86_64") - assert.Equal(t, output[0].LatestEVRA, "5.6.13-200.fc31.x86_64") + assert.Equal(t, output[0].LatestInstallable, "5.6.13-200.fc31.x86_64") + assert.Equal(t, output[0].LatestApplicable, "5.6.13-200.fc31.x86_64") assert.Equal(t, output[0].Summary, "The Linux kernel") } @@ -33,12 +34,12 @@ func TestSystemPackagesExportHandlerCSV(t *testing.T) { lines := strings.Split(body, "\n") assert.Equal(t, 6, len(lines)) - assert.Equal(t, "name,evra,summary,description,updatable,latest_evra", lines[0]) + assert.Equal(t, "name,evra,summary,description,updatable,update_status,latest_installable,latest_applicable", lines[0]) assert.Equal(t, "kernel,5.6.13-200.fc31.x86_64,The Linux kernel,The kernel meta package,false,"+ - "5.6.13-200.fc31.x86_64", lines[1]) + "None,5.6.13-200.fc31.x86_64,5.6.13-200.fc31.x86_64", lines[1]) assert.Equal(t, "firefox,76.0.1-1.fc31.x86_64,Mozilla Firefox Web browser,Mozilla Firefox is an "+ - "open-source web browser...,true,76.0.1-1.fc31.x86_64", lines[2]) + "open-source web browser...,true,Installable,76.0.1-2.fc31.x86_64,77.0.1-1.fc31.x86_64", lines[2]) } func TestSystemPackagesExportUnknown(t *testing.T) { diff --git a/manager/controllers/system_packages_test.go b/manager/controllers/system_packages_test.go index 2e0317802..cc8da3c90 100644 --- a/manager/controllers/system_packages_test.go +++ b/manager/controllers/system_packages_test.go @@ -13,7 +13,7 @@ func TestSystemPackages(t *testing.T) { w := CreateRequestRouterWithParams("GET", "/00000000-0000-0000-0000-000000000013/packages", nil, "", SystemPackagesHandler, 3, "GET", "/:inventory_id/packages") - var output SystemPackageResponse + var output SystemPackageResponseV3 CheckResponse(t, w, http.StatusOK, &output) assert.Len(t, output.Data, 4) assert.Equal(t, output.Data[0].Name, "bash") @@ -32,7 +32,7 @@ func TestPackagesSearch(t *testing.T) { w := CreateRequestRouterWithParams("GET", "/00000000-0000-0000-0000-000000000012/packages?search=kernel", nil, "", SystemPackagesHandler, 3, "GET", "/:inventory_id/packages") - var output SystemPackageResponse + var output SystemPackageResponseV3 CheckResponse(t, w, http.StatusOK, &output) assert.Len(t, output.Data, 1) assert.Equal(t, output.Data[0].Name, "kernel") @@ -51,7 +51,18 @@ func TestSystemPackagesUpdatableOnly(t *testing.T) { w := CreateRequestRouterWithParams("GET", "/00000000-0000-0000-0000-000000000013/packages?filter[updatable]=true", nil, "", SystemPackagesHandler, 3, "GET", "/:inventory_id/packages") - var output SystemPackageResponse + var output SystemPackageResponseV3 + CheckResponse(t, w, http.StatusOK, &output) + assert.Len(t, output.Data, 1) + assert.Equal(t, output.Data[0].Name, "firefox") +} + +func TestSystemPackagesName(t *testing.T) { + core.SetupTest(t) + w := CreateRequestRouterWithParams("GET", "/00000000-0000-0000-0000-000000000013/packages?filter[name]=firefox", + nil, "", SystemPackagesHandler, 3, "GET", "/:inventory_id/packages") + + var output SystemPackageResponseV3 CheckResponse(t, w, http.StatusOK, &output) assert.Len(t, output.Data, 1) assert.Equal(t, output.Data[0].Name, "firefox") @@ -63,7 +74,7 @@ func TestSystemPackagesNonUpdatableOnly(t *testing.T) { "/00000000-0000-0000-0000-000000000013/packages?filter[updatable]=false", nil, "", SystemPackagesHandler, 3, "GET", "/:inventory_id/packages") - var output SystemPackageResponse + var output SystemPackageResponseV3 CheckResponse(t, w, http.StatusOK, &output) assert.Len(t, output.Data, 3) assert.Equal(t, output.Data[0].Name, "bash") diff --git a/manager/controllers/systems.go b/manager/controllers/systems.go index dd42d07d6..d3a3ef5f3 100644 --- a/manager/controllers/systems.go +++ b/manager/controllers/systems.go @@ -77,6 +77,8 @@ type SystemItemAttributesCommon struct { SystemLastUpload SystemTimestamps SystemStale + SystemSatelliteManaged + SystemBuiltPkgcache } // nolint: lll @@ -94,6 +96,7 @@ type SystemItemAttributesV2Only struct { type SystemItemAttributesV3Only struct { BaselineIDAttr + SystemGroups } type SystemItemAttributesV2 struct { @@ -113,9 +116,21 @@ type SystemItemAttributesAll struct { } type SystemTagsList []SystemTag +type SystemGroupsList []SystemGroup +type SystemInventoryItemList[T SystemTagsList | SystemGroupsList] struct { + SystemInventoryItems T +} func (v SystemTagsList) String() string { - b, err := json.Marshal(v) + return SystemInventoryItemList[SystemTagsList]{v}.String() +} + +func (v SystemGroupsList) String() string { + return SystemInventoryItemList[SystemGroupsList]{v}.String() +} + +func (v SystemInventoryItemList[T]) String() string { + b, err := json.Marshal(v.SystemInventoryItems) if err != nil { utils.LogError("err", err.Error(), "Unable to convert tags struct to json") } @@ -156,13 +171,14 @@ type SystemsResponseV3 struct { func systemsCommon(c *gin.Context, apiver int) (*gorm.DB, *ListMeta, []string, error) { var err error account := c.GetInt(middlewares.KeyAccount) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) db := middlewares.DBFromContext(c) - query := querySystems(db, account, apiver) - filters, err := ParseTagsFilters(c) + query := querySystems(db, account, apiver, groups) + filters, err := ParseAllFilters(c, SystemOpts) if err != nil { return nil, nil, nil, err } // Error handled method itself - query, _ = ApplyTagsFilter(filters, query, "sp.inventory_id") + query, _ = ApplyInventoryFilter(filters, query, "sp.inventory_id") query, meta, params, err := ListCommon(query, c, filters, SystemOpts) // Error handled method itself return query, meta, params, err @@ -177,7 +193,7 @@ func systemsCommon(c *gin.Context, apiver int) (*gorm.DB, *ListMeta, []string, e // @Produce json // @Param limit query int false "Limit for paging, set -1 to return all" // @Param offset query int false "Offset for paging" -// @Param sort query string false "Sort field" Enums(id,display_name,last_upload,rhsa_count,rhba_count,rhea_count,other_count,stale,packages_installed,baseline_name) +// @Param sort query string false "Sort field" Enums(id,display_name,last_upload,rhsa_count,rhba_count,rhea_count,other_count,stale,packages_installed,baseline_name,groups) // @Param search query string false "Find matching text" // @Param filter[id] query string false "Filter" // @Param filter[display_name] query string false "Filter" @@ -195,8 +211,9 @@ func systemsCommon(c *gin.Context, apiver int) (*gorm.DB, *ListMeta, []string, e // @Param filter[baseline_name] query string false "Filter" // @Param filter[os] query string false "Filter OS version" // @Param tags query []string false "Tag filter" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" // @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" -// @Param filter[system_profile][sap_sids][in] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" // @Param filter[system_profile][ansible] query string false "Filter systems by ansible" // @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" // @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" @@ -252,7 +269,7 @@ func SystemsListHandler(c *gin.Context) { // @Produce json // @Param limit query int false "Limit for paging, set -1 to return all" // @Param offset query int false "Offset for paging" -// @Param sort query string false "Sort field" Enums(id,display_name,last_upload,rhsa_count,rhba_count,rhea_count,other_count,stale,packages_installed,baseline_name) +// @Param sort query string false "Sort field" Enums(id,display_name,last_upload,rhsa_count,rhba_count,rhea_count,other_count,stale,packages_installed,baseline_name,satellite_managed,built_pkgcache) // @Param search query string false "Find matching text" // @Param filter[id] query string false "Filter" // @Param filter[display_name] query string false "Filter" @@ -269,9 +286,12 @@ func SystemsListHandler(c *gin.Context) { // @Param filter[created] query string false "Filter" // @Param filter[baseline_name] query string false "Filter" // @Param filter[os] query string false "Filter OS version" +// @Param filter[satellite_managed] query string false "Filter" +// @Param filter[built_pkgcache] query string false "Filter" // @Param tags query []string false "Tag filter" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" // @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" -// @Param filter[system_profile][sap_sids][in] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" // @Param filter[system_profile][ansible] query string false "Filter systems by ansible" // @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" // @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" @@ -302,9 +322,8 @@ func SystemsListIDsHandler(c *gin.Context) { c.JSON(http.StatusOK, &resp) } -func querySystems(db *gorm.DB, account, apiver int) *gorm.DB { - q := database.Systems(db, account). - Joins("JOIN inventory.hosts ih ON ih.id = sp.inventory_id"). +func querySystems(db *gorm.DB, account, apiver int, groups map[string]string) *gorm.DB { + q := database.Systems(db, account, groups). Joins("LEFT JOIN baseline bl ON sp.baseline_id = bl.id AND sp.rh_account_id = bl.rh_account_id") if apiver < 3 { return q.Select(SystemsSelectV2) @@ -312,17 +331,15 @@ func querySystems(db *gorm.DB, account, apiver int) *gorm.DB { return q.Select(SystemsSelectV3) } -func parseSystemTags(jsonStr string) ([]SystemTag, error) { +func parseSystemItems(jsonStr string, res interface{}) error { js := json.RawMessage(jsonStr) b, err := json.Marshal(js) if err != nil { - return nil, err + return err } - var systemTags []SystemTag - err = json.Unmarshal(b, &systemTags) - if err != nil { - return nil, err + if err := json.Unmarshal(b, res); err != nil { + return err } - return systemTags, nil + return nil } diff --git a/manager/controllers/systems_advisories_view.go b/manager/controllers/systems_advisories_view.go index 08ebdb243..46bbcb6b8 100644 --- a/manager/controllers/systems_advisories_view.go +++ b/manager/controllers/systems_advisories_view.go @@ -42,9 +42,9 @@ func totalItems(tx *gorm.DB, cols string) (int, error) { return int(count), err } -func systemsAdvisoriesQuery(db *gorm.DB, acc int, systems []SystemID, advisories []AdvisoryName, - limit, offset *int) (*gorm.DB, int, int, int, error) { - sysq := database.Systems(db, acc). +func systemsAdvisoriesQuery(db *gorm.DB, acc int, groups map[string]string, systems []SystemID, + advisories []AdvisoryName, limit, offset *int, apiver int) (*gorm.DB, int, int, int, error) { + sysq := database.Systems(db, acc, groups). Distinct("sp.rh_account_id, sp.id, sp.inventory_id"). // we need to join system_advisories to make `limit` work properly // without this join it can happen that we display less items on some pages @@ -65,10 +65,16 @@ func systemsAdvisoriesQuery(db *gorm.DB, acc int, systems []SystemID, advisories return nil, total, lim, off, err } + installableOnly := "" + if apiver > 2 { + // display only installable advisories in v3 api + installableOnly = "AND sa.status_id = 0" + } + query := db.Table("(?) as sp", sysq). Select(systemsAdvisoriesSelect). - Joins(`LEFT JOIN system_advisories sa ON sa.system_id = sp.id - AND sa.rh_account_id = sp.rh_account_id AND sa.rh_account_id = ?`, acc) + Joins(fmt.Sprintf(`LEFT JOIN system_advisories sa ON sa.system_id = sp.id + AND sa.rh_account_id = sp.rh_account_id AND sa.rh_account_id = ? %s`, installableOnly), acc) if len(advisories) > 0 { query = query.Joins("LEFT JOIN advisory_metadata am ON am.id = sa.advisory_id AND am.name in (?)", advisories) } else { @@ -79,13 +85,15 @@ func systemsAdvisoriesQuery(db *gorm.DB, acc int, systems []SystemID, advisories return query, total, lim, off, nil } -func advisoriesSystemsQuery(db *gorm.DB, acc int, systems []SystemID, advisories []AdvisoryName, - limit, offset *int) (*gorm.DB, int, int, int, error) { - advq := db.Table("advisory_metadata am"). +func advisoriesSystemsQuery(db *gorm.DB, acc int, groups map[string]string, systems []SystemID, + advisories []AdvisoryName, limit, offset *int, apiver int) (*gorm.DB, int, int, int, error) { + // get all advisories for all systems in the account (with inventory.hosts join) + advq := database.Systems(db, acc, groups). Distinct("am.id, am.name"). // we need to join system_advisories to make `limit` work properly // without this join it can happen that we display less items on some pages - Joins("JOIN system_advisories sa ON am.id = sa.advisory_id AND sa.rh_account_id = ?", acc). + Joins("JOIN system_advisories sa ON sp.id = sa.system_id AND sa.rh_account_id = ?", acc). + Joins("JOIN advisory_metadata am ON am.id = sa.advisory_id"). Order("am.name, am.id") if len(advisories) > 0 { advq = advq.Where("am.name in (?)", advisories) @@ -101,10 +109,22 @@ func advisoriesSystemsQuery(db *gorm.DB, acc int, systems []SystemID, advisories return nil, total, lim, off, err } + installableOnly := "" + if apiver > 2 { + // display only systems with installable advisories in v3 api + installableOnly = "AND sa.status_id = 0" + } + spJoin := "LEFT JOIN system_platform sp ON sp.id = sa.system_id AND sa.rh_account_id = sp.rh_account_id" query := db.Table("(?) as am", advq). Distinct(systemsAdvisoriesSelect). - Joins("JOIN system_advisories sa ON am.id = sa.advisory_id AND sa.rh_account_id = ?", acc) + Joins( + fmt.Sprintf( + "LEFT JOIN system_advisories sa ON am.id = sa.advisory_id AND sa.rh_account_id = ? %s", + installableOnly, + ), + acc, + ) if len(systems) > 0 { query = query.Joins(fmt.Sprintf("%s AND sp.inventory_id::text in (?)", spJoin), systems) } else { @@ -126,12 +146,16 @@ func queryDB(c *gin.Context, endpoint string) ([]systemsAdvisoriesDBLoad, *ListM return nil, nil, err } acc := c.GetInt(middlewares.KeyAccount) + apiver := c.GetInt(middlewares.KeyApiver) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) db := middlewares.DBFromContext(c) switch endpoint { case "SystemsAdvisories": - q, total, limit, offset, err = systemsAdvisoriesQuery(db, acc, req.Systems, req.Advisories, req.Limit, req.Offset) + q, total, limit, offset, err = systemsAdvisoriesQuery( + db, acc, groups, req.Systems, req.Advisories, req.Limit, req.Offset, apiver) case "AdvisoriesSystems": - q, total, limit, offset, err = advisoriesSystemsQuery(db, acc, req.Systems, req.Advisories, req.Limit, req.Offset) + q, total, limit, offset, err = advisoriesSystemsQuery( + db, acc, groups, req.Systems, req.Advisories, req.Limit, req.Offset, apiver) default: return nil, nil, fmt.Errorf("unknown endpoint '%s'", endpoint) } @@ -152,8 +176,8 @@ func queryDB(c *gin.Context, endpoint string) ([]systemsAdvisoriesDBLoad, *ListM return data, &meta, nil } -// @Summary View system-advisory pairs for selected systems and advisories -// @Description View system-advisory pairs for selected systems and advisories +// @Summary View system-advisory pairs for selected systems and installable advisories +// @Description View system-advisory pairs for selected systems and installable advisories // @ID viewSystemsAdvisories // @Security RhIdentity // @Accept json @@ -188,8 +212,8 @@ func PostSystemsAdvisories(c *gin.Context) { c.JSON(http.StatusOK, response) } -// @Summary View advisory-system pairs for selected systems and advisories -// @Description View advisory-system pairs for selected systems and advisories +// @Summary View advisory-system pairs for selected systems and installable advisories +// @Description View advisory-system pairs for selected systems and installable advisories // @ID viewAdvisoriesSystems // @Security RhIdentity // @Accept json diff --git a/manager/controllers/systems_advisories_view_test.go b/manager/controllers/systems_advisories_view_test.go index 0332f5858..ee5892593 100644 --- a/manager/controllers/systems_advisories_view_test.go +++ b/manager/controllers/systems_advisories_view_test.go @@ -17,7 +17,7 @@ func doTestView(t *testing.T, handler gin.HandlerFunc, limit, offset *int, check core.SetupTest(t) body := SystemsAdvisoriesRequest{ Systems: []SystemID{"00000000-0000-0000-0000-000000000001", "00000000-0000-0000-0000-000000000002"}, - Advisories: []AdvisoryName{"RH-1", "RH-2"}, + Advisories: []AdvisoryName{"RH-1", "RH-3"}, Limit: limit, Offset: offset, } @@ -35,8 +35,8 @@ func TestSystemsAdvisoriesView(t *testing.T) { var output SystemsAdvisoriesResponse CheckResponse(t, w, http.StatusOK, &output) assert.Equal(t, output.Data["00000000-0000-0000-0000-000000000001"][0], AdvisoryName("RH-1")) - assert.Equal(t, output.Data["00000000-0000-0000-0000-000000000001"][1], AdvisoryName("RH-2")) - assert.Equal(t, output.Data["00000000-0000-0000-0000-000000000002"][0], AdvisoryName("RH-1")) + assert.Equal(t, output.Data["00000000-0000-0000-0000-000000000001"][1], AdvisoryName("RH-3")) + assert.Equal(t, 0, len(output.Data["00000000-0000-0000-0000-000000000002"])) }) } @@ -45,8 +45,7 @@ func TestAdvisoriesSystemsView(t *testing.T) { var output AdvisoriesSystemsResponse CheckResponse(t, w, http.StatusOK, &output) assert.Equal(t, output.Data["RH-1"][0], SystemID("00000000-0000-0000-0000-000000000001")) - assert.Equal(t, output.Data["RH-1"][1], SystemID("00000000-0000-0000-0000-000000000002")) - assert.Equal(t, output.Data["RH-2"][0], SystemID("00000000-0000-0000-0000-000000000001")) + assert.Equal(t, output.Data["RH-3"][0], SystemID("00000000-0000-0000-0000-000000000001")) }) } diff --git a/manager/controllers/systems_auth_test.go b/manager/controllers/systems_auth_test.go index 0e639d507..7ad9984e2 100644 --- a/manager/controllers/systems_auth_test.go +++ b/manager/controllers/systems_auth_test.go @@ -21,6 +21,6 @@ func TestMissingAccount(t *testing.T) { testAccountSystemCounts(t, 0, 0) testAccountSystemCounts(t, 1, 8) testAccountSystemCounts(t, 2, 3) - testAccountSystemCounts(t, 3, 4) + testAccountSystemCounts(t, 3, 5) testAccountSystemCounts(t, 4, 0) } diff --git a/manager/controllers/systems_export.go b/manager/controllers/systems_export.go index 2e8afd1a0..f920b9388 100644 --- a/manager/controllers/systems_export.go +++ b/manager/controllers/systems_export.go @@ -22,8 +22,9 @@ import ( // @Param filter[other_count] query string false "Filter" // @Param filter[stale] query string false "Filter" // @Param filter[packages_installed] query string false "Filter" +// @Param filter[group_name] query []string false "Filter systems by inventory groups" // @Param filter[system_profile][sap_system] query string false "Filter only SAP systems" -// @Param filter[system_profile][sap_sids][in] query []string false "Filter systems by their SAP SIDs" +// @Param filter[system_profile][sap_sids] query []string false "Filter systems by their SAP SIDs" // @Param filter[system_profile][ansible] query string false "Filter systems by ansible" // @Param filter[system_profile][ansible][controller_version] query string false "Filter systems by ansible version" // @Param filter[system_profile][mssql] query string false "Filter systems by mssql version" @@ -38,13 +39,14 @@ import ( func SystemsExportHandler(c *gin.Context) { account := c.GetInt(middlewares.KeyAccount) apiver := c.GetInt(middlewares.KeyApiver) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) db := middlewares.DBFromContext(c) - query := querySystems(db, account, apiver) - filters, err := ParseTagsFilters(c) + query := querySystems(db, account, apiver, groups) + filters, err := ParseAllFilters(c, SystemOpts) if err != nil { return } // Error handled in method itself - query, _ = ApplyTagsFilter(filters, query, "sp.inventory_id") + query, _ = ApplyInventoryFilter(filters, query, "sp.inventory_id") var systems SystemDBLookupSlice diff --git a/manager/controllers/systems_export_test.go b/manager/controllers/systems_export_test.go index 79cd21477..b8dfdc0d3 100644 --- a/manager/controllers/systems_export_test.go +++ b/manager/controllers/systems_export_test.go @@ -48,13 +48,14 @@ func TestSystemsExportCSV(t *testing.T) { assert.Equal(t, 10, len(lines)) assert.Equal(t, "id,display_name,os,rhsm,tags,rhsa_count,rhba_count,rhea_count,other_count,packages_installed,baseline_name,"+ - "last_upload,stale_timestamp,stale_warning_timestamp,culled_timestamp,created,stale,baseline_id", + "last_upload,stale_timestamp,stale_warning_timestamp,culled_timestamp,created,stale,satellite_managed,"+ + "built_pkgcache,baseline_id,groups", lines[0]) assert.Equal(t, "00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000001,RHEL 8.10,8.10,"+ "\"[{'key':'k1','namespace':'ns1','value':'val1'},{'key':'k2','namespace':'ns1','value':'val2'}]\","+ "2,2,1,0,0,baseline_1-1,2020-09-22T16:00:00Z,2018-08-26T16:00:00Z,2018-09-02T16:00:00Z,2018-09-09T16:00:00Z,"+ - "2018-08-26T16:00:00Z,false,1", + "2018-08-26T16:00:00Z,false,false,false,1,\"[{'id':'inventory-group-1','name':'group1'}]\"", lines[1]) } @@ -63,8 +64,7 @@ func TestSystemsExportWrongFormat(t *testing.T) { assert.Equal(t, http.StatusUnsupportedMediaType, w.Code) body := w.Body.String() - exp := `{"error":"Invalid content type 'test-format', use 'application/json' or 'text/csv'"}` - assert.Equal(t, exp, body) + assert.Equal(t, InvalidContentTypeErr, body) } func TestSystemsExportCSVFilter(t *testing.T) { @@ -77,7 +77,8 @@ func TestSystemsExportCSVFilter(t *testing.T) { assert.Equal(t, 2, len(lines)) assert.Equal(t, "id,display_name,os,rhsm,tags,rhsa_count,rhba_count,rhea_count,other_count,packages_installed,baseline_name,"+ - "last_upload,stale_timestamp,stale_warning_timestamp,culled_timestamp,created,stale,baseline_id", + "last_upload,stale_timestamp,stale_warning_timestamp,culled_timestamp,created,stale,satellite_managed,"+ + "built_pkgcache,baseline_id,groups", lines[0]) assert.Equal(t, "", lines[1]) } @@ -102,7 +103,7 @@ func TestExportSystemsTagsInvalid(t *testing.T) { func TestSystemsExportWorkloads(t *testing.T) { w := makeRequest( t, - "/?filter[system_profile][sap_system]=true&filter[system_profile][sap_sids][in][]=ABC", + "/?filter[system_profile][sap_system]=true&filter[system_profile][sap_sids]=ABC", "application/json", ) diff --git a/manager/controllers/systems_ids_test.go b/manager/controllers/systems_ids_test.go index faba9811d..bf5198dfc 100644 --- a/manager/controllers/systems_ids_test.go +++ b/manager/controllers/systems_ids_test.go @@ -74,7 +74,7 @@ func TestSystemsIDsTagsInvalid(t *testing.T) { } func TestSystemsIDsWorkloads1(t *testing.T) { - url := "/?filter[system_profile][sap_system]=true&filter[system_profile][sap_sids][in][]=ABC" + url := "/?filter[system_profile][sap_system]=true&filter[system_profile][sap_sids]=ABC" output := testSystemsIDs(t, url, 1) assert.Equal(t, 2, len(output.IDs)) assert.Equal(t, "00000000-0000-0000-0000-000000000001", output.IDs[0]) @@ -94,7 +94,7 @@ func TestSystemsIDsWorkloads3(t *testing.T) { func TestSystemsIDsPackagesCount(t *testing.T) { output := testSystemsIDs(t, "/?sort=-packages_installed,id", 3) - assert.Equal(t, 4, len(output.IDs)) + assert.Equal(t, 5, len(output.IDs)) assert.Equal(t, "00000000-0000-0000-0000-000000000012", output.IDs[0]) } @@ -136,7 +136,7 @@ func TestSystemsIDsFilterBaseline(t *testing.T) { func TestSystemsIDsFilterNotExisting(t *testing.T) { statusCode, errResp := testSystemsIDsError(t, "/?filter[not-existing]=1") assert.Equal(t, http.StatusBadRequest, statusCode) - assert.Equal(t, "Invalid filter field: not-existing", errResp.Error) + assert.Equal(t, "cannot parse inventory filters: Invalid filter field: not-existing", errResp.Error) } func TestSystemsIDsFilterPartialOS(t *testing.T) { @@ -156,12 +156,6 @@ func TestSystemsIDsFilterOS(t *testing.T) { assert.Equal(t, output.Data[2].ID, outputIDs.IDs[2]) } -func TestSystemsIDsFilterInvalidSyntax(t *testing.T) { - statusCode, errResp := testSystemsIDsError(t, "/?filter[os][in]=RHEL 8.1,RHEL 7.3") - assert.Equal(t, http.StatusBadRequest, statusCode) - assert.Equal(t, InvalidNestedFilter, errResp.Error) -} - func TestSystemsIDsOrderOS(t *testing.T) { output := testSystems(t, `/?sort=os`, 1) outputIDs := testSystemsIDs(t, `/?sort=os`, 1) diff --git a/manager/controllers/systems_test.go b/manager/controllers/systems_test.go index ab627c674..e4ee7a78f 100644 --- a/manager/controllers/systems_test.go +++ b/manager/controllers/systems_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" ) -const sapABCFilter = "/?filter[system_profile][sap_system]=true&filter[system_profile][sap_sids][]=ABC" +const sapABCFilter = "/?filter[system_profile][sap_system]=true&filter[system_profile][sap_sids]=ABC" func TestSystemsDefault(t *testing.T) { output := testSystems(t, `/`, 1) @@ -33,6 +33,8 @@ func TestSystemsDefault(t *testing.T) { assert.Equal(t, SystemTagsList{{"k1", "ns1", "val1"}, {"k2", "ns1", "val2"}}, output.Data[0].Attributes.Tags) assert.Equal(t, "baseline_1-1", output.Data[0].Attributes.BaselineName) assert.Equal(t, int64(1), output.Data[0].Attributes.BaselineID) + assert.False(t, output.Data[0].Attributes.SatelliteManaged) + assert.False(t, output.Data[0].Attributes.BuiltPkgcache) // links assert.Equal(t, "/?offset=0&limit=20&filter[stale]=eq:false&sort=-last_upload", output.Links.First) @@ -112,8 +114,28 @@ func TestSystemsTagsInvalid(t *testing.T) { assert.Equal(t, fmt.Sprintf(InvalidTagMsg, "invalidTag"), errResp.Error) } +func TestSystemsTagsEscaping1(t *testing.T) { + output := testSystems(t, `/?tags=ns1/k3=val4&tags="ns/key=quote"`, 1) + assert.Equal(t, 0, len(output.Data)) +} + +func TestSystemsTagsEscaping2(t *testing.T) { + output := testSystems(t, `/?tags=ns1/k3=val4&tags='ns/key=singlequote'`, 1) + assert.Equal(t, 0, len(output.Data)) +} + +func TestSystemsTagsEscaping3(t *testing.T) { + output := testSystems(t, `/?tags=ns1/k3=val4&tags='ns/key=inside""quote'`, 1) + assert.Equal(t, 0, len(output.Data)) +} + +func TestSystemsTagsEscaping4(t *testing.T) { + output := testSystems(t, `/?tags=ns1/k3=val4&tags=ne/key="{{malformed json}}"`, 1) + assert.Equal(t, 0, len(output.Data)) +} + func TestSystemsWorkloads1(t *testing.T) { - url := "/?filter[system_profile][sap_system]=true&filter[system_profile][sap_sids][in][]=ABC" + url := "/?filter[system_profile][sap_system]=true&filter[system_profile][sap_sids]=ABC" output := testSystems(t, url, 1) assert.Equal(t, 2, len(output.Data)) assert.Equal(t, "00000000-0000-0000-0000-000000000001", output.Data[0].ID) @@ -131,9 +153,20 @@ func TestSystemsWorkloads3(t *testing.T) { assert.Equal(t, 0, len(output.Data)) } +func TestSystemsWorkloadEscaping1(t *testing.T) { + url := "/?filter[system_profile][sap_sids]='singlequote'" + output := testSystems(t, url, 1) + assert.Equal(t, 0, len(output.Data)) +} + +func TestSystemsWorkloadEscaping2(t *testing.T) { + url := `/?filter[system_profile][sap_sids]="{{malformed json}}"` + output := testSystems(t, url, 1) + assert.Equal(t, 0, len(output.Data)) +} func TestSystemsPackagesCount(t *testing.T) { output := testSystems(t, "/?sort=-packages_installed,id", 3) - assert.Equal(t, 4, len(output.Data)) + assert.Equal(t, 5, len(output.Data)) assert.Equal(t, "00000000-0000-0000-0000-000000000012", output.Data[0].ID) assert.Equal(t, "system", output.Data[0].Type) assert.Equal(t, "00000000-0000-0000-0000-000000000012", output.Data[0].Attributes.DisplayName) @@ -174,7 +207,7 @@ func TestSystemsFilterBaseline(t *testing.T) { func TestSystemsFilterNotExisting(t *testing.T) { statusCode, errResp := testSystemsError(t, "/?filter[not-existing]=1") assert.Equal(t, http.StatusBadRequest, statusCode) - assert.Equal(t, "Invalid filter field: not-existing", errResp.Error) + assert.Equal(t, "cannot parse inventory filters: Invalid filter field: not-existing", errResp.Error) } func TestSystemsFilterOS(t *testing.T) { @@ -185,12 +218,6 @@ func TestSystemsFilterOS(t *testing.T) { assert.Equal(t, "RHEL 8.1", output.Data[2].Attributes.OS) } -func TestSystemsFilterInvalidSyntax(t *testing.T) { - statusCode, errResp := testSystemsError(t, "/?filter[os][in]=RHEL 8.1,RHEL 7.3") - assert.Equal(t, http.StatusBadRequest, statusCode) - assert.Equal(t, InvalidNestedFilter, errResp.Error) -} - func TestSystemsOrderOS(t *testing.T) { output := testSystems(t, `/?sort=os`, 1) assert.Equal(t, "RHEL 7.3", output.Data[0].Attributes.OS) @@ -229,29 +256,29 @@ func TestSystemsTagsInMetadata(t *testing.T) { ParseResponseBody(t, w.Body.Bytes(), &output) testMap := map[string]FilterData{ - "ns1/k1": {"eq", []string{"val1"}}, - "ns1/k3": {"eq", []string{"val4"}}, - "stale": {"eq", []string{"false"}}, + "ns1/k1": {Operator: "eq", Values: []string{"val1"}}, + "ns1/k3": {Operator: "eq", Values: []string{"val4"}}, + "stale": {Operator: "eq", Values: []string{"false"}}, } assert.Equal(t, testMap, output.Meta.Filter) } func TestSAPSystemMeta1(t *testing.T) { - url := "/?filter[system_profile][sap_sids][]=ABC" + url := "/?filter[system_profile][sap_sids]=ABC" output := testSystems(t, url, 1) testMap := map[string]FilterData{ - "sap_sids": {"eq", []string{`"ABC"`}}, - "stale": {"eq", []string{"false"}}, + "system_profile][sap_sids": {Operator: "eq", Values: []string{"ABC"}}, + "stale": {Operator: "eq", Values: []string{"false"}}, } assert.Equal(t, testMap, output.Meta.Filter) } func TestSAPSystemMeta2(t *testing.T) { - url := "/?filter[system_profile][sap_sids][in][]=ABC" + url := "/?filter[system_profile][sap_sids]=ABC" output := testSystems(t, url, 1) testMap := map[string]FilterData{ - "sap_sids": {"in", []string{`"ABC"`}}, - "stale": {"eq", []string{"false"}}, + "system_profile][sap_sids": {Operator: "eq", Values: []string{"ABC"}}, + "stale": {Operator: "eq", Values: []string{"false"}}, } assert.Equal(t, testMap, output.Meta.Filter) } @@ -260,19 +287,19 @@ func TestSAPSystemMeta3(t *testing.T) { url := sapABCFilter output := testSystems(t, url, 1) testMap := map[string]FilterData{ - "sap_system": {"eq", []string{"true"}}, - "sap_sids": {"eq", []string{`"ABC"`}}, - "stale": {"eq", []string{"false"}}, + "system_profile][sap_system": {Operator: "eq", Values: []string{"true"}}, + "system_profile][sap_sids": {Operator: "eq", Values: []string{"ABC"}}, + "stale": {Operator: "eq", Values: []string{"false"}}, } assert.Equal(t, testMap, output.Meta.Filter) } func TestSAPSystemMeta4(t *testing.T) { - url := "/?filter[system_profile][sap_sids][in]=ABC&filter[system_profile][sap_sids][in]=GHI" + url := "/?filter[system_profile][sap_sids]=ABC&filter[system_profile][sap_sids]=GHI" output := testSystems(t, url, 1) testMap := map[string]FilterData{ - "sap_sids": {"in", []string{`"ABC"`, `"GHI"`}}, - "stale": {"eq", []string{"false"}}, + "system_profile][sap_sids": {Operator: "eq", Values: []string{"GHI", "ABC"}}, + "stale": {Operator: "eq", Values: []string{"false"}}, } assert.Equal(t, testMap, output.Meta.Filter) } @@ -281,8 +308,8 @@ func TestAAPSystemMeta(t *testing.T) { url := `/?filter[system_profile][ansible][controller_version]=1.0` output := testSystems(t, url, 1) testMap := map[string]FilterData{ - "ansible->controller_version": {"eq", []string{"1.0"}}, - "stale": {"eq", []string{"false"}}, + "system_profile][ansible][controller_version": {Operator: "eq", Values: []string{"1.0"}}, + "stale": {Operator: "eq", Values: []string{"false"}}, } assert.Equal(t, testMap, output.Meta.Filter) } @@ -291,8 +318,8 @@ func TestAAPSystemMeta2(t *testing.T) { url := `/?filter[system_profile][ansible]=not_nil` output := testSystems(t, url, 1) testMap := map[string]FilterData{ - "ansible": {"eq", []string{"not_nil"}}, - "stale": {"eq", []string{"false"}}, + "system_profile][ansible": {Operator: "eq", Values: []string{"not_nil"}}, + "stale": {Operator: "eq", Values: []string{"false"}}, } assert.Equal(t, testMap, output.Meta.Filter) } @@ -312,8 +339,8 @@ func TestMSSQLSystemMeta(t *testing.T) { url := `/?filter[system_profile][mssql][version]=15.3.0` output := testSystems(t, url, 1) testMap := map[string]FilterData{ - "mssql->version": {"eq", []string{"15.3.0"}}, - "stale": {"eq", []string{"false"}}, + "system_profile][mssql][version": {Operator: "eq", Values: []string{"15.3.0"}}, + "stale": {Operator: "eq", Values: []string{"false"}}, } assert.Equal(t, testMap, output.Meta.Filter) } @@ -322,8 +349,8 @@ func TestMSSQLSystemMeta2(t *testing.T) { url := `/?filter[system_profile][mssql]=not_nil` output := testSystems(t, url, 1) testMap := map[string]FilterData{ - "mssql": {"eq", []string{"not_nil"}}, - "stale": {"eq", []string{"false"}}, + "system_profile][mssql": {Operator: "eq", Values: []string{"not_nil"}}, + "stale": {Operator: "eq", Values: []string{"false"}}, } assert.Equal(t, testMap, output.Meta.Filter) } diff --git a/manager/controllers/systemtags.go b/manager/controllers/systemtags.go index ba4e42015..3335c92dd 100644 --- a/manager/controllers/systemtags.go +++ b/manager/controllers/systemtags.go @@ -64,11 +64,11 @@ var SystemTagsOpts = ListOpts{ func SystemTagListHandler(c *gin.Context) { var err error account := c.GetInt(middlewares.KeyAccount) + groups := c.GetStringMapString(middlewares.KeyInventoryGroups) db := middlewares.DBFromContext(c) // https://stackoverflow.com/questions/33474778/how-to-group-result-by-array-column-in-postgres - sq := database.Systems(db, account). - Joins("JOIN inventory.hosts ih ON ih.id = sp.inventory_id"). + sq := database.Systems(db, account, groups). Select("jsonb_array_elements(ih.tags) AS tag") query := db.Table("(?) AS sq", sq). diff --git a/manager/controllers/test_utils.go b/manager/controllers/test_utils.go index ce5ea0c40..aec8ebdba 100644 --- a/manager/controllers/test_utils.go +++ b/manager/controllers/test_utils.go @@ -7,6 +7,8 @@ import ( "github.com/stretchr/testify/assert" ) +const InvalidContentTypeErr = `{"error":"Invalid content type 'test-format', use 'application/json' or 'text/csv'"}` + func ParseResponseBody(t *testing.T, bytes []byte, out interface{}) { err := json.Unmarshal(bytes, out) assert.Nil(t, err, string(bytes)) diff --git a/manager/controllers/utils.go b/manager/controllers/utils.go index 26c73c066..9587a43c7 100644 --- a/manager/controllers/utils.go +++ b/manager/controllers/utils.go @@ -20,6 +20,7 @@ import ( ) const InvalidOffsetMsg = "Invalid offset" +const InvalidFilter = "Invalid filter field: %v" const InvalidTagMsg = "Invalid tag '%s'. Use 'namespace/key=val format'" const InvalidNestedFilter = "Nested operators not yet implemented for standard filters" const FilterNotSupportedMsg = "filtering not supported on this endpoint" @@ -27,15 +28,7 @@ const FilterNotSupportedMsg = "filtering not supported on this endpoint" var tagRegex = regexp.MustCompile(`([^/=]+)/([^/=]+)(=([^/=]+))?`) var enableCyndiTags = utils.GetBoolEnvOrDefault("ENABLE_CYNDI_TAGS", false) var disableCachedCounts = utils.GetBoolEnvOrDefault("DISABLE_CACHE_COUNTS", false) - -var validFilters = map[string]bool{ - "sap_sids": true, - "sap_system": true, - "mssql": true, - "mssql->version": true, - "ansible": true, - "ansible->controller_version": true, -} +var enableSatelliteFunctionality = utils.GetBoolEnvOrDefault("ENABLE_SATELLITE_FUNCTIONALITY", true) func LogAndRespError(c *gin.Context, err error, respMsg string) { utils.LogError("err", err.Error(), respMsg) @@ -99,53 +92,60 @@ func ApplySort(c *gin.Context, tx *gorm.DB, fieldExprs database.AttrMap, return tx, appliedFields, nil } -func validateFilters(q QueryMap, allowedFields database.AttrMap) error { - for key := range q { - // system_profile is hadled by tags, so it can be skipped - if key == "system_profile" { - continue - } - if _, ok := allowedFields[key]; !ok { - return errors.Errorf("Invalid filter field: %v", key) - } - } - return nil -} - -func ParseFilters(q QueryMap, allowedFields database.AttrMap, - defaultFilters map[string]FilterData) (Filters, error) { - filters := Filters{} - var err error +type NestedFilterMap map[string]string + +var nestedFilters = NestedFilterMap{ + "group_name": "group_name", + "group_name][in": "group_name", // obsoleted, backward compatible + "system_profile][sap_system": "system_profile][sap_system", + "system_profile][sap_sids": "system_profile][sap_sids", + "system_profile][sap_sids][": "system_profile][sap_sids", // obsoleted, backward compatible + "system_profile][sap_sids][in": "system_profile][sap_sids", // obsoleted, backward compatible + "system_profile][sap_sids][in][": "system_profile][sap_sids", // obsoleted, backward compatible + "system_profile][ansible": "system_profile][ansible", + "system_profile][ansible][controller_version": "system_profile][ansible][controller_version", + "system_profile][mssql": "system_profile][mssql", + "system_profile][mssql][version": "system_profile][mssql][version", +} + +func ParseFilters(c *gin.Context, filters Filters, allowedFields database.AttrMap, + defaultFilters map[string]FilterData, apiver int) error { + params := c.Request.URL.Query() // map[string][]string + for name, values := range params { + if strings.HasPrefix(name, "filter[") { + subject := name[7 : len(name)-1] // strip key from "filter[...]" + for _, v := range values { + if _, ok := nestedFilters[subject]; ok { + nested := nestedFilters[subject] + filters.Update(InventoryFilter, nested, v) + continue + } + if _, ok := allowedFields[subject]; !ok { + return errors.Errorf(InvalidFilter, subject) + } - if err = validateFilters(q, allowedFields); err != nil { - return filters, err + filters.Update(ColumnFilter, subject, v) + } + } } - // Apply default filters + // Apply default filters if there isn't such filter already for n, v := range defaultFilters { - filters[n] = v + if _, ok := filters[n]; !ok { + filters[n] = v + } } - // nolint: scopelint - for f := range allowedFields { - if elem := q.Path(f); elem != nil { - elem.Visit(func(path []string, val string) { - // If we encountered error in previous element, skip processing others - if err != nil { - return - } - - // the filter[a][eq]=b syntax was not yet implemented - if len(path) > 0 { - err = errors.New(InvalidNestedFilter) - return - } - filters[f], err = ParseFilterValue(val) - }) + // backward compatibility for v2 api and applicable_systems filter + if apiver < 3 { + if _, ok := filters["applicable_systems"]; ok { + // replace with `installable_systems` + filters["installable_systems"] = filters["applicable_systems"] + delete(filters, "applicable_systems") } } - return filters, err + return nil } type ListOpts struct { @@ -157,8 +157,9 @@ type ListOpts struct { } func ExportListCommon(tx *gorm.DB, c *gin.Context, opts ListOpts) (*gorm.DB, error) { - query := NestedQueryMap(c, "filter") - filters, err := ParseFilters(query, opts.Fields, opts.DefaultFilters) + apiver := c.GetInt(middlewares.KeyApiver) + filters := Filters{} + err := ParseFilters(c, filters, opts.Fields, opts.DefaultFilters, apiver) if err != nil { LogAndRespBadRequest(c, err, err.Error()) return nil, errors.Wrap(err, "filters parsing failed") @@ -173,17 +174,8 @@ func ExportListCommon(tx *gorm.DB, c *gin.Context, opts ListOpts) (*gorm.DB, err return tx, nil } -func extractTagsQueryString(c *gin.Context) string { - var tagQ string - var tags = c.QueryArray("tags") - for _, t := range tags { - tagQ = fmt.Sprintf("tags=%s&%s", t, tagQ) - } - return strings.TrimSuffix(tagQ, "&") -} - // nolint: funlen, lll -func ListCommon(tx *gorm.DB, c *gin.Context, tagFilter map[string]FilterData, opts ListOpts, params ...string) ( +func ListCommon(tx *gorm.DB, c *gin.Context, filters Filters, opts ListOpts, params ...string) ( *gorm.DB, *ListMeta, []string, error) { hasSystems := true limit, offset, err := utils.LoadLimitOffset(c, core.DefaultLimit) @@ -193,9 +185,6 @@ func ListCommon(tx *gorm.DB, c *gin.Context, tagFilter map[string]FilterData, op } tx, searchQ := ApplySearch(c, tx, opts.SearchFields...) - query := NestedQueryMap(c, "filter") - - filters, err := ParseFilters(query, opts.Fields, opts.DefaultFilters) if err != nil { LogAndRespBadRequest(c, err, err.Error()) return nil, nil, nil, errors.Wrap(err, "filters parsing failed") @@ -228,10 +217,7 @@ func ListCommon(tx *gorm.DB, c *gin.Context, tagFilter map[string]FilterData, op HasSystems: &hasSystems, } - tagQ := extractTagsQueryString(c) - - params = append(params, filters.ToQueryParams(), sortQ, tagQ, searchQ) - mergeMaps(meta.Filter, tagFilter) + params = append(params, filters.ToQueryParams(), sortQ, searchQ) if limit != -1 { tx = tx.Limit(limit) @@ -278,28 +264,24 @@ func ApplySearch(c *gin.Context, tx *gorm.DB, searchColumns ...string) (*gorm.DB } type Tag struct { - Namespace *string - Key string - Value *string + Namespace *string `json:"namespace,omitempty"` + Key string `json:"key"` + Value *string `json:"value,omitempty"` } -func HasTags(c *gin.Context) bool { +func HasInventoryFilter(filters Filters) bool { if !enableCyndiTags { return false } - hasTags := false - if len(c.QueryArray("tags")) > 0 { - hasTags = true - } - - // If we have the `system_profile` filter item, then we have tags - spQuery := NestedQueryMap(c, "filter").Path("system_profile") - if spQuery != nil { - spQuery.Visit(func(path []string, val string) { - hasTags = true - }) + for _, data := range filters { + switch data.Type { + case InventoryFilter: + return true + case TagFilter: + return true + } } - return hasTags + return false } func trimQuotes(s string) string { @@ -342,34 +324,30 @@ func (t *Tag) ApplyTag(tx *gorm.DB) *gorm.DB { return tx } - ns := "" - if t.Namespace != nil { - ns = fmt.Sprintf(`"namespace": "%s",`, *t.Namespace) - } - - v := "" - if t.Value != nil { - v = fmt.Sprintf(`, "value":"%s"`, *t.Value) - } - - query := fmt.Sprintf(`[{%s "key": "%s" %s}]`, ns, t.Key, v) - return tx.Where("ih.tags @> ?::jsonb", query) + tagStr, _ := json.Marshal([]Tag{*t}) + return tx.Where("ih.tags @> ?::jsonb", tagStr) } -func ParseTagsFilters(c *gin.Context) (map[string]FilterData, error) { +func ParseAllFilters(c *gin.Context, opts ListOpts) (Filters, error) { filters := Filters{} - err := parseTagsFromCtx(c, filters) + err := parseTags(c, filters) if err != nil { return nil, err } - parseFiltersFromCtx(c, filters) + apiver := c.GetInt(middlewares.KeyApiver) + err = ParseFilters(c, filters, opts.Fields, opts.DefaultFilters, apiver) + if err != nil { + err = errors.Wrap(err, "cannot parse inventory filters") + LogAndRespBadRequest(c, err, err.Error()) + return nil, err + } return filters, nil } -func parseTagsFromCtx(c *gin.Context, filters Filters) error { +func parseTags(c *gin.Context, filters Filters) error { tags := c.QueryArray("tags") for _, t := range tags { tag, err := ParseTag(t) @@ -393,6 +371,7 @@ func parseTagsFromCtx(c *gin.Context, filters Filters) error { value = strings.Split(val, ",") } filters[key] = FilterData{ + Type: TagFilter, Operator: "eq", Values: value, } @@ -401,41 +380,8 @@ func parseTagsFromCtx(c *gin.Context, filters Filters) error { return nil } -func parseFiltersFromCtx(c *gin.Context, filters Filters) { - filter := NestedQueryMap(c, "filter").Path("system_profile") - if filter == nil { - return - } - - filter.Visit(func(path []string, val string) { - // Specific filter keys - if len(path) >= 1 && path[0] == "sap_sids" { - val = strconv.Quote(val) - var op string - if op = "eq"; len(path) > 1 { - op = path[1] - } - appendFilterData(filters, "sap_sids", op, val) - - return - } - - // Generic filter keys - var key string - // Builds key in following format path[0]->path[1]->path[2]... - for i, s := range path { - if i == 0 { - key = path[0] - continue - } - key = fmt.Sprintf("%s->%s", key, s) - } - appendFilterData(filters, key, "eq", val) - }) -} - // Filter systems by tags with subquery -func ApplyTagsFilter(filters map[string]FilterData, tx *gorm.DB, systemIDExpr string) (*gorm.DB, bool) { +func ApplyInventoryFilter(filters map[string]FilterData, tx *gorm.DB, systemIDExpr string) (*gorm.DB, bool) { if !enableCyndiTags { return tx, false } @@ -444,7 +390,7 @@ func ApplyTagsFilter(filters map[string]FilterData, tx *gorm.DB, systemIDExpr st Table("inventory.hosts ih"). Select("ih.id") - subq, applied := ApplyTagsWhere(filters, subq) + subq, applied := ApplyInventoryWhere(filters, subq) // Don't add the subquery if we don't have to if !applied { @@ -454,10 +400,10 @@ func ApplyTagsFilter(filters map[string]FilterData, tx *gorm.DB, systemIDExpr st } // Apply Where clause with tags filter -func ApplyTagsWhere(filters map[string]FilterData, tx *gorm.DB) (*gorm.DB, bool) { +func ApplyInventoryWhere(filters map[string]FilterData, tx *gorm.DB) (*gorm.DB, bool) { applied := false for key, val := range filters { - if strings.Contains(key, "/") { + if val.Type == TagFilter { tagString := key + "=" + strings.Join(val.Values, ",") tag, _ := ParseTag(tagString) tx = tag.ApplyTag(tx) @@ -465,162 +411,65 @@ func ApplyTagsWhere(filters map[string]FilterData, tx *gorm.DB) (*gorm.DB, bool) continue } - if validFilters[key] { - values := strings.Join(val.Values, ",") - q := buildQuery(key, values) - - // Builds array of values - if len(val.Values) > 1 { - values = fmt.Sprintf("[%s]", values) - } - - if values == "not_nil" { - tx = tx.Where(q) - } else { - tx = tx.Where(q, values) - } - + if val.Type == InventoryFilter { + tx = buildInventoryQuery(tx, key, val.Values) applied = true + continue } } return tx, applied } -// Builds system_profile sub query in generic way. +// Builds inventory sub query in generic way. // Example: -// buildQuery("mssql->version", "1.0") +// buildSystemProfileQuery("mssql->version", "1.0") // returns "(ih.system_profile -> 'mssql' ->> 'version')::text = 1.0" -func buildQuery(key string, val string) string { +func buildInventoryQuery(tx *gorm.DB, key string, values []string) *gorm.DB { + if strings.Contains(key, "group_name") { + groups := []string{} + for _, v := range values { + name := v + group, err := utils.ParseInventoryGroup(nil, &name) + if err != nil { + // couldn't marshal inventory group to json + continue + } + groups = append(groups, group) + } + jsonq := fmt.Sprintf("{%s}", strings.Join(groups, ",")) + return tx.Where("ih.groups @> ANY (?::jsonb[])", jsonq) + } + var cmp string + val := values[0] - switch key { - case "sap_sids": + switch { + case val == "not_nil": + cmp = " is not null" + case strings.Contains(key, "[sap_sids"): cmp = "::jsonb @> ?::jsonb" + bval, _ := json.Marshal(values) + val = string(bval) default: cmp = "::text = ?" } - if val == "not_nil" { - cmp = " is not null" + sbkeys := strings.Split(key, "][") + subq := fmt.Sprintf("(ih.%s", sbkeys[0]) + nSbkeys := len(sbkeys) + if nSbkeys > 2 { + subq = fmt.Sprintf("%s -> '%s'", subq, strings.Join(sbkeys[1:nSbkeys-1], "' -> '")) } - - subq := "(ih.system_profile" - sbkeys := strings.Split(key, "->") - for i, sbkey := range sbkeys { - sbkey = fmt.Sprintf("'%s'", sbkey) - if i == len(sbkeys)-1 { - subq = fmt.Sprintf("%s ->> %s)", subq, sbkey) - } else { - subq = fmt.Sprintf("%s -> %s", subq, sbkey) - } - } - - return fmt.Sprintf("%s%s", subq, cmp) -} - -type QueryItem interface { - IsQuery() - Visit(visitor func(path []string, val string), pathPrefix ...string) -} -type QueryArr []string - -func (QueryArr) IsQuery() {} - -func (q QueryArr) Visit(visitor func(path []string, val string), pathPrefix ...string) { - for _, item := range q { - visitor(pathPrefix, item) - } -} - -type QueryMap map[string]QueryItem - -func (QueryMap) IsQuery() {} - -func (q QueryMap) Visit(visitor func(path []string, val string), pathPrefix ...string) { - for k, v := range q { - newPath := make([]string, len(pathPrefix)) - copy(newPath, pathPrefix) - newPath = append(newPath, k) - switch val := v.(type) { - case QueryMap: - val.Visit(visitor, newPath...) - case QueryArr: - // Inlined code here to avoid calling interface method in struct receiver (low perf) - for _, item := range val { - visitor(newPath, item) - } - } + if nSbkeys > 1 { + subq = fmt.Sprintf("%s ->> '%s')", subq, sbkeys[nSbkeys-1]) } -} - -func (q QueryMap) GetPath(keys ...string) (QueryItem, bool) { - var item QueryItem - item, has := q, true - - for has && item != nil && len(keys) > 0 { - switch itemMap := item.(type) { - case QueryMap: - item, has = itemMap[keys[0]] - keys = keys[1:] - default: - break - } - } - return item, has -} - -func (q QueryMap) Path(keys ...string) QueryItem { - v, _ := q.GetPath(keys...) - return v -} - -func NestedQueryMap(c *gin.Context, key string) QueryMap { - return nestedQueryImpl(c.Request.URL.Query(), key) -} - -func (q *QueryMap) appendValue(steps []string, value []string) { - res := *q - for i, v := range steps { - if i == len(steps)-1 { - res[v] = QueryArr(value) - } else { - if _, has := res[v]; !has { - res[v] = QueryMap{} - } - res = res[v].(QueryMap) - } + subq = fmt.Sprintf("%s%s", subq, cmp) + if val == "not_nil" { + return tx.Where(subq) } -} -// nolint: gocognit -func nestedQueryImpl(values map[string][]string, key string) QueryMap { - root := QueryMap{} - - for name, value := range values { - var steps []string - var i int - var j int - for len(name) > 0 && i >= 0 && j >= 0 { - if i = strings.IndexByte(name, '['); i >= 0 { - if name[0:i] == key || len(steps) > 0 { - // if j is 0 here, that means we received []as a part of query param name, should indicate an array - if j = strings.IndexByte(name[i+1:], ']'); j >= 0 { - // Skip [] in param names - if len(name[i+1:][:j]) > 0 { - steps = append(steps, name[i+1:][:j]) - } - name = name[i+j+2:] - } - } else if name[0:i] != key && steps == nil { - // Invalid key for the context - abort. - return root - } - } - } - root.appendValue(steps, value) - } - return root + return tx.Where(subq, val) } func Csv(ctx *gin.Context, code int, res interface{}) { @@ -647,7 +496,6 @@ func OutputExportData(c *gin.Context, data interface{}) { func systemDBLookups2SystemItems(systems []SystemDBLookup) ([]SystemItem, int, map[string]int) { data := make([]SystemItem, len(systems)) - var err error var total int subtotals := map[string]int{ "patched": 0, @@ -662,10 +510,12 @@ func systemDBLookups2SystemItems(systems []SystemDBLookup) ([]SystemItem, int, m } for i, system := range systems { - system.Tags, err = parseSystemTags(system.TagsStr) - if err != nil { + if err := parseSystemItems(system.TagsStr, &system.Tags); err != nil { utils.LogDebug("err", err.Error(), "inventory_id", system.ID, "system tags parsing failed") } + if err := parseSystemItems(system.GroupsStr, &system.Groups); err != nil { + utils.LogDebug("err", err.Error(), "inventory_id", system.ID, "system groups parsing failed") + } data[i] = SystemItem{ Attributes: system.SystemItemAttributesAll, ID: system.ID, @@ -714,6 +564,22 @@ func advisoriesIDs(advisories []AdvisoryID) []string { return ids } +func advisoriesStatusIDs(advisories []AdvisoryStatusID) IDsStatusResponse { + resp := IDsStatusResponse{} + if advisories == nil { + return resp + } + ids := make([]string, len(advisories)) + data := make([]IDStatus, len(advisories)) + for i, x := range advisories { + ids[i] = x.ID + data[i] = IDStatus{x.ID, x.Status} + } + resp.IDs = ids + resp.Data = data + return resp +} + func systemsIDs(c *gin.Context, systems []SystemsID, meta *ListMeta) ([]string, error) { var total int if len(systems) > 0 { @@ -736,28 +602,44 @@ func systemsIDs(c *gin.Context, systems []SystemsID, meta *ListMeta) ([]string, type SystemDBLookupSlice []SystemDBLookup type AdvisorySystemDBLookupSlice []AdvisorySystemDBLookup +type BaselineSystemsDBLookupSlice []BaselineSystemsDBLookup // Parse tags from TagsStr string attribute to Tags SystemTag array attribute. // It's used in /*systems endpoints as we can not map this attribute directly from database query result. func (s *SystemDBLookupSlice) ParseAndFillTags() { - var err error for i, system := range *s { - (*s)[i].Tags, err = parseSystemTags(system.TagsStr) - if err != nil { + if err := parseSystemItems(system.TagsStr, &(*s)[i].Tags); err != nil { utils.LogDebug("err", err.Error(), "inventory_id", system.ID, "system tags to export parsing failed") } + if err := parseSystemItems(system.GroupsStr, &(*s)[i].Groups); err != nil { + utils.LogDebug("err", err.Error(), "inventory_id", system.ID, "system groups to export parsing failed") + } } } // Parse tags from TagsStr string attribute to Tags SystemTag array attribute. // It's used in /*systems endpoints as we can not map this attribute directly from database query result. func (s *AdvisorySystemDBLookupSlice) ParseAndFillTags() { - var err error for i, system := range *s { - (*s)[i].Tags, err = parseSystemTags(system.TagsStr) - if err != nil { + if err := parseSystemItems(system.TagsStr, &(*s)[i].Tags); err != nil { utils.LogDebug("err", err.Error(), "inventory_id", system.ID, "system tags to export parsing failed") } + if err := parseSystemItems(system.GroupsStr, &(*s)[i].Groups); err != nil { + utils.LogDebug("err", err.Error(), "inventory_id", system.ID, "system groups to export parsing failed") + } + } +} + +// Parse tags from TagsStr string attribute to Tags SystemTag array attribute. +// It's used in /*systems endpoints as we can not map this attribute directly from database query result. +func (s *BaselineSystemsDBLookupSlice) ParseAndFillTags() { + for i, system := range *s { + if err := parseSystemItems(system.TagsStr, &(*s)[i].Tags); err != nil { + utils.LogDebug("err", err.Error(), "inventory_id", system.ID, "system tags to export parsing failed") + } + if err := parseSystemItems(system.GroupsStr, &(*s)[i].Groups); err != nil { + utils.LogDebug("err", err.Error(), "inventory_id", system.ID, "system groups to export parsing failed") + } } } @@ -792,24 +674,6 @@ func isFilterInURLValid(c *gin.Context) bool { return true } -func mergeMaps(first map[string]FilterData, second map[string]FilterData) { - for key, val := range second { - first[key] = val - } -} - -func appendFilterData(filters Filters, key string, op, val string) { - if fd, ok := filters[key]; ok { - fd.Values = append(fd.Values, val) - filters[key] = fd - } else { - filters[key] = FilterData{ - Operator: op, - Values: strings.Split(val, ","), - } - } -} - // Pagination query for handlers where ListCommon is not used func Paginate(tx *gorm.DB, limit *int, offset *int) (int, int, error) { var total int64 diff --git a/manager/controllers/utils_test.go b/manager/controllers/utils_test.go index ae15a5c3e..ae6a2be37 100644 --- a/manager/controllers/utils_test.go +++ b/manager/controllers/utils_test.go @@ -1,50 +1,57 @@ package controllers import ( - "reflect" + "app/base/database" + "app/base/rbac" + "app/base/utils" + "net/http" + "net/http/httptest" "testing" - "time" + "github.com/gin-gonic/gin" "github.com/stretchr/testify/assert" ) -func TestNestedQueryParse(t *testing.T) { - q1 := map[string][]string{ - "filter[abc][efg][eq]": {"a"}, - "filter[a][]": {"b", "c"}, - // Check that we stop after we encountered invalid filter syntax - "filter[]]]]]": {}, - "filter[[[[[": {}, - "filter": {}, +func TestGroupNameFilter(t *testing.T) { + utils.SkipWithoutDB(t) + database.Configure() + + c, _ := gin.CreateTestContext(httptest.NewRecorder()) + c.Request, _ = http.NewRequest("GET", "/?filter[group_name]=group2", nil) + + filters, err := ParseAllFilters(c, ListOpts{}) + assert.Nil(t, err) + + var systems []SystemsID + groups := map[string]string{ + rbac.KeyGrouped: `{"[{\"id\":\"inventory-group-1\"}]","[{\"id\":\"inventory-group-2\"}]"}`, } - res := nestedQueryImpl(q1, "filter") - res.Visit(func(keys []string, val string) { - if reflect.DeepEqual([]string{"abc", "efg", "eq"}, keys) { - assert.Equal(t, "a", val) - } - // We need to be able to parse multi-value elems - if reflect.DeepEqual([]string{"a"}, keys) { - assert.Contains(t, []string{"b", "c"}, val) - } - }) + tx := database.Systems(database.Db, 1, groups) + tx, _ = ApplyInventoryFilter(filters, tx, "sp.inventory_id") + tx.Scan(&systems) + + assert.Equal(t, 2, len(systems)) // 2 systems with `group2` in test_data + assert.Equal(t, "00000000-0000-0000-0000-000000000007", systems[0].ID) + assert.Equal(t, "00000000-0000-0000-0000-000000000008", systems[1].ID) } -func TestNestedQueryInvalidKey(t *testing.T) { - timeout := time.After(5 * time.Second) - done := make(chan bool) - - go func() { - q := map[string][]string{ - "filter[abc][efg][eq]": {"a"}, - } - res := nestedQueryImpl(q, "filte") - assert.Equal(t, res, QueryMap{}) - done <- true - }() - - select { - case <-timeout: - t.Fatal("Timeout exceeded - probably infinite loop in nested query") - case <-done: +func TestGroupNameFilter2(t *testing.T) { + utils.SkipWithoutDB(t) + database.Configure() + + c, _ := gin.CreateTestContext(httptest.NewRecorder()) + c.Request, _ = http.NewRequest("GET", "/?filter[group_name]=group1,group2", nil) + + filters, err := ParseAllFilters(c, ListOpts{}) + assert.Nil(t, err) + + var systems []SystemsID + groups := map[string]string{ + rbac.KeyGrouped: `{"[{\"id\":\"inventory-group-1\"}]","[{\"id\":\"inventory-group-2\"}]"}`, } + tx := database.Systems(database.Db, 1, groups) + tx, _ = ApplyInventoryFilter(filters, tx, "sp.inventory_id") + tx.Scan(&systems) + + assert.Equal(t, 8, len(systems)) // 2 systems with `group2`, 6 with `group1` in test_data } diff --git a/manager/kafka/kafka.go b/manager/kafka/kafka.go index 3f8d12f5e..e43196f35 100644 --- a/manager/kafka/kafka.go +++ b/manager/kafka/kafka.go @@ -48,7 +48,7 @@ func GetInventoryIDsToEvaluate(db *gorm.DB, baselineID *int64, accountID int, var inventoryAIDs []mqueue.EvalData if !configUpdated { // we just need to evaluate updated inventory IDs - inventoryAIDs = inventoryIDs2InventoryAIDs(accountID, updatedInventoryIDs) + inventoryAIDs = InventoryIDs2InventoryAIDs(accountID, updatedInventoryIDs) } else { // config updated - we need to update all baseline inventory IDs and the added ones too inventoryAIDs = getInventoryIDs(db, baselineID, accountID, updatedInventoryIDs) } @@ -58,7 +58,7 @@ func GetInventoryIDsToEvaluate(db *gorm.DB, baselineID *int64, accountID int, return inventoryAIDs } -func inventoryIDs2InventoryAIDs(accountID int, inventoryIDs []string) []mqueue.EvalData { +func InventoryIDs2InventoryAIDs(accountID int, inventoryIDs []string) []mqueue.EvalData { inventoryAIDs := make([]mqueue.EvalData, 0, len(inventoryIDs)) for _, v := range inventoryIDs { inventoryAIDs = append(inventoryAIDs, mqueue.EvalData{InventoryID: v, RhAccountID: accountID}) diff --git a/manager/manager.go b/manager/manager.go index 32ab57491..2219c1f20 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -6,6 +6,7 @@ import ( "app/base/mqueue" "app/base/utils" "app/docs" + "app/manager/controllers" "app/manager/kafka" "app/manager/middlewares" "app/manager/routes" @@ -57,7 +58,11 @@ func RunManager() { routes.InitAPI(api, endpointsConfig) } + // profiler + go utils.RunProfiler() + go base.TryExposeOnMetricsPort(app) + go controllers.PreloadAdvisoryCacheItems() kafka.TryStartEvalQueue(mqueue.NewKafkaWriterFromEnv) diff --git a/manager/middlewares/authentication.go b/manager/middlewares/authentication.go index 84c88be0a..de0e4815b 100644 --- a/manager/middlewares/authentication.go +++ b/manager/middlewares/authentication.go @@ -125,21 +125,6 @@ func MockAuthenticator(account int) gin.HandlerFunc { } } -func EntitlementsAuthenticator() gin.HandlerFunc { - return func(c *gin.Context) { - xrhid := (*ginContext)(c).GetXRHID() - if xrhid == nil { - // aborted by GetXRHID - return - } - if !xrhid.Entitlements["smart_management"].IsEntitled { - c.AbortWithStatusJSON( - http.StatusUnauthorized, utils.ErrorResponse{Error: "Missing smart management entitlement"}, - ) - } - } -} - // Get identity header from gin.Context func (c *ginContext) GetXRHID() *identity.XRHID { identStr := (*gin.Context)(c).GetHeader("x-rh-identity") diff --git a/manager/middlewares/rbac.go b/manager/middlewares/rbac.go index 1b96b4dbf..a691d73a2 100644 --- a/manager/middlewares/rbac.go +++ b/manager/middlewares/rbac.go @@ -5,6 +5,7 @@ import ( "app/base/api" "app/base/rbac" "app/base/utils" + "fmt" "net/http" "os" "strconv" @@ -20,10 +21,17 @@ var ( ) const xRHIdentity = "x-rh-identity" +const KeyInventoryGroups = "inventoryGroups" var allPerms = "patch:*:*" var readPerms = map[string]bool{allPerms: true, "patch:*:read": true} var writePerms = map[string]bool{allPerms: true, "patch:*:write": true} +var inventoryReadPerms = map[string]bool{ + "inventory:*:*": true, + "inventory:*:read": true, + "inventory:hosts:*": true, + "inventory:hosts:read": true, +} // handlerName to permissions mapping var granularPerms = map[string]struct { @@ -46,48 +54,60 @@ func makeClient(identity string) *api.Client { DefaultHeaders: map[string]string{xRHIdentity: identity}, } if rbacURL == "" { - rbacURL = utils.FailIfEmpty(utils.Cfg.RbacAddress, "RBAC_ADDRESS") + base.RBACApiPrefix + "/access/?application=patch" + rbacURL = utils.FailIfEmpty(utils.Cfg.RbacAddress, "RBAC_ADDRESS") + base.RBACApiPrefix + + "/access/?application=patch,inventory" } return &client } func checkPermissions(access *rbac.AccessPagination, handlerName, method string) bool { - granted := false + grantedPatch := false + grantedInventory := false for _, a := range access.Data { - if granted { + if grantedPatch && grantedInventory { return true } - if p, has := granularPerms[handlerName]; has { - // API handler requires granular permissions - if a.Permission == p.Permission { - // the required permission is present, e.g. patch:template:write - return true - } - if p.Read && !p.Write && readPerms[a.Permission] { - // required permission is read permission - // check whether we have either patch:*:read or patch:*:* - return true - } - if p.Write && !p.Read && writePerms[a.Permission] { - // required permission is write permission - // check whether we have either patch:*:write or patch:*:* - return true - } - // we need both read and write permissions - patch:*:* - granted = (a.Permission == allPerms) - } else { - // not granular - // require read permissions for GET and POST - // require write permissions for PUT and DELETE - switch method { - case "GET", "POST": - granted = readPerms[a.Permission] - case "PUT", "DELETE": - granted = writePerms[a.Permission] + + if !grantedInventory { + grantedInventory = inventoryReadPerms[a.Permission] + } + + if !grantedPatch { + if p, has := granularPerms[handlerName]; has { + // API handler requires granular permissions + if a.Permission == p.Permission { + // the required permission is present, e.g. patch:template:write + grantedPatch = true + continue + } + if p.Read && !p.Write && readPerms[a.Permission] { + // required permission is read permission + // check whether we have either patch:*:read or patch:*:* + grantedPatch = true + continue + } + if p.Write && !p.Read && writePerms[a.Permission] { + // required permission is write permission + // check whether we have either patch:*:write or patch:*:* + grantedPatch = true + continue + } + // we need both read and write permissions - patch:*:* + grantedPatch = (a.Permission == allPerms) + } else { + // not granular + // require read permissions for GET and POST + // require write permissions for PUT and DELETE + switch method { + case "GET", "POST": + grantedPatch = readPerms[a.Permission] + case "PUT", "DELETE": + grantedPatch = writePerms[a.Permission] + } } } } - return granted + return grantedPatch && grantedInventory } func isAccessGranted(c *gin.Context) bool { @@ -110,7 +130,53 @@ func isAccessGranted(c *gin.Context) bool { nameSplitted := strings.Split(c.HandlerName(), ".") handlerName := nameSplitted[len(nameSplitted)-1] - return checkPermissions(&access, handlerName, c.Request.Method) + granted := checkPermissions(&access, handlerName, c.Request.Method) + if granted { + // collect inventory groups + c.Set(KeyInventoryGroups, findInventoryGroups(&access)) + } + return granted +} + +func findInventoryGroups(access *rbac.AccessPagination) map[string]string { + res := make(map[string]string) + + if len(access.Data) == 0 { + return res + } + groups := []string{} + for _, a := range access.Data { + if !inventoryReadPerms[a.Permission] { + continue + } + + if len(a.ResourceDefinitions) == 0 { + // access to all groups + return nil + } + for _, rd := range a.ResourceDefinitions { + if rd.AttributeFilter.Key != "group.id" { + continue + } + for _, v := range rd.AttributeFilter.Value { + if v == nil { + res[rbac.KeyUngrouped] = "[]" + continue + } + group, err := utils.ParseInventoryGroup(v, nil) + if err != nil { + // couldn't marshal inventory group to json + continue + } + groups = append(groups, group) + } + } + } + + if len(groups) > 0 { + res[rbac.KeyGrouped] = fmt.Sprintf("{%s}", strings.Join(groups, ",")) + } + return res } func RBAC() gin.HandlerFunc { diff --git a/manager/middlewares/rbac_test.go b/manager/middlewares/rbac_test.go index 91c18e222..3ea666029 100644 --- a/manager/middlewares/rbac_test.go +++ b/manager/middlewares/rbac_test.go @@ -10,6 +10,11 @@ import ( "github.com/stretchr/testify/assert" ) +var ( + group1 = "df57820e-965c-49a6-b0bc-797b7dd60581" + group2 = "df3f0efd-c853-41b5-80a1-86881d5343d1" +) + func okHandler(c *gin.Context) { c.JSON(http.StatusOK, nil) } @@ -46,6 +51,7 @@ func TestPermissionsSingleWrite(t *testing.T) { access := rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:*:*"}, + {Permission: "inventory:*:*"}, }, } assert.True(t, checkPermissions(&access, handler, "PUT")) @@ -53,6 +59,7 @@ func TestPermissionsSingleWrite(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:*:write"}, + {Permission: "inventory:*:*"}, }, } assert.True(t, checkPermissions(&access, handler, "PUT")) @@ -60,6 +67,7 @@ func TestPermissionsSingleWrite(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:template:write"}, + {Permission: "inventory:*:*"}, }, } assert.True(t, checkPermissions(&access, handler, "PUT")) @@ -74,6 +82,7 @@ func TestPermissionsSingleWrite(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:asdf:read"}, + {Permission: "inventory:*:*"}, }, } assert.False(t, checkPermissions(&access, handler, "PUT")) @@ -81,6 +90,7 @@ func TestPermissionsSingleWrite(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:*:read"}, + {Permission: "inventory:*:*"}, }, } assert.False(t, checkPermissions(&access, handler, "PUT")) @@ -97,6 +107,7 @@ func TestPermissionsSingleRead(t *testing.T) { access := rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:*:*"}, + {Permission: "inventory:*:*"}, }, } assert.True(t, checkPermissions(&access, handler, "GET")) @@ -104,6 +115,7 @@ func TestPermissionsSingleRead(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:*:read"}, + {Permission: "inventory:*:*"}, }, } assert.True(t, checkPermissions(&access, handler, "GET")) @@ -111,6 +123,7 @@ func TestPermissionsSingleRead(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:single:read"}, + {Permission: "inventory:*:*"}, }, } assert.True(t, checkPermissions(&access, handler, "GET")) @@ -118,6 +131,7 @@ func TestPermissionsSingleRead(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:asdf:read"}, + {Permission: "inventory:*:*"}, }, } assert.False(t, checkPermissions(&access, handler, "GET")) @@ -125,6 +139,7 @@ func TestPermissionsSingleRead(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:asdf:write"}, + {Permission: "inventory:*:*"}, }, } assert.False(t, checkPermissions(&access, handler, "GET")) @@ -132,11 +147,13 @@ func TestPermissionsSingleRead(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:*:write"}, + {Permission: "inventory:*:*"}, }, } assert.False(t, checkPermissions(&access, handler, "GET")) } +// nolint:funlen func TestPermissionsSingleReadWrite(t *testing.T) { // handler needs `patch:single:read` handler := "SingleReadWrite" @@ -148,6 +165,7 @@ func TestPermissionsSingleReadWrite(t *testing.T) { access := rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:*:*"}, + {Permission: "inventory:*:*"}, }, } assert.True(t, checkPermissions(&access, handler, "PUT")) @@ -155,6 +173,7 @@ func TestPermissionsSingleReadWrite(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:single:*"}, + {Permission: "inventory:*:*"}, }, } assert.True(t, checkPermissions(&access, handler, "PUT")) @@ -162,6 +181,7 @@ func TestPermissionsSingleReadWrite(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:*:read"}, + {Permission: "inventory:*:*"}, }, } assert.False(t, checkPermissions(&access, handler, "PUT")) @@ -169,6 +189,7 @@ func TestPermissionsSingleReadWrite(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:single:read"}, + {Permission: "inventory:*:*"}, }, } assert.False(t, checkPermissions(&access, handler, "PUT")) @@ -176,6 +197,7 @@ func TestPermissionsSingleReadWrite(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:asdf:read"}, + {Permission: "inventory:*:*"}, }, } assert.False(t, checkPermissions(&access, handler, "PUT")) @@ -183,6 +205,7 @@ func TestPermissionsSingleReadWrite(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:asdf:write"}, + {Permission: "inventory:*:*"}, }, } assert.False(t, checkPermissions(&access, handler, "PUT")) @@ -190,6 +213,7 @@ func TestPermissionsSingleReadWrite(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:*:write"}, + {Permission: "inventory:*:*"}, }, } assert.False(t, checkPermissions(&access, handler, "PUT")) @@ -206,6 +230,7 @@ func TestPermissionsRead(t *testing.T) { access := rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:*:*"}, + {Permission: "inventory:*:*"}, }, } assert.True(t, checkPermissions(&access, handler, "GET")) @@ -213,6 +238,7 @@ func TestPermissionsRead(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:*:read"}, + {Permission: "inventory:*:*"}, }, } assert.True(t, checkPermissions(&access, handler, "GET")) @@ -220,7 +246,146 @@ func TestPermissionsRead(t *testing.T) { access = rbac.AccessPagination{ Data: []rbac.Access{ {Permission: "patch:*:write"}, + {Permission: "inventory:*:*"}, }, } assert.False(t, checkPermissions(&access, handler, "GET")) } + +func TestFindInventoryGroupsGrouped(t *testing.T) { + access := &rbac.AccessPagination{ + Data: []rbac.Access{{ + Permission: "inventory:hosts:read", + ResourceDefinitions: []rbac.ResourceDefinition{{ + AttributeFilter: rbac.AttributeFilter{ + Key: "group.id", + Value: []*string{&group1}, + }, + }}, + }}, + } + groups := findInventoryGroups(access) + assert.Equal(t, + `{"[{\"id\":\"df57820e-965c-49a6-b0bc-797b7dd60581\"}]"}`, + groups[rbac.KeyGrouped], + ) + val, ok := groups[rbac.KeyUngrouped] + assert.Equal(t, "", val) + assert.Equal(t, false, ok) +} + +func TestFindInventoryGroupsUnrouped(t *testing.T) { + access := &rbac.AccessPagination{ + Data: []rbac.Access{{ + Permission: "inventory:hosts:read", + ResourceDefinitions: []rbac.ResourceDefinition{{ + AttributeFilter: rbac.AttributeFilter{ + Key: "group.id", + Value: []*string{nil}, + }, + }}, + }}, + } + groups := findInventoryGroups(access) + val, ok := groups[rbac.KeyGrouped] + assert.Equal(t, "", val) + assert.Equal(t, false, ok) + assert.Equal(t, "[]", groups[rbac.KeyUngrouped]) +} + +// nolint:lll +func TestFindInventoryGroups(t *testing.T) { + access := &rbac.AccessPagination{ + Data: []rbac.Access{{ + Permission: "inventory:hosts:read", + ResourceDefinitions: []rbac.ResourceDefinition{{ + AttributeFilter: rbac.AttributeFilter{ + Key: "group.id", + Value: []*string{&group1, &group2, nil}, + }, + }}, + }}, + } + groups := findInventoryGroups(access) + assert.Equal(t, + `{"[{\"id\":\"df57820e-965c-49a6-b0bc-797b7dd60581\"}]","[{\"id\":\"df3f0efd-c853-41b5-80a1-86881d5343d1\"}]"}`, + groups[rbac.KeyGrouped], + ) + assert.Equal(t, "[]", groups[rbac.KeyUngrouped]) +} + +func TestFindInventoryGroupsOverwrite(t *testing.T) { + access := &rbac.AccessPagination{ + Data: []rbac.Access{ + { + Permission: "inventory:hosts:read", + ResourceDefinitions: []rbac.ResourceDefinition{{ + AttributeFilter: rbac.AttributeFilter{ + Key: "group.id", + Value: []*string{&group1, nil}, + }, + }}, + }, + { + Permission: "inventory:hosts:read", + ResourceDefinitions: []rbac.ResourceDefinition{}, + }, + }, + } + groups := findInventoryGroups(access) + // we expect access to all groups (empty map) + assert.Equal(t, 0, len(groups)) +} + +func TestFindInventoryGroupsOverwrite2(t *testing.T) { + access := &rbac.AccessPagination{ + Data: []rbac.Access{ + { + Permission: "inventory:hosts:read", + ResourceDefinitions: []rbac.ResourceDefinition{}, + }, + { + Permission: "inventory:hosts:read", + ResourceDefinitions: []rbac.ResourceDefinition{{ + AttributeFilter: rbac.AttributeFilter{ + Key: "group.id", + Value: []*string{&group1, nil}, + }, + }}, + }, + }, + } + groups := findInventoryGroups(access) + // we expect access to all groups (empty map) + assert.Equal(t, 0, len(groups)) +} + +func TestMultiplePermissions(t *testing.T) { + handler := "MultiplePermissions" + access := rbac.AccessPagination{ + Data: []rbac.Access{ + {Permission: "inventory:*:read"}, + {Permission: "inventory:hosts:write"}, + {Permission: "inventory:hosts:read"}, + {Permission: "inventory:groups:write"}, + {Permission: "inventory:groups:read"}, + {Permission: "patch:*:*"}, + {Permission: "patch:*:read"}, + }, + } + assert.True(t, checkPermissions(&access, handler, "GET")) + assert.True(t, checkPermissions(&access, handler, "DELETE")) + + access = rbac.AccessPagination{ + Data: []rbac.Access{ + {Permission: "inventory:*:read"}, + {Permission: "inventory:hosts:write"}, + {Permission: "inventory:groups:write"}, + {Permission: "patch:*:read"}, + {Permission: "inventory:hosts:read"}, + {Permission: "inventory:groups:read"}, + }, + } + assert.True(t, checkPermissions(&access, handler, "GET")) + assert.False(t, checkPermissions(&access, handler, "DELETE")) +} diff --git a/manager/routes/routes.go b/manager/routes/routes.go index 2fbc65efe..82b4c6a0f 100644 --- a/manager/routes/routes.go +++ b/manager/routes/routes.go @@ -19,13 +19,11 @@ func InitAPI(api *gin.RouterGroup, config docs.EndpointsConfig) { // nolint: fun advisories := api.Group("/advisories") advisories.GET("", controllers.AdvisoriesListHandler) - go controllers.PreloadAdvisoryCacheItems() advisories.GET("/:advisory_id", controllers.AdvisoryDetailHandler) advisories.GET("/:advisory_id/systems", controllers.AdvisorySystemsListHandler) if config.EnableBaselines { baselines := api.Group("/baselines") - baselines.Use(middlewares.EntitlementsAuthenticator()) baselines.GET("", controllers.BaselinesListHandler) baselines.GET("/:baseline_id", controllers.BaselineDetailHandler) baselines.GET("/:baseline_id/systems", controllers.BaselineSystemsListHandler) @@ -40,6 +38,8 @@ func InitAPI(api *gin.RouterGroup, config docs.EndpointsConfig) { // nolint: fun systems.GET("/:inventory_id", controllers.SystemDetailHandler) systems.GET("/:inventory_id/advisories", controllers.SystemAdvisoriesHandler) systems.GET("/:inventory_id/packages", controllers.SystemPackagesHandler) + systems.GET("/:inventory_id/vmaas_json", controllers.SystemVmaasJSONHandler) + systems.GET("/:inventory_id/yum_updates", controllers.SystemYumUpdatesHandler) systems.DELETE("/:inventory_id", controllers.SystemDeleteHandler) api.GET("/tags", controllers.SystemTagListHandler) @@ -60,6 +60,9 @@ func InitAPI(api *gin.RouterGroup, config docs.EndpointsConfig) { // nolint: fun export.GET("/packages", controllers.PackagesExportHandler) export.GET("/packages/:package_name/systems", controllers.PackageSystemsExportHandler) + if config.EnableBaselines { + export.GET("/baselines/:baseline_id/systems", controllers.BaselineSystemsExportHandler) + } views := api.Group("/views") views.POST("/systems/advisories", controllers.PostSystemsAdvisories) @@ -71,6 +74,9 @@ func InitAPI(api *gin.RouterGroup, config docs.EndpointsConfig) { // nolint: fun ids.GET("/packages/:package_name/systems", controllers.PackageSystemsListIDsHandler) ids.GET("/systems", controllers.SystemsListIDsHandler) ids.GET("/systems/:inventory_id/advisories", controllers.SystemAdvisoriesIDsHandler) + if config.EnableBaselines { + ids.GET("/baselines/:baseline_id/systems", controllers.BaselineSystemsListIDsHandler) + } api.GET("/status", controllers.Status) } @@ -91,4 +97,10 @@ func InitAdmin(app *gin.Engine) { api.GET("/sessions", admin.GetActiveSessionsHandler) api.GET("/sessions/:search", admin.GetActiveSessionsHandler) api.DELETE("/sessions/:pid", admin.TerminateSessionHandler) + + pprof := api.Group("/pprof") + pprof.GET("/evaluator_upload/:param", admin.GetEvaluatorUploadPprof) + pprof.GET("/evaluator_recalc/:param", admin.GetEvaluatorRecalcPprof) + pprof.GET("/listener/:param", admin.GetListenerPprof) + pprof.GET("/manager/:param", admin.GetManagerPprof) } diff --git a/platform/platform.go b/platform/platform.go index fd403ace1..8c200d785 100644 --- a/platform/platform.go +++ b/platform/platform.go @@ -23,7 +23,7 @@ const uploadEvent = `{ "type": "created", "host": { "id": "00000000-0000-0000-0000-000000000100", - "account": "TEST-0000", + "org_id": "org_1", "reporter": "puptoo", "tags": [ { @@ -142,6 +142,7 @@ var yumUpdates = `{ ] } }, + "build_pkgcache": false, "metadata_time": "2022-05-30T14:00:25Z" }` @@ -169,8 +170,8 @@ func platformMock() { func mockIdentity() string { ident := identity.Identity{ - Type: "User", - AccountNumber: "0", + Type: "User", + OrgID: "org_1", } js, err := json.Marshal(&ident) if err != nil { @@ -232,7 +233,7 @@ func mockToggleUpload(c *gin.Context) { func mockYumUpdatesS3(c *gin.Context) { utils.LogInfo("Mocking S3 for providing yum updates") - updates := vmaas.UpdatesV2Response{} + updates := vmaas.UpdatesV3Response{} if err := json.Unmarshal([]byte(yumUpdates), &updates); err != nil { c.JSON(http.StatusInternalServerError, err.Error()) return diff --git a/platform/rbac.go b/platform/rbac.go index 966f40abf..6a19d5a3f 100644 --- a/platform/rbac.go +++ b/platform/rbac.go @@ -10,10 +10,21 @@ import ( var rbacPermissions = utils.Getenv("RBAC_PERMISSIONS", "patch:*:read") +var inventoryGroup = "inventory-group-1" + func rbacHandler(c *gin.Context) { c.JSON(http.StatusOK, rbac.AccessPagination{ Data: []rbac.Access{ {Permission: rbacPermissions}, + { + Permission: "inventory:hosts:read", + ResourceDefinitions: []rbac.ResourceDefinition{{ + AttributeFilter: rbac.AttributeFilter{ + Key: "group.id", + Value: []*string{&inventoryGroup, nil}, + }, + }}, + }, }, }) } diff --git a/platform/vmaas.go b/platform/vmaas.go index 25eb378c7..aebda688b 100644 --- a/platform/vmaas.go +++ b/platform/vmaas.go @@ -1,51 +1,68 @@ package platform import ( + "encoding/json" + "io" "net/http" "github.com/gin-gonic/gin" ) func updatesHandler(c *gin.Context) { + var body struct { + ReturnStatus int `json:"return_status"` + } + jsonData, _ := io.ReadAll(c.Request.Body) + json.Unmarshal(jsonData, &body) // nolint:errcheck + if body.ReturnStatus > 200 { + c.AbortWithStatus(body.ReturnStatus) + return + } data := `{ - "basearch": "i686", - "modules_list": [], - "releasever": "ser1", - "repository_list": [ - "repo1" - ], - "update_list": { - "firefox-0:76.0.1-1.fc31.x86_64": { - "available_updates": [ - { - "basearch": "i686", - "erratum": "RH-1", - "package": "firefox-0:77.0.1-1.fc31.x86_64", - "releasever": "ser1", - "repository": "repo1" - }, - { - "basearch": "i686", - "erratum": "RH-2", - "package": "firefox-1:76.0.1-1.fc31.x86_64", - "releasever": "ser1", - "repository": "repo1" - } - ] - }, - "kernel-0:5.6.13-200.fc31.x86_64": { - "available_updates": [ - { - "basearch": "i686", - "erratum": "RH-100", - "package": "kernel-0:5.10.13-200.fc31.x86_64", - "releasever": "ser1", - "repository": "repo1" - } - ] - } - } - }` + "basearch": "i686", + "modules_list": [], + "releasever": "ser1", + "repository_list": [ + "repo1" + ], + "update_list": { + "firefox-0:76.0.1-1.fc31.x86_64": { + "available_updates": [ + { + "basearch": "i686", + "erratum": "RH-1", + "package": "firefox-0:77.0.1-1.fc31.x86_64", + "releasever": "ser1", + "repository": "repo1", + "package_name": "firefox", + "evra": "0:77.0.1-1.fc31.x86_64" + }, + { + "basearch": "i686", + "erratum": "RH-2", + "package": "firefox-1:76.0.1-1.fc31.x86_64", + "releasever": "ser1", + "repository": "repo1", + "package_name": "firefox", + "evra": "1:76.0.1-1.fc31.x86_64" + } + ] + }, + "kernel-0:5.6.13-200.fc31.x86_64": { + "available_updates": [ + { + "basearch": "i686", + "erratum": "RH-100", + "package": "kernel-0:5.10.13-200.fc31.x86_64", + "releasever": "ser1", + "repository": "repo1", + "package_name": "kernel", + "evra": "0:5.10.13-200.fc31.x86_64" + } + ] + } + } + }` c.Data(http.StatusOK, gin.MIMEJSON, []byte(data)) } @@ -142,38 +159,38 @@ func pkgListHandler(c *gin.Context) { "page_size": 8, "pages": 1, "package_list": [{ - "nevra": "firefox-76.0.1-1.fc31.x86_64", - "summary": "Mozilla Firefox Web browser", - "description": "Mozilla Firefox is an open-source web browser..." + "nevra": "firefox-76.0.1-1.fc31.x86_64", + "summary": "Mozilla Firefox Web browser", + "description": "Mozilla Firefox is an open-source web browser..." + },{ + "nevra": "kernel-5.6.13-200.fc31.x86_64", + "summary": "The Linux kernel", + "description": "The kernel meta package" },{ - "nevra": "kernel-5.6.13-200.fc31.x86_64", - "summary": "The Linux kernel", - "description": "The kernel meta package" + "nevra": "firefox-0:77.0.1-1.fc31.x86_64", + "summary": "Mozilla Firefox Web browser", + "description": "Mozilla Firefox is an open-source web browser..." + },{ + "nevra": "kernel-5.7.13-200.fc31.x86_64", + "summary": "The Linux kernel", + "description": "The kernel meta package" },{ - "nevra": "firefox-0:77.0.1-1.fc31.x86_64", - "summary": "Mozilla Firefox Web browser", - "description": "Mozilla Firefox is an open-source web browser..." - },{ - "nevra": "kernel-5.7.13-200.fc31.x86_64", - "summary": "The Linux kernel", - "description": "The kernel meta package" - },{ "nevra": "firefox-0:77.0.1-1.fc31.src", - "summary": null, - "description": null - },{ - "nevra": "kernel-5.7.13-200.fc31.src", - "summary": null, - "description": null - },{ - "nevra": "curl-999-1.x86_64", - "summary": "curl newest summary", - "description": "curl newest description" - },{ - "nevra": "bash-999-2.x86_64", - "summary": "bash newest summary", - "description": "bash newest description" - } + "summary": null, + "description": null + },{ + "nevra": "kernel-5.7.13-200.fc31.src", + "summary": null, + "description": null + },{ + "nevra": "curl-999-1.x86_64", + "summary": "curl newest summary", + "description": "curl newest description" + },{ + "nevra": "bash-999-2.x86_64", + "summary": "bash newest summary", + "description": "bash newest description" + } ], "last_change": "2021-04-09T04:52:06.999732+00:00"}` c.Data(http.StatusOK, gin.MIMEJSON, []byte(data)) @@ -194,13 +211,11 @@ func reposHandler(c *gin.Context) { func dbchangeHandler(c *gin.Context) { data := `{ - "dbchange": { - "errata_changes": "2222-04-16 20:07:58.500192+00", - "cve_changes": "2222-04-16 20:06:47.214266+00", - "repository_changes": "2222-04-16 20:07:55.214266+00", - "last_change": "2222-04-16 20:07:58.500192+00", - "exported": "2222-04-16 20:07:59.235962+00" - } + "errata_changes": "2222-04-16 20:07:58.500192+00", + "cve_changes": "2222-04-16 20:06:47.214266+00", + "repository_changes": "2222-04-16 20:07:55.214266+00", + "last_change": "2222-04-16 20:07:58.500192+00", + "exported": "2222-04-16 20:07:59.235962+00" }` c.Data(http.StatusOK, gin.MIMEJSON, []byte(data)) } diff --git a/scripts/go_test.sh b/scripts/go_test.sh index e36d1d08f..07426aa6f 100755 --- a/scripts/go_test.sh +++ b/scripts/go_test.sh @@ -8,4 +8,4 @@ TEST_DIRS=${1:-./...} # Run go test and colorize output (PASS - green, FAIL - red). # Set "-p 1" to run test sequentially to avoid parallel changes in testing database. -go test -v -p 1 -coverprofile=coverage.txt -covermode=atomic $TEST_DIRS +gotestsum --format=standard-verbose -- -v -p 1 -coverprofile=coverage.txt -covermode=atomic $TEST_DIRS diff --git a/scripts/go_test_db.sh b/scripts/go_test_db.sh index 6002b65f5..e227aa882 100755 --- a/scripts/go_test_db.sh +++ b/scripts/go_test_db.sh @@ -9,11 +9,11 @@ go run ./scripts/feed_db.go inventory_hosts go run main.go migrate $MIGRATION_FILES # Run database test, destroys and recreates database -go test -v app/database_admin +gotestsum --format=standard-verbose -- -v app/database_admin # Fill database with testing data WAIT_FOR_DB=full go run ./scripts/feed_db.go feed # Normal test run - everything except database schema test -TEST_DIRS=$(go list ./... | grep -v "app/database_admin") +TEST_DIRS=$(go list -buildvcs=false ./... | grep -v "app/database_admin") ./scripts/go_test.sh "${TEST_DIRS}" diff --git a/tasks/caches/caches.go b/tasks/caches/caches.go index 784ec2e0c..49e988a80 100644 --- a/tasks/caches/caches.go +++ b/tasks/caches/caches.go @@ -8,11 +8,13 @@ import ( var ( enableRefreshAdvisoryCaches bool + skipNAccountsRefresh int ) func configure() { core.ConfigureApp() enableRefreshAdvisoryCaches = utils.GetBoolEnvOrDefault("ENABLE_REFRESH_ADVISORY_CACHES", false) + skipNAccountsRefresh = utils.GetIntEnvOrDefault("SKIP_N_ACCOUNTS_REFRESH", 0) } func RunAdvisoryRefresh() { @@ -26,8 +28,12 @@ func RunPackageRefresh() { tasks.HandleContextCancel(tasks.WaitAndExit) configure() utils.LogInfo("Refreshing package cache") - if err := RefreshPackagesCaches(nil); err != nil { - utils.LogError("err", err.Error(), "Refresh account packages caches") + errRefresh := RefreshPackagesCaches(nil) + if err := Metrics().Add(); err != nil { + utils.LogInfo("err", err, "Could not push to pushgateway") + } + if errRefresh != nil { + utils.LogError("err", errRefresh.Error(), "Refresh account packages caches") return } utils.LogInfo("Refreshed account packages caches") diff --git a/tasks/caches/metrics.go b/tasks/caches/metrics.go new file mode 100644 index 000000000..d654b4c70 --- /dev/null +++ b/tasks/caches/metrics.go @@ -0,0 +1,22 @@ +package caches + +import ( + "app/base/utils" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/push" +) + +var packageRefreshPartDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Help: "How long it took particular package refresh part", + Namespace: "patchman_engine", + Subsystem: "caches", + Name: "package_refresh_part_duration_seconds", +}, []string{"part"}) + +func Metrics() *push.Pusher { + registry := prometheus.NewRegistry() + registry.MustRegister(packageRefreshPartDuration) + + return push.New(utils.Cfg.PrometheusPushGateway, "caches").Gatherer(registry) +} diff --git a/tasks/caches/refresh_advisory_caches.go b/tasks/caches/refresh_advisory_caches.go index 58b8e93da..779b831a9 100644 --- a/tasks/caches/refresh_advisory_caches.go +++ b/tasks/caches/refresh_advisory_caches.go @@ -3,7 +3,9 @@ package caches import ( "app/base/utils" "app/tasks" + "sync" + "github.com/pkg/errors" "gorm.io/gorm" ) @@ -11,16 +13,67 @@ func RefreshAdvisoryCaches() { if !enableRefreshAdvisoryCaches { return } - refreshAdvisoryCachesPerAccounts() + + var wg sync.WaitGroup + refreshAdvisoryCachesPerAccounts(&wg) + wg.Wait() } -func refreshAdvisoryCachesPerAccounts() { - err := tasks.WithTx(func(tx *gorm.DB) error { - return tx.Exec("select refresh_advisory_caches(NULL, NULL)").Error +func refreshAdvisoryCachesPerAccounts(wg *sync.WaitGroup) { + var rhAccountIDs []int + err := tasks.WithReadReplicaTx(func(tx *gorm.DB) error { + return tx.Table("rh_account"). + Where("valid_advisory_cache = FALSE"). + Order("hash_partition_id(id, 128), id"). + Pluck("id", &rhAccountIDs).Error }) + if skipNAccountsRefresh > 0 { + utils.LogInfo("n", skipNAccountsRefresh, "Skipping refresh of first N accounts") + rhAccountIDs = rhAccountIDs[skipNAccountsRefresh:] + } + utils.LogInfo("accounts", len(rhAccountIDs), "Starting advisory cache refresh for accounts") if err != nil { - utils.LogError("err", err.Error(), "Refreshed account advisory caches") - } else { - utils.LogInfo("Refreshed account advisory caches") + utils.LogError("err", err.Error(), "Unable to load rh_account table ids to refresh caches") + return + } + + // use max 4 goroutines for cache refresh + guard := make(chan struct{}, 4) + + for i, rhAccountID := range rhAccountIDs { + guard <- struct{}{} + wg.Add(1) + go func(i, rhAccountID int) { + defer func() { + <-guard + wg.Done() + }() + + err = tasks.WithTx(func(tx *gorm.DB) error { + utils.LogInfo("i", i, "rh_account_id", rhAccountID, "Refreshing account advisory cache") + return tx.Exec("select refresh_advisory_caches(NULL, ?)", rhAccountID).Error + }) + if err != nil { + utils.LogError("err", err.Error(), "rh_account_id", rhAccountID, + "Refreshed account advisory caches") + return + } + if err := updateAdvisoryCacheValidity(rhAccountID); err != nil { + utils.LogError("err", err.Error(), "rh_account_id", rhAccountID, "Refresh failed") + return + } + utils.LogInfo("i", i, "rh_account_id", rhAccountID, "Refreshed account advisory cache") + }(i, rhAccountID) } } + +func updateAdvisoryCacheValidity(accID int) error { + utils.LogDebug("Updating cache validity") + err := tasks.WithTx(func(tx *gorm.DB) error { + return tx.Table("rh_account"). + Where("valid_advisory_cache = ?", false). + Where("id = ?", accID). + Update("valid_advisory_cache", true).Error + }) + return errors.Wrap(err, "failed to update valid_advisory_cache") +} diff --git a/tasks/caches/refresh_advisory_caches_test.go b/tasks/caches/refresh_advisory_caches_test.go index fe59ef910..82f2343bb 100644 --- a/tasks/caches/refresh_advisory_caches_test.go +++ b/tasks/caches/refresh_advisory_caches_test.go @@ -5,6 +5,7 @@ import ( "app/base/database" "app/base/models" "app/base/utils" + "sync" "testing" "github.com/stretchr/testify/assert" @@ -23,7 +24,9 @@ func TestRefreshAdvisoryCachesPerAccounts(t *testing.T) { assert.Nil(t, database.Db.Model(&models.AdvisoryAccountData{}). Where("advisory_id = 3 AND rh_account_id = 1").Update("systems_installable", 8).Error) - refreshAdvisoryCachesPerAccounts() + var wg sync.WaitGroup + refreshAdvisoryCachesPerAccounts(&wg) + wg.Wait() assert.Equal(t, 1, database.PluckInt(database.Db.Table("advisory_account_data"). Where("advisory_id = 1 AND rh_account_id = 2"), "systems_installable")) diff --git a/tasks/caches/refresh_packages_caches.go b/tasks/caches/refresh_packages_caches.go index a02f865cf..6d21e8e8c 100644 --- a/tasks/caches/refresh_packages_caches.go +++ b/tasks/caches/refresh_packages_caches.go @@ -5,6 +5,7 @@ import ( "app/base/models" "app/base/utils" "app/tasks" + "time" "github.com/pkg/errors" @@ -44,20 +45,23 @@ func RefreshPackagesCaches(accID *int) error { continue } - if err = updateCacheValidity(&acc); err != nil { + if err = updatePkgCacheValidity(&acc); err != nil { utils.LogError("err", err.Error(), "Refresh failed") continue } + utils.LogDebug("account", acc, "#", i, "Cache refreshed") } return err } func accountsWithoutCache() ([]int, error) { + defer utils.ObserveSecondsSince(time.Now(), packageRefreshPartDuration.WithLabelValues("get-accounts")) + utils.LogDebug("Getting accounts with invalid cache") accs := []int{} // order account ids by partition number in system_package (128 partitions) // so that we read data sequentially and not jump from one partition to another and back - err := tasks.WithTx(func(tx *gorm.DB) error { + err := tasks.WithReadReplicaTx(func(tx *gorm.DB) error { return tx.Table("rh_account"). Select("id"). Where("valid_package_cache = FALSE"). @@ -68,13 +72,19 @@ func accountsWithoutCache() ([]int, error) { } func getCounts(pkgSysCounts *[]models.PackageAccountData, accID *int) error { - err := tasks.WithTx(func(tx *gorm.DB) error { + defer utils.ObserveSecondsSince(time.Now(), packageRefreshPartDuration.WithLabelValues("get-counts")) + utils.LogDebug("Getting counts of installable and applicable systems") + err := tasks.WithReadReplicaTx(func(tx *gorm.DB) error { + tx.Exec("SET work_mem TO '?'", utils.Cfg.DBWorkMem) + defer tx.Exec("RESET work_mem") + q := tx.Table("system_platform sp"). Select(` sp.rh_account_id rh_account_id, spkg.name_id package_name_id, - count(spkg.system_id) as systems_installed, - count(spkg.system_id) filter (where spkg.latest_evra IS NOT NULL) as systems_updatable + count(*) as systems_installed, + count(*) filter (where update_status(spkg.update_data) = 'Installable') as systems_installable, + count(*) filter (where update_status(spkg.update_data) != 'None') as systems_applicable `). Joins("JOIN system_package spkg ON sp.id = spkg.system_id AND sp.rh_account_id = spkg.rh_account_id"). Joins("JOIN rh_account acc ON sp.rh_account_id = acc.id"). @@ -83,8 +93,10 @@ func getCounts(pkgSysCounts *[]models.PackageAccountData, accID *int) error { Group("sp.rh_account_id, spkg.name_id"). Order("sp.rh_account_id, spkg.name_id") if accID != nil { + utils.LogDebug("Getting counts for single account") q.Where("sp.rh_account_id = ?", *accID) } else { + utils.LogDebug("Getting counts for multiple accounts") q.Where("acc.valid_package_cache = FALSE") } return q.Find(pkgSysCounts).Error @@ -93,16 +105,24 @@ func getCounts(pkgSysCounts *[]models.PackageAccountData, accID *int) error { } func updatePackageAccountData(pkgSysCounts []models.PackageAccountData) error { + defer utils.ObserveSecondsSince(time.Now(), packageRefreshPartDuration.WithLabelValues("update-package-account-data")) + utils.LogDebug("count", len(pkgSysCounts), "Inserting/updating package-account pairs") err := tasks.WithTx(func(tx *gorm.DB) error { - tx = database.OnConflictUpdateMulti( - tx, []string{"package_name_id", "rh_account_id"}, "systems_updatable", "systems_installed", - ) - return database.BulkInsert(tx, pkgSysCounts) + return database.UnnestInsert(tx, + "INSERT INTO package_account_data"+ + " (rh_account_id, package_name_id, systems_installed, systems_installable, systems_applicable)"+ + " (SELECT * FROM unnest($1::int[], $2::bigint[], $3::int[], $4::int[], $5::int[]))"+ + " ON CONFLICT (rh_account_id, package_name_id) DO UPDATE SET"+ + " systems_installable = EXCLUDED.systems_installable,"+ + " systems_applicable = EXCLUDED.systems_applicable,"+ + " systems_installed = EXCLUDED.systems_installed", pkgSysCounts) }) return errors.Wrap(err, "failed to insert to package_account_data") } func deleteOldCache(pkgSysCounts []models.PackageAccountData, accID *int) error { + defer utils.ObserveSecondsSince(time.Now(), packageRefreshPartDuration.WithLabelValues("delete-old-cache")) + utils.LogDebug("Deleting old packages from package_account_data") seen := make(map[int]bool, len(pkgSysCounts)) accs := make([]int, 0, len(pkgSysCounts)) pkgAcc := make([][]interface{}, 0, len(pkgSysCounts)) @@ -127,7 +147,9 @@ func deleteOldCache(pkgSysCounts []models.PackageAccountData, accID *int) error return errors.Wrap(err, "failed to insert to package_account_data") } -func updateCacheValidity(accID *int) error { +func updatePkgCacheValidity(accID *int) error { + defer utils.ObserveSecondsSince(time.Now(), packageRefreshPartDuration.WithLabelValues("update-validity")) + utils.LogDebug("Updating cache validity") err := tasks.WithTx(func(tx *gorm.DB) error { tx = tx.Table("rh_account acc"). Where("valid_package_cache = ?", false) diff --git a/tasks/caches/refresh_packages_caches_test.go b/tasks/caches/refresh_packages_caches_test.go new file mode 100644 index 000000000..05509d49f --- /dev/null +++ b/tasks/caches/refresh_packages_caches_test.go @@ -0,0 +1,61 @@ +package caches + +import ( + "app/base/core" + "app/base/database" + "app/base/models" + "app/base/utils" + "testing" + + "github.com/stretchr/testify/assert" +) + +// save counts from getCounts as global for other tests +var ( + _counts = make([]models.PackageAccountData, 0) + _acc = 3 +) + +func TestAccountsWithoutCache(t *testing.T) { + utils.SkipWithoutDB(t) + core.SetupTestEnvironment() + + accs, err := accountsWithoutCache() + assert.Nil(t, err) + // there are only 4 account in test_data but other tests are creating new accounts + assert.Equal(t, 10, len(accs)) +} + +func TestGetCounts(t *testing.T) { + utils.SkipWithoutDB(t) + core.SetupTestEnvironment() + + err := getCounts(&_counts, &_acc) + assert.Nil(t, err) + assert.Equal(t, 4, len(_counts)) +} + +func TestUpdatePackageAccountData(t *testing.T) { + utils.SkipWithoutDB(t) + core.SetupTestEnvironment() + + err := updatePackageAccountData(_counts) + assert.Nil(t, err) + + // delete old cache data, just check it does not return error + err = deleteOldCache(_counts, &_acc) + assert.Nil(t, err) +} + +func TestUpdatePkgCacheValidity(t *testing.T) { + utils.SkipWithoutDB(t) + core.SetupTestEnvironment() + + err := updatePkgCacheValidity(&_acc) + assert.Nil(t, err) + + // set back to false + database.Db.Table("rh_account"). + Where("id = ?", _acc). + Update("valid_package_cache = ?", false) +} diff --git a/tasks/common.go b/tasks/common.go index 51afcbd3d..2c1d54e8f 100644 --- a/tasks/common.go +++ b/tasks/common.go @@ -30,12 +30,30 @@ func CancelableDB() *gorm.DB { return database.Db.WithContext(base.Context) } -// Need to run code within a function, because defer can't be used in loops -func WithTx(do func(db *gorm.DB) error) error { - tx := CancelableDB().Begin() +// return read replica (if available) database handler with base context +// which will be properly canceled in case of service shutdown +func CancelableReadReplicaDB() *gorm.DB { + if utils.Cfg.DBReadReplicaEnabled && database.ReadReplicaConfigured() { + return database.DbReadReplica.WithContext(base.Context) + } + return database.Db.WithContext(base.Context) +} + +func withTx(do func(db *gorm.DB) error, cancelableDB func() *gorm.DB) error { + tx := cancelableDB().Begin() defer tx.Rollback() if err := do(tx); err != nil { return err } return errors.Wrap(tx.Commit().Error, "Commit") } + +// Need to run code within a function, because defer can't be used in loops +func WithTx(do func(db *gorm.DB) error) error { + return withTx(do, CancelableDB) +} + +// Need to run code within a function, because defer can't be used in loops +func WithReadReplicaTx(do func(db *gorm.DB) error) error { + return withTx(do, CancelableReadReplicaDB) +} diff --git a/tasks/system_culling/system_culling_test.go b/tasks/system_culling/system_culling_test.go index 1470d3eb9..1d395715f 100644 --- a/tasks/system_culling/system_culling_test.go +++ b/tasks/system_culling/system_culling_test.go @@ -90,7 +90,7 @@ func TestMarkSystemsStale(t *testing.T) { } nMarked, err := markSystemsStale(database.Db, 500) assert.Nil(t, err) - assert.Equal(t, 15, nMarked) + assert.Equal(t, 16, nMarked) assert.NoError(t, database.Db.Find(&systems).Error) for i, s := range systems { diff --git a/tasks/vmaas_sync/dbchange.go b/tasks/vmaas_sync/dbchange.go index 58ee26493..8ddc29dc3 100644 --- a/tasks/vmaas_sync/dbchange.go +++ b/tasks/vmaas_sync/dbchange.go @@ -10,7 +10,7 @@ import ( "github.com/pkg/errors" ) -func isSyncNeeded(dbExportedTS *types.Rfc3339TimestampWithZ, vmaasExportedTS *types.Rfc3339TimestampNoT) bool { +func isSyncNeeded(dbExportedTS *types.Rfc3339TimestampWithZ, vmaasExportedTS *types.Rfc3339Timestamp) bool { if dbExportedTS == nil || vmaasExportedTS == nil { return true } @@ -38,7 +38,7 @@ func vmaasDBChangeRequest() (*vmaas.DBChangeResponse, error) { return vmaasDataPtr.(*vmaas.DBChangeResponse), nil } -func VmaasDBExported() *types.Rfc3339TimestampNoT { +func VmaasDBExported() *types.Rfc3339Timestamp { dbchange, err := vmaasDBChangeRequest() if err != nil { utils.LogError("err", err, "Could'n query vmaas dbchange") diff --git a/tasks/vmaas_sync/metrics_test.go b/tasks/vmaas_sync/metrics_test.go index 0297793ae..3356cbf43 100644 --- a/tasks/vmaas_sync/metrics_test.go +++ b/tasks/vmaas_sync/metrics_test.go @@ -29,7 +29,7 @@ func TestSystemsCounts(t *testing.T) { assert.Equal(t, 2, counts[systemsCntLabels{staleOff, lastUploadLast1D}]) assert.Equal(t, 5, counts[systemsCntLabels{staleOff, lastUploadLast7D}]) assert.Equal(t, 8, counts[systemsCntLabels{staleOff, lastUploadLast30D}]) - assert.Equal(t, 15, counts[systemsCntLabels{staleOff, lastUploadAll}]) + assert.Equal(t, 16, counts[systemsCntLabels{staleOff, lastUploadAll}]) assert.Equal(t, 0, counts[systemsCntLabels{staleOn, lastUploadLast1D}]) assert.Equal(t, 0, counts[systemsCntLabels{staleOn, lastUploadLast7D}]) assert.Equal(t, 0, counts[systemsCntLabels{staleOn, lastUploadLast30D}]) diff --git a/tasks/vmaas_sync/vmaas_sync.go b/tasks/vmaas_sync/vmaas_sync.go index 99c8317d3..ad3a383f3 100644 --- a/tasks/vmaas_sync/vmaas_sync.go +++ b/tasks/vmaas_sync/vmaas_sync.go @@ -100,7 +100,7 @@ func GetLastSync(key string) *types.Rfc3339TimestampWithZ { return ts } -func SyncData(lastModifiedTS *types.Rfc3339TimestampWithZ, vmaasExportedTS *types.Rfc3339TimestampNoT) error { +func SyncData(lastModifiedTS *types.Rfc3339TimestampWithZ, vmaasExportedTS *types.Rfc3339Timestamp) error { utils.LogInfo("Data sync started") syncStart := time.Now() defer utils.ObserveSecondsSince(syncStart, syncDuration) diff --git a/turnpike/controllers/admin.go b/turnpike/controllers/admin.go index 93c03e4b2..599bc1461 100644 --- a/turnpike/controllers/admin.go +++ b/turnpike/controllers/admin.go @@ -6,8 +6,10 @@ import ( "app/tasks/caches" sync "app/tasks/vmaas_sync" "fmt" + "io" "net/http" "strconv" + "time" "github.com/gin-gonic/gin" ) @@ -195,3 +197,92 @@ func TerminateSessionHandler(c *gin.Context) { c.JSON(http.StatusOK, fmt.Sprintf("pid: %s terminated", param)) } + +// @Summary Get profile info +// @Description Get profile info +// @ID getEvaluatorUploadPprof +// @Security RhIdentity +// @Produce application/octet-stream +// @Param param path string false "What to profile" SchemaExample(profile) +// @Success 200 +// @Failure 500 {object} map[string]interface{} +// @Router /pprof/evaluator_upload/{param} [get] +func GetEvaluatorUploadPprof(c *gin.Context) { + pprofHandler(c, utils.Cfg.EvaluatorUploadPrivateAddress) +} + +// @Summary Get profile info +// @Description Get profile info +// @ID getEvaluatorRecalcPprof +// @Security RhIdentity +// @Produce application/octet-stream +// @Param param path string false "What to profile" SchemaExample(profile) +// @Success 200 +// @Failure 500 {object} map[string]interface{} +// @Router /pprof/evaluator_recalc/{param} [get] +func GetEvaluatorRecalcPprof(c *gin.Context) { + pprofHandler(c, utils.Cfg.EvaluatorRecalcPrivateAddress) +} + +// @Summary Get profile info +// @Description Get profile info +// @ID getListenerPprof +// @Security RhIdentity +// @Produce application/octet-stream +// @Param param path string false "What to profile" SchemaExample(profile) +// @Success 200 +// @Failure 500 {object} map[string]interface{} +// @Router /pprof/listener/{param} [get] +func GetListenerPprof(c *gin.Context) { + pprofHandler(c, utils.Cfg.ListenerPrivateAddress) +} + +// @Summary Get profile info +// @Description Get profile info +// @ID getManagerPprof +// @Security RhIdentity +// @Produce application/octet-stream +// @Param param path string false "What to profile" SchemaExample(profile) +// @Success 200 +// @Failure 500 {object} map[string]interface{} +// @Router /pprof/manager/{param} [get] +func GetManagerPprof(c *gin.Context) { + pprofHandler(c, utils.Cfg.ManagerPrivateAddress) +} + +func pprofHandler(c *gin.Context, address string) { + query := c.Request.URL.RawQuery + param := c.Param("param") + data, err := getPprof(address, param, query) + if err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"err": err.Error()}) + return + } + c.Header("Content-Disposition", fmt.Sprintf("attachment; filename=%s", param)) + c.Data(http.StatusOK, "application/octet-stream", data) +} + +func getPprof(address, param, query string) ([]byte, error) { + client := &http.Client{ + Timeout: time.Second * 60, + } + if len(query) > 0 { + param = param + "?" + query + } + urlPath := fmt.Sprintf("%s/debug/pprof/%s", address, param) + req, err := http.NewRequest(http.MethodGet, urlPath, nil) + if err != nil { + return nil, err + } + res, err := client.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + + resBody, err := io.ReadAll(res.Body) + if err != nil { + return nil, err + } + return resBody, nil +}