Skip to content

Commit

Permalink
Merge branch 'master' into PROJQUAY-2417
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelalang committed Sep 17, 2024
2 parents a995ef0 + a9caf35 commit 4ee2b81
Show file tree
Hide file tree
Showing 126 changed files with 6,051 additions and 1,940 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM quay.io/projectquay/golang:1.20 as builder
FROM --platform=$BUILDPLATFORM quay.io/projectquay/golang:1.21 as builder

ARG TARGETOS TARGETARCH
WORKDIR /workspace
Expand Down
5 changes: 5 additions & 0 deletions apis/quay/v1/quayregistry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"

quaycontext "github.com/quay/quay-operator/pkg/context"
Expand Down Expand Up @@ -762,6 +763,10 @@ func GetReplicasOverrideForComponent(quay *QuayRegistry, kind ComponentKind) *in
}

if cmp.Overrides == nil {
return ptr.To[int32](2)
}

if cmp.Overrides.Replicas == nil {
return nil
}

Expand Down
849 changes: 348 additions & 501 deletions bundle/manifests/quayregistries.crd.yaml

Large diffs are not rendered by default.

849 changes: 348 additions & 501 deletions config/crd/bases/quay.redhat.com_quayregistries.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion controllers/quay/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"crypto/tls"
"encoding/hex"
"encoding/pem"
err "errors"
"fmt"
"strings"
"time"
Expand Down Expand Up @@ -373,7 +374,7 @@ func (r *QuayRegistryReconciler) checkMonitoringAvailable(
if len(r.WatchNamespace) > 0 {
msg := "Monitoring is only supported in AllNamespaces mode. Disabling."
r.Log.Info(msg)
return fmt.Errorf(msg)
return err.New(msg)
}

var serviceMonitors prometheusv1.ServiceMonitorList
Expand Down
55 changes: 55 additions & 0 deletions docs/environment-overrides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Environment variables override

If you want to override environment variables for any component in the operator
deployment, you can do so by adding a `overrides:` section

example:

```
kind: QuayRegistry
metadata:
name: quay37
spec:
configBundleSecret: config-bundle-secret
components:
- kind: objectstorage
managed: false
- kind: route
managed: true
- kind: mirror
managed: true
overrides:
env:
- name: DEBUGLOG
value: "true"
- name: HTTP_PROXY
value: quayproxy.qe.devcluster.openshift.com:3128
- name: HTTPS_PROXY
value: quayproxy.qe.devcluster.openshift.com:3128
- name: NO_PROXY
value: svc.cluster.local,localhost,quay370.apps.quayperf370.perfscale.devcluster.openshift.com
- kind: tls
managed: false
- kind: clair
managed: true
overrides:
env:
- name: HTTP_PROXY
value: quayproxy.qe.devcluster.openshift.com:3128
- name: HTTPS_PROXY
value: quayproxy.qe.devcluster.openshift.com:3128
- name: NO_PROXY
value: svc.cluster.local,localhost,quay370.apps.quayperf370.perfscale.devcluster.openshift.com
- kind: quay
managed: true
overrides:
env:
- name: DEBUGLOG
value: "true"
- name: NO_PROXY
value: svc.cluster.local,localhost,quay370.apps.quayperf370.perfscale.devcluster.openshift.com
- name: HTTP_PROXY
value: quayproxy.qe.devcluster.openshift.com:3128
- name: HTTPS_PROXY
value: quayproxy.qe.devcluster.openshift.com:3128
```
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/quay/quay-operator

go 1.20
go 1.21

require (
github.com/go-logr/logr v1.4.1
Expand Down Expand Up @@ -65,13 +65,13 @@ require (
github.com/google/uuid v1.3.1 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.8.1 // indirect
github.com/jackc/pgconn v1.14.3 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.0.6 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.7.0 // indirect
github.com/jackc/pgx/v4 v4.11.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgtype v1.14.0 // indirect
github.com/jackc/pgx/v4 v4.18.2 // 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
Expand Down
45 changes: 36 additions & 9 deletions go.sum

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions pkg/kustomize/kustomize.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,13 @@ func KustomizationFor(
}

if ctx.NeedsPgUpgrade {
if v1.ComponentIsManaged(quay.Spec.Components, v1.ComponentClair) {
componentPaths = append(componentPaths, "../components/pgupgrade/scale-down-clair")
} else {
componentPaths = append(componentPaths, "../components/pgupgrade/base")
}
componentPaths = append(componentPaths, "../components/pgupgrade")
}
if ctx.NeedsClairPgUpgrade {
componentPaths = append(componentPaths, "../components/clairpgupgrade")
if v1.ComponentIsManaged(quay.Spec.Components, v1.ComponentClair) {
componentPaths = append(componentPaths, "../components/clairpgupgrade/scale-down-clair")
}
componentPaths = append(componentPaths, "../components/clairpgupgrade/base")
}

images := []types.Image{}
Expand Down
4 changes: 2 additions & 2 deletions pkg/kustomize/kustomize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ var kustomizationForTests = []struct {
"../components/clair",
"../components/redis",
"../components/postgres",
"../components/pgupgrade/scale-down-clair",
"../components/pgupgrade",
},
Images: []types.Image{
{Name: "quay.io/projectquay/quay", NewName: "quay", NewTag: "latest"},
Expand Down Expand Up @@ -224,7 +224,7 @@ var kustomizationForTests = []struct {
Components: []string{
"../components/redis",
"../components/postgres",
"../components/pgupgrade/base",
"../components/pgupgrade",
},
Images: []types.Image{
{Name: "quay.io/projectquay/quay", NewName: "quay", NewTag: "latest"},
Expand Down
6 changes: 2 additions & 4 deletions pkg/middleware/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/yaml"

Expand Down Expand Up @@ -122,12 +121,11 @@ func Process(quay *v1.QuayRegistry, qctx *quaycontext.QuayRegistryContext, obj c
// if no number of replicas has been set in kustomization files
// we set its value to two or to the value provided by the user
// as an override (if provided).
desired := ptr.To[int32](2)

if r := v1.GetReplicasOverrideForComponent(quay, kind); r != nil {
desired = r
dep.Spec.Replicas = r
}

dep.Spec.Replicas = desired
break
}
}
Expand Down
68 changes: 68 additions & 0 deletions vendor/github.com/jackc/pgconn/CHANGELOG.md

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

6 changes: 6 additions & 0 deletions vendor/github.com/jackc/pgconn/README.md

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

32 changes: 22 additions & 10 deletions vendor/github.com/jackc/pgconn/auth_scram.go

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

Loading

0 comments on commit 4ee2b81

Please sign in to comment.