Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ mocks: mockery mocks-clean ## 🪄 Generate mocks
.PHONY: manifests
manifests: controller-gen ## 🪄 Clean mocks
$(CONTROLLER_GEN) rbac:roleName=rig crd webhook \
paths="./pkg/api/..." \
output:dir=deploy/kustomize \
paths="./pkg/api/...;./internal/controller" \
output:rbac:dir=deploy/kustomize/rbac \
output:webhook:dir=deploy/kustomize/webhook \
output:crd:dir=deploy/kustomize/crd/bases

Expand All @@ -81,17 +81,15 @@ test-all: gotestsum setup-envtest ## ✅ Run all tests
KUBEBUILDER_ASSETS="$(shell $(SETUP_ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(TOOLSBIN) -p path)" \
$(GOTESTSUM) \
--format-hide-empty-pkg \
--junitfile test-result.xml && \
killall etcd || true
--junitfile test-result.xml

.PHONY: test-integration
test-integration: gotestsum setup-envtest ## ✅ Run integration tests
KUBEBUILDER_ASSETS="$(shell $(SETUP_ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(TOOLSBIN) -p path)" && \
$(GOTESTSUM) \
--format-hide-empty-pkg \
--junitfile test-result.xml -- \
-run "^TestIntegration" ./... && \
killall etcd || true
-run "^TestIntegration" ./...

TAG ?= dev

Expand All @@ -108,6 +106,7 @@ deploy: ## 🚀 Deploy to k8s context defined by $KUBECTX (default: kind-rig)
$(HELM) upgrade --install rig-operator ./deploy/charts/rig-operator \
--namespace rig-system \
--set image.tag=$(TAG) \
--set config.devModeEnabled=true \
--create-namespace

deploy-platform: ## 🚀 Deploy to platform to k8s defined by $KUBECTX (default: kind-rig)
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/rig-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
version: 0.1.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
6 changes: 5 additions & 1 deletion deploy/charts/rig-operator/templates/_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ Render configfile
{{- define "rig-operator.config" -}}
apiVersion: config.rig.dev/v1alpha1
kind: OperatorConfig

webhooksEnabled: {{ .Values.config.webhooksEnabled }}
devModeEnabled: {{ .Values.config.devModeEnabled }}
leaderElectionEnabled: {{ .Values.config.leaderElectionEnabled }}
{{- if .Values.config.certManager.clusterIssuer }}
certManager:
clusterIssuer: {{ .Values.config.certManager.clusterIssuer | quote }}
createCertificateResources: {{ .Values.config.certManager.createCertificateResources }}
{{- end }}
{{- end }}
86 changes: 71 additions & 15 deletions deploy/charts/rig-operator/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,89 @@ metadata:
labels: {{ include "rig-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
- ""
resources:
- services
- services
verbs:
- "*"
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
- apps
resources:
- deployments
- deployments
verbs:
- "*"
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- networking.k8s.io
- autoscaling
resources:
- ingresses
- horizontalpodautoscalers
verbs:
- "*"
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- rig.dev
- cert-manager.io
resources:
- capsules
- certificates
verbs:
- "*"
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- autoscaling
- networking.k8s.io
resources:
- horizontalpodautoscalers
- ingresses
verbs:
- "*"
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- rig.dev
resources:
- capsules
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- rig.dev
resources:
- capsules/finalizers
verbs:
- update
- apiGroups:
- rig.dev
resources:
- capsules/status
verbs:
- get
- patch
- update
{{- end -}}
3 changes: 3 additions & 0 deletions deploy/charts/rig-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ config:
webhooksEnabled: true
devModeEnabled: false
leaderElectionEnabled: true
certManager:
clusterIssuer: ""
createCertificateResources: false

replicaCount: 1

Expand Down
70 changes: 36 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/distribution/distribution/v3 v3.0.0-20230601133803-97b1d649c493
github.com/docker/docker v24.0.2+incompatible
github.com/docker/go-connections v0.4.0
github.com/google/uuid v1.3.0
github.com/google/uuid v1.3.1
github.com/lucasepe/codename v0.2.0
github.com/mailjet/mailjet-apiv3-go v0.0.0-20201009050126-c24bc15a9394
github.com/minio/minio-go/v7 v7.0.52
Expand All @@ -22,7 +22,7 @@ require (
github.com/segmentio/analytics-go/v3 v3.2.1
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.2
github.com/stretchr/testify v1.8.4
github.com/twilio/twilio-go v1.7.1
github.com/uptrace/bun v1.1.13
github.com/uptrace/bun/dialect/pgdialect v1.1.13
Expand All @@ -31,12 +31,12 @@ require (
go.uber.org/fx v1.19.3
go.uber.org/zap v1.25.0
go4.org v0.0.0-20230225012048-214862532bf5
golang.org/x/crypto v0.11.0
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
golang.org/x/oauth2 v0.8.0
golang.org/x/crypto v0.13.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
golang.org/x/oauth2 v0.12.0
golang.org/x/sync v0.3.0
google.golang.org/api v0.122.0
google.golang.org/grpc v1.55.0
google.golang.org/api v0.140.0
google.golang.org/grpc v1.57.0
google.golang.org/protobuf v1.31.0
inet.af/tcpproxy v0.0.0-20221017015627-91f861402626
k8s.io/api v0.28.1
Expand All @@ -46,6 +46,7 @@ require (

require (
firebase.google.com/go v3.13.0+incompatible
github.com/cert-manager/cert-manager v1.13.1
github.com/erikgeiser/promptkit v0.9.0
github.com/fatih/color v1.15.0
github.com/go-chi/chi/v5 v5.0.10
Expand All @@ -55,14 +56,15 @@ require (
github.com/lithammer/fuzzysearch v1.1.8
github.com/rigdev/rig-go-api v0.0.0-20231002140905-118e2e6c7793
github.com/rigdev/rig-go-sdk v0.0.0-20230918110956-2301fcd9da11
github.com/rodaine/table v1.1.0
k8s.io/metrics v0.28.0
sigs.k8s.io/controller-runtime v0.16.1
sigs.k8s.io/kind v0.20.0
)

require (
cloud.google.com/go/firestore v1.9.0 // indirect
cloud.google.com/go/longrunning v0.4.1 // indirect
cloud.google.com/go/firestore v1.11.0 // indirect
cloud.google.com/go/longrunning v0.5.1 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/alessio/shellescape v1.4.1 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
Expand Down Expand Up @@ -90,22 +92,22 @@ require (
github.com/muesli/termenv v0.15.2 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rodaine/table v1.1.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/vbatts/tar-split v0.11.3 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230911183012-2d3300fd4832 // indirect
gotest.tools/v3 v3.4.0 // indirect
k8s.io/apiextensions-apiserver v0.28.0 // indirect
k8s.io/apiextensions-apiserver v0.28.1 // indirect
k8s.io/component-base v0.28.1 // indirect
sigs.k8s.io/gateway-api v0.8.0 // indirect
)

require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.19.3 // indirect
cloud.google.com/go v0.110.6 // indirect
cloud.google.com/go/compute v1.23.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.13.0 // indirect
cloud.google.com/go/iam v1.1.1 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Shopify/logrus-bugsnag v0.0.0-20230117174420-439a4b8ba167 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
Expand All @@ -124,14 +126,14 @@ require (
github.com/bugsnag/bugsnag-go/v2 v2.2.0 // indirect
github.com/bugsnag/panicwrap v1.3.4 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/docker/distribution v2.8.2+incompatible
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-jose/go-jose/v3 v3.0.0 // indirect
Expand All @@ -145,9 +147,9 @@ require (
github.com/gomodule/redigo v1.8.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.3 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.8.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
Expand All @@ -159,7 +161,7 @@ require (
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/go-digest v1.0.0
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
Expand All @@ -169,28 +171,28 @@ require (
github.com/yvasiyarov/gorelic v0.0.7 // indirect
github.com/yvasiyarov/newrelic_platform_go v0.0.0-20160601141957-9c099fbc30e9 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.10.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/kube-openapi v0.0.0-20230905202853-d090da108d2f // indirect
mellium.im/sasl v0.3.1 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

require (
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.16.5 // indirect
Expand All @@ -205,7 +207,7 @@ require (
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/sirupsen/logrus v1.9.2 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
Expand All @@ -221,10 +223,10 @@ require (
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/dig v1.17.0
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.13.0
golang.org/x/sys v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/net v0.15.0
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1
k8s.io/utils v0.0.0-20230505201702-9f6742963106
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
)
Loading