Skip to content

Commit

Permalink
Merge pull request #37 from abays/def_imgs_via_webhooks
Browse files Browse the repository at this point in the history
Webhook for default images
  • Loading branch information
openshift-merge-robot authored Apr 10, 2023
2 parents 8b93b56 + fb19fcb commit f73c095
Show file tree
Hide file tree
Showing 32 changed files with 1,018 additions and 22 deletions.
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ build: generate fmt vet ## Build manager binary.
go build -o bin/manager main.go

.PHONY: run
run: export ENABLE_WEBHOOKS?=false
run: manifests generate fmt vet ## Run a controller from your host.
/bin/bash hack/clean_local_webhook.sh
go run ./main.go

.PHONY: docker-build
Expand Down Expand Up @@ -310,3 +312,20 @@ gowork: ## Generate go.work file to support our multi module repository
operator-lint: gowork ## Runs operator-lint
GOBIN=$(LOCALBIN) go install github.com/gibizer/[email protected]
go vet -vettool=$(LOCALBIN)/operator-lint ./... ./api/...

# Used for webhook testing
# Please ensure the ovn-controller-manager deployment and
# webhook definitions are removed from the csv before running
# this. Also, cleanup the webhook configuration for local testing
# before deplying with olm again.
# $oc delete validatingwebhookconfiguration/vovndbcluster.kb.io
# $oc delete mutatingwebhookconfiguration/movndbcluster.kb.io
# $oc delete validatingwebhookconfiguration/vovnnorthd.kb.io
# $oc delete mutatingwebhookconfiguration/movnnorthd.kb.io
SKIP_CERT ?=false
.PHONY: run-with-webhook
run-with-webhook: export OVN_DBCLUSTER_IMAGE_URL_DEFAULT=quay.io/tripleozedcentos9/openstack-ovn-nb-db-server:current-tripleo
run-with-webhook: export OVN_NORTHD_IMAGE_URL_DEFAULT=quay.io/tripleozedcentos9/openstack-ovn-northd:current-tripleo
run-with-webhook: manifests generate fmt vet ## Run a controller from your host.
/bin/bash hack/configure_local_webhook.sh
go run ./main.go
8 changes: 8 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ resources:
kind: OVNNorthd
path: github.com/openstack-k8s-operators/ovn-operator/api/v1beta1
version: v1beta1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
Expand All @@ -52,4 +56,8 @@ resources:
kind: OVNDBCluster
path: github.com/openstack-k8s-operators/ovn-operator/api/v1beta1
version: v1beta1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
version: "3"
4 changes: 3 additions & 1 deletion api/bases/ovn.openstack.org_ovndbclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ spec:
description: OVNDBClusterSpec defines the desired state of OVNDBCluster
properties:
containerImage:
default: quay.io/tripleozedcentos9/openstack-ovn-nb-db-server:current-tripleo
description: ContainerImage - Container Image URL (will be set to
environmental default if empty)
type: string
dbType:
default: NB
Expand Down Expand Up @@ -129,6 +130,7 @@ spec:
description: StorageRequest
type: string
required:
- containerImage
- dbType
- storageRequest
type: object
Expand Down
5 changes: 4 additions & 1 deletion api/bases/ovn.openstack.org_ovnnorthds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ spec:
description: OVNNorthdSpec defines the desired state of OVNNorthd
properties:
containerImage:
default: quay.io/tripleozedcentos9/openstack-ovn-northd:current-tripleo
description: ContainerImage - Container Image URL (will be set to
environmental default if empty)
type: string
logLevel:
default: info
Expand Down Expand Up @@ -100,6 +101,8 @@ spec:
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
required:
- containerImage
type: object
status:
description: OVNNorthdStatus defines the observed state of OVNNorthd
Expand Down
23 changes: 22 additions & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,66 @@ go 1.19

require (
github.com/go-logr/logr v1.2.3
github.com/onsi/ginkgo/v2 v2.5.0
github.com/onsi/gomega v1.24.1
github.com/openstack-k8s-operators/lib-common/modules/common v0.0.0-20230220103808-bd9bda2ad709
k8s.io/api v0.25.4
k8s.io/apimachinery v0.25.4
k8s.io/client-go v0.25.4
sigs.k8s.io/controller-runtime v0.13.1
)

require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/term v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/client-go v0.25.4 // indirect
k8s.io/apiextensions-apiserver v0.25.0 // indirect
k8s.io/component-base v0.25.0 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
Expand Down
Loading

0 comments on commit f73c095

Please sign in to comment.