Skip to content

Commit

Permalink
clair: Add clair advanced configuration and allow for unmanaged clair…
Browse files Browse the repository at this point in the history
… database (PROJQUAY-1696)

    - WIP
    - Users can specify a  in the  which will be consumed by Clair
    - Add a clairpostgres component
  • Loading branch information
Jonathan King authored and ricardomaraschini committed Feb 17, 2022
1 parent 0eee448 commit 5beecdc
Show file tree
Hide file tree
Showing 31 changed files with 1,015 additions and 308 deletions.
5 changes: 5 additions & 0 deletions apis/quay/v1/quayregistry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const (
ComponentBase ComponentKind = "base"
ComponentPostgres ComponentKind = "postgres"
ComponentClair ComponentKind = "clair"
ComponentClairPostgres ComponentKind = "clairpostgres"
ComponentRedis ComponentKind = "redis"
ComponentHPA ComponentKind = "horizontalpodautoscaler"
ComponentObjectStorage ComponentKind = "objectstorage"
Expand All @@ -60,6 +61,7 @@ var allComponents = []ComponentKind{
ComponentMirror,
ComponentMonitoring,
ComponentTLS,
ComponentClairPostgres,
}

var requiredComponents = []ComponentKind{
Expand Down Expand Up @@ -116,6 +118,7 @@ const (
ComponentBaseReady ConditionType = "ComponentBaseReady"
ComponentPostgresReady ConditionType = "ComponentPostgresReady"
ComponentClairReady ConditionType = "ComponentClairReady"
ComponentClairPostgresReady ConditionType = "ComponentClairPostgresReady"
ComponentRedisReady ConditionType = "ComponentRedisReady"
ComponentHPAReady ConditionType = "ComponentHPAReady"
ComponentObjectStorageReady ConditionType = "ComponentObjectStorageReady"
Expand Down Expand Up @@ -542,6 +545,8 @@ func FieldGroupNameFor(cmp ComponentKind) (string, error) {
return "SecurityScanner", nil
case ComponentPostgres:
return "Database", nil
case ComponentClairPostgres:
return "", nil
case ComponentRedis:
return "Redis", nil
case ComponentObjectStorage:
Expand Down
13 changes: 13 additions & 0 deletions apis/quay/v1/quayregistry_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var ensureDefaultComponentsTests = []struct {
{Kind: "postgres", Managed: true},
{Kind: "redis", Managed: true},
{Kind: "clair", Managed: true},
{Kind: "clairpostgres", Managed: true},
{Kind: "objectstorage", Managed: true},
{Kind: "route", Managed: true},
{Kind: "tls", Managed: true},
Expand All @@ -44,6 +45,7 @@ var ensureDefaultComponentsTests = []struct {
{Kind: "postgres", Managed: true},
{Kind: "redis", Managed: true},
{Kind: "clair", Managed: true},
{Kind: "clairpostgres", Managed: true},
{Kind: "objectstorage", Managed: true},
{Kind: "route", Managed: true},
{Kind: "tls", Managed: true},
Expand All @@ -61,6 +63,7 @@ var ensureDefaultComponentsTests = []struct {
{Kind: "postgres", Managed: true},
{Kind: "redis", Managed: true},
{Kind: "clair", Managed: true},
{Kind: "clairpostgres", Managed: true},
{Kind: "objectstorage", Managed: true},
{Kind: "route", Managed: true},
{Kind: "tls", Managed: true},
Expand All @@ -74,6 +77,7 @@ var ensureDefaultComponentsTests = []struct {
{Kind: "postgres", Managed: true},
{Kind: "redis", Managed: true},
{Kind: "clair", Managed: true},
{Kind: "clairpostgres", Managed: true},
{Kind: "objectstorage", Managed: true},
{Kind: "route", Managed: true},
{Kind: "tls", Managed: true},
Expand All @@ -90,6 +94,7 @@ var ensureDefaultComponentsTests = []struct {
{Kind: "postgres", Managed: true},
{Kind: "redis", Managed: true},
{Kind: "clair", Managed: true},
{Kind: "clairpostgres", Managed: true},
{Kind: "objectstorage", Managed: true},
{Kind: "route", Managed: true},
{Kind: "tls", Managed: true},
Expand All @@ -108,6 +113,7 @@ var ensureDefaultComponentsTests = []struct {
{Kind: "postgres", Managed: true},
{Kind: "redis", Managed: true},
{Kind: "clair", Managed: true},
{Kind: "clairpostgres", Managed: true},
{Kind: "objectstorage", Managed: true},
{Kind: "route", Managed: true},
{Kind: "tls", Managed: true},
Expand All @@ -125,6 +131,7 @@ var ensureDefaultComponentsTests = []struct {
{Kind: "postgres", Managed: true},
{Kind: "redis", Managed: true},
{Kind: "clair", Managed: true},
{Kind: "clairpostgres", Managed: true},
{Kind: "objectstorage", Managed: true},
{Kind: "route", Managed: false},
{Kind: "tls", Managed: true},
Expand All @@ -143,6 +150,7 @@ var ensureDefaultComponentsTests = []struct {
{Kind: "postgres", Managed: true},
{Kind: "redis", Managed: true},
{Kind: "clair", Managed: true},
{Kind: "clairpostgres", Managed: true},
{Kind: "objectstorage", Managed: true},
{Kind: "route", Managed: false},
{Kind: "tls", Managed: true},
Expand All @@ -162,6 +170,7 @@ var ensureDefaultComponentsTests = []struct {
{Kind: "postgres", Managed: true},
{Kind: "redis", Managed: true},
{Kind: "clair", Managed: true},
{Kind: "clairpostgres", Managed: true},
{Kind: "objectstorage", Managed: false},
{Kind: "route", Managed: false},
{Kind: "tls", Managed: false},
Expand All @@ -185,6 +194,7 @@ var ensureDefaultComponentsTests = []struct {
{Kind: "postgres", Managed: true},
{Kind: "redis", Managed: true},
{Kind: "clair", Managed: true},
{Kind: "clairpostgres", Managed: true},
{Kind: "objectstorage", Managed: false},
{Kind: "route", Managed: true},
{Kind: "tls", Managed: true},
Expand All @@ -210,6 +220,7 @@ var ensureDefaultComponentsTests = []struct {
{Kind: "postgres", Managed: false},
{Kind: "redis", Managed: true},
{Kind: "clair", Managed: true},
{Kind: "clairpostgres", Managed: true},
{Kind: "objectstorage", Managed: false},
{Kind: "route", Managed: false},
{Kind: "tls", Managed: false},
Expand Down Expand Up @@ -239,6 +250,7 @@ var ensureDefaultComponentsTests = []struct {
{Kind: "postgres", Managed: false},
{Kind: "redis", Managed: true},
{Kind: "clair", Managed: true},
{Kind: "clairpostgres", Managed: true},
{Kind: "objectstorage", Managed: false},
{Kind: "route", Managed: false},
{Kind: "tls", Managed: true},
Expand Down Expand Up @@ -270,6 +282,7 @@ var ensureDefaultComponentsTests = []struct {
{Kind: "postgres", Managed: false},
{Kind: "redis", Managed: true},
{Kind: "clair", Managed: true},
{Kind: "clairpostgres", Managed: true},
{Kind: "objectstorage", Managed: false},
{Kind: "route", Managed: false},
{Kind: "tls", Managed: false},
Expand Down
30 changes: 29 additions & 1 deletion apis/quay/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apis/redhatcop/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5beecdc

Please sign in to comment.