Skip to content
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
2 changes: 1 addition & 1 deletion .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: tools
namespace: openstack-k8s-operators
tag: ci-build-root-golang-1.24-sdk-1.31
tag: ci-build-root-golang-1.24-sdk-1.41.1
2 changes: 1 addition & 1 deletion .github/workflows/build-watcher-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
operator_name: watcher
go_version: 1.24.x
operator_sdk_version: 1.31.0
operator_sdk_version: 1.41.1
secrets:
IMAGENAMESPACE: ${{ secrets.IMAGENAMESPACE }}
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/force-bump-pr-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
with:
operator_name: watcher
branch_name: ${{ github.ref_name }}
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.31
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.41.1
secrets:
FORCE_BUMP_PULL_REQUEST_PAT: ${{ secrets.FORCE_BUMP_PULL_REQUEST_PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/force-bump-pr-scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
uses: openstack-k8s-operators/openstack-k8s-operators-ci/.github/workflows/force-bump-branches.yaml@main
with:
operator_name: watcher
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.31
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.41.1
secrets:
FORCE_BUMP_PULL_REQUEST_PAT: ${{ secrets.FORCE_BUMP_PULL_REQUEST_PAT }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ repos:
# E012: here doc didn't end before EOF

- repo: https://github.com/golangci/golangci-lint
rev: v2.4.0
rev: v2.6.1
hooks:
- id: golangci-lint-full
args: ["-v"]
Expand Down
2 changes: 2 additions & 0 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
A zuul job building content from OpenDev epoxy release.
parent: openstack-meta-content-provider
vars:
cifmw_install_yamls_sdk_version: v1.41.1
cifmw_bop_openstack_release: epoxy
cifmw_bop_dlrn_baseurl: "https://trunk.rdoproject.org/centos9-epoxy"
cifmw_repo_setup_branch: epoxy
Expand Down Expand Up @@ -208,6 +209,7 @@
nodeset: centos-stream-10-vexxhost
parent: openstack-meta-content-provider
vars:
cifmw_install_yamls_sdk_version: v1.41.1
cifmw_bop_openstack_release: master
cifmw_bop_dlrn_baseurl: "https://trunk.rdoproject.org/centos10-master"
cifmw_repo_setup_branch: master
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN mkdir -p ${DEST_ROOT}/usr/local/bin/
RUN if [ ! -f $CACHITO_ENV_FILE ]; then go mod download ; fi

# Build manager
RUN if [ -f $CACHITO_ENV_FILE ] ; then source $CACHITO_ENV_FILE ; fi ; env ${GO_BUILD_EXTRA_ENV_ARGS} go build ${GO_BUILD_EXTRA_ARGS} -a -o ${DEST_ROOT}/manager main.go
RUN if [ -f $CACHITO_ENV_FILE ] ; then source $CACHITO_ENV_FILE ; fi ; env ${GO_BUILD_EXTRA_ENV_ARGS} go build ${GO_BUILD_EXTRA_ARGS} -a -o ${DEST_ROOT}/manager cmd/main.go


RUN cp -r templates ${DEST_ROOT}/templates
Expand Down
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ endif

# Set the Operator SDK version to use. By default, what is installed on the system is used.
# This is useful for CI or a project to utilize a specific version of the operator-sdk toolkit.
OPERATOR_SDK_VERSION ?= v1.31.0
OPERATOR_SDK_VERSION ?= v1.41.1

# Image URL to use all building/pushing image targets
DEFAULT_IMG ?= quay.io/openstack-k8s-operators/watcher-operator:latest
Expand Down Expand Up @@ -146,22 +146,22 @@ PROC_CMD = --procs ${PROCS}
.PHONY: test
test: manifests generate fmt vet envtest ginkgo ## Run tests.
OPERATOR_TEMPLATES="$(PWD)/templates" \
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) --trace --cover --coverpkg=../../pkg/watcher,../../controllers,../../api/v1beta1 --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS) ./tests/...
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) --trace --cover --coverpkg=../../internal/watcher,../../internal/controller,../../api/v1beta1 --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS) ./test/...


##@ Build

.PHONY: build
build: generate fmt vet ## Build manager binary.
go build -o bin/manager main.go
go build -o bin/manager cmd/main.go

.PHONY: run
run: export METRICS_PORT?=24604
run: export HEALTH_PORT?=24605
run: export PPROF_PORT?=8082
run: export ENABLE_WEBHOOKS?=false
run: manifests generate fmt vet ## Run a controller from your host.
go run ./main.go -metrics-bind-address ":$(METRICS_PORT)" -health-probe-bind-address ":$(HEALTH_PORT)" -pprof-bind-address ":$(PPROF_PORT)"
go run ./cmd/main.go -metrics-bind-address ":$(METRICS_PORT)" -health-probe-bind-address ":$(HEALTH_PORT)" -pprof-bind-address ":$(PPROF_PORT)"


# Extra vars which will be passed to the Docker-build
Expand Down Expand Up @@ -212,7 +212,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
GINKGO ?= $(LOCALBIN)/ginkgo

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
KUSTOMIZE_VERSION ?= v5.6.0
CONTROLLER_TOOLS_VERSION ?= v0.18.0
SETUP_ENVTEST_VERSION ?= release-0.22

Expand Down Expand Up @@ -391,6 +391,10 @@ watcher: export WATCHER_DECISION_ENGINE_IMAGE=${WATCHER_DECISION_ENGINE_CI_IMAGE
watcher: export WATCHER_APPLIER_IMAGE=${WATCHER_APPLIER_CI_IMAGE}
watcher: export CATALOG_IMG=${CATALOG_IMAGE}
watcher: ## Install watcher operator via olm
# explicitly to delete any running watcher-operator deployments from openstack-operator here as
# label selectors can change and installing a service catalog/index like this alongside
# openstack-operator (what CI appears to do?) is not recommended
oc delete deployment watcher-operator-controller-manager -n openstack-operators --ignore-not-found=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there might be something not ok with this?

https://logserver.rdoproject.org/4ac/rdoproject.org/4acc5473759d42f0921e1e821b339e91/controller/ci-framework-data/logs/openstack-must-gather/quay-io-openstack-k8s-operators-openstack-must-gather-sha256-ae4a20d9aad04cfaeaa3105fa8e37db4216c3b17530bc98daf1204555bc23485/namespaces/openstack-operators/events.log

63s         Warning   InstallComponentFailed   clusterserviceversion/watcher-operator.v0.0.1                           install strategy failed: Deployment.apps "watcher-operator-controller-manager" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/name":"watcher-operator", "control-plane":"controller-manager"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
61s         Normal    NeedsReinstall           clusterserviceversion/watcher-operator.v0.0.1                           calculated deployment install is bad

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, we should apply a patch on the openstack CR instead of current csv patch here?

https://github.com/openstack-k8s-operators/watcher-operator/blob/main/hack/stop_integrated_watcher.sh#L9-L10

A patch like:

spec:
  operatorOverrides:
  - name: watcher
    replicas: 0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could use that interface to schedule down the watcher controller manager, but I don't think that will help for this issue. iiuc the issue is that our initialization resource controller manager is still up and would recreate the watcher deployment. In the must-gather we see the owners reference. The one which then gets created via installing the standalone deployment differs and therefore can not be created/updated.
I think what we should probably do is after patching the csv is to wait that the openstack-operator-controller-operator is down. This will prevent that we proceed and the deployment gets re-created by the operator when we delete it here.

Copy link
Contributor

@amoralej amoralej Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So adding something like:

timeout 300s bash -c "while (oc get pods -n openstack-operators -l "control-plane=openstack-operator-controller-operator" -o name | grep pod); do sleep 10; done"

In https://github.com/openstack-k8s-operators/watcher-operator/blob/main/hack/stop_integrated_watcher.sh#L10

right?

BTW, we may do the oc delete deployment watcher-operator-controller-manager there instead of scaling down the deployment I guess

Copy link
Contributor

@stuggi stuggi Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general yes, we just need to check on the labels when @dprince is back, because it seems the changed in a a way in the openstack-operator that there is no stable label from before and after the bump:

before sdk bump:

Name:             openstack-operator-controller-operator-6fb954458d-m8lxm
Namespace:        openstack-operators
Priority:         0
Service Account:  openstack-operator-controller-operator
Node:             oko-18-v7k45-master-1/10.0.2.235
Start Time:       Fri, 14 Nov 2025 06:35:56 +0000
Labels:           control-plane=openstack-operator-controller-operator
                  openstack.org/operator-name=openstack-controller
                  pod-template-hash=6fb954458d

(just for reference taken from kuttl prow job on openstack-k8s-operators/openstack-operator#1692)

after sdk bump:

Name:             openstack-operator-controller-operator-5d588c95cc-vdcns
Namespace:        openstack-operators
Priority:         0
Service Account:  openstack-operator-controller-operator
Node:             crc/192.168.126.11
Start Time:       Wed, 26 Nov 2025 10:51:27 +0000
Labels:           app.kubernetes.io/name=openstack-operator-controller-operator
                  control-plane=controller-manager
                  openstack.org/operator-name=openstack-init
                  pod-template-hash=5d588c95cc

bash ci/olm.sh
oc apply -f ci/olm.yaml
timeout 300s bash -c "while ! (oc get csv -n openshift-operators -l operators.coreos.com/cluster-observability-operator.openshift-operators -o jsonpath='{.items[*].status.phase}' | grep Succeeded); do sleep 10; done"
Expand Down Expand Up @@ -424,7 +428,7 @@ watcher_cleanup: ## Cleaning watcher operator via olm

KUTTL_SUITE ?= default
KUTTL_NAMESPACE ?= watcher-kuttl-$(KUTTL_SUITE)
KUTTL_SUITE_DIR ?= tests/kuttl/test-suites/$(KUTTL_SUITE)
KUTTL_SUITE_DIR ?= test/kuttl/test-suites/$(KUTTL_SUITE)

.PHONY: stop_watcher_integrated
stop_watcher_integrated:
Expand Down
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: openstack.org
layout:
- go.kubebuilder.io/v3
- go.kubebuilder.io/v4
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
Expand Down
7 changes: 4 additions & 3 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ type PasswordSelector struct {
Service *string `json:"service"`
}

// WatcherSubCrsCommon
// WatcherSubCrsCommon defines the common fields for Watcher sub-CRs
type WatcherSubCrsCommon struct {
// +kubebuilder:validation:Optional
// The service specific Container Image URL (will be set to environmental default if empty)
Expand Down Expand Up @@ -189,6 +189,7 @@ type WatcherSubCrsTemplate struct {
TopologyRef *topologyv1.TopoRef `json:"topologyRef,omitempty"`
}

// WatcherImages defines the container images for all Watcher services
type WatcherImages struct {
// +kubebuilder:validation:Required
// APIContainerImageURL
Expand All @@ -203,6 +204,7 @@ type WatcherImages struct {
ApplierContainerImageURL string `json:"applierContainerImageURL"`
}

// Default sets default values for WatcherImages based on the provided defaults
func (r *WatcherImages) Default(defaults WatcherDefaults) {
if r.APIContainerImageURL == "" {
r.APIContainerImageURL = defaults.APIContainerImageURL
Expand All @@ -215,8 +217,7 @@ func (r *WatcherImages) Default(defaults WatcherDefaults) {
}
}

// SetupDefaults - initializes any CRD field defaults based on environment variables (the defaulting mechanism itself is implemented via webhooks)

// SetupDefaults initializes any CRD field defaults based on environment variables (the defaulting mechanism itself is implemented via webhooks)
func SetupDefaults() {
// Acquire environmental defaults and initialize Watcher defaults with them
watcherDefaults := WatcherDefaults{
Expand Down
25 changes: 0 additions & 25 deletions api/v1beta1/common_webhook.go

This file was deleted.

2 changes: 1 addition & 1 deletion api/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
const (
// WatcherRabbitMQTransportURLReadyCondition -
WatcherRabbitMQTransportURLReadyCondition condition.Type = "WatcherRabbitMQTransportURLReady"
// WatcherNotificationsBusTransportURLReadyCondition -
// WatcherNotificationTransportURLReadyCondition indicates whether the Watcher notification transport URL is ready
WatcherNotificationTransportURLReadyCondition condition.Type = "WatcherNotificationTransportURLReady"
// WatcherAPIReadyCondition -
WatcherAPIReadyCondition condition.Type = "WatcherAPIReady"
Expand Down
5 changes: 3 additions & 2 deletions api/v1beta1/watcher_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type WatcherStatus struct {
DecisionEngineServiceReadyCount int32 `json:"decisionengineServiceReadyCount,omitempty"`
}

// WatcherDBPurge defines the parameters for the Watcher database purging cron job
type WatcherDBPurge struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default="0 1 * * *"
Expand Down Expand Up @@ -117,8 +118,8 @@ func (instance Watcher) RbacResourceName() string {
}

// IsReady returns true if the ReadyCondition is true
func (r *Watcher) IsReady() bool {
return r.Status.Conditions.IsTrue(condition.ReadyCondition)
func (instance *Watcher) IsReady() bool {
return instance.Status.Conditions.IsTrue(condition.ReadyCondition)
}

func init() {
Expand Down
31 changes: 14 additions & 17 deletions api/v1beta1/watcher_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ var watcherDefaults WatcherDefaults
// log is for logging in this package.
var watcherlog = logf.Log.WithName("watcher-resource")

// SetupWatcherDefaults initializes the Watcher defaults for the webhook
func SetupWatcherDefaults(defaults WatcherDefaults) {
watcherDefaults = defaults
watcherlog.Info("Watcher defaults initialized", "defaults", defaults)
}

//+kubebuilder:webhook:path=/mutate-watcher-openstack-org-v1beta1-watcher,mutating=true,failurePolicy=fail,sideEffects=None,groups=watcher.openstack.org,resources=watchers,verbs=create;update,versions=v1beta1,name=mwatcher.kb.io,admissionReviewVersions=v1

var _ webhook.Defaulter = &Watcher{}

// Default implements webhook.Defaulter so a webhook will be registered for the type
Expand All @@ -68,8 +67,6 @@ func (spec *WatcherSpecCore) Default() {
// no validations . Placeholder for defaulting webhook integrated in the OpenStackControlPlane
}

//+kubebuilder:webhook:path=/validate-watcher-openstack-org-v1beta1-watcher,mutating=false,failurePolicy=fail,sideEffects=None,groups=watcher.openstack.org,resources=watchers,verbs=create;update,versions=v1beta1,name=vwatcher.kb.io,admissionReviewVersions=v1

var _ webhook.Validator = &Watcher{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
Expand All @@ -88,33 +85,33 @@ func (r *Watcher) ValidateCreate() (admission.Warnings, error) {
}

// ValidateCreate validates the WatcherSpec during the webhook invocation.
func (r *WatcherSpec) ValidateCreate(basePath *field.Path, namespace string) field.ErrorList {
return r.WatcherSpecCore.ValidateCreate(basePath, namespace)
func (spec *WatcherSpec) ValidateCreate(basePath *field.Path, namespace string) field.ErrorList {
return spec.WatcherSpecCore.ValidateCreate(basePath, namespace)
}

// ValidateCreate validates the WatcherSpecCore during the webhook invocation. It is
// expected to be called by the validation webhook in the higher level meta
// operator
func (r *WatcherSpecCore) ValidateCreate(basePath *field.Path, namespace string) field.ErrorList {
func (spec *WatcherSpecCore) ValidateCreate(basePath *field.Path, namespace string) field.ErrorList {
var allErrs field.ErrorList

if *r.DatabaseInstance == "" || r.DatabaseInstance == nil {
if *spec.DatabaseInstance == "" || spec.DatabaseInstance == nil {
allErrs = append(
allErrs,
field.Invalid(
basePath.Child("databaseInstance"), "", "databaseInstance field should not be empty"),
)
}

if *r.RabbitMqClusterName == "" || r.RabbitMqClusterName == nil {
if *spec.RabbitMqClusterName == "" || spec.RabbitMqClusterName == nil {
allErrs = append(
allErrs,
field.Invalid(
basePath.Child("rabbitMqClusterName"), "", "rabbitMqClusterName field should not be empty"),
)
}

allErrs = append(allErrs, r.ValidateWatcherTopology(basePath, namespace)...)
allErrs = append(allErrs, spec.ValidateWatcherTopology(basePath, namespace)...)

return allErrs
}
Expand All @@ -140,34 +137,34 @@ func (r *Watcher) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

}

// ValidateCreate validates the WatcherSpec during the webhook invocation.
func (r *WatcherSpec) ValidateUpdate(old WatcherSpec, basePath *field.Path, namespace string) field.ErrorList {
return r.WatcherSpecCore.ValidateUpdate(old.WatcherSpecCore, basePath, namespace)
// ValidateUpdate validates the WatcherSpec during the webhook update invocation.
func (spec *WatcherSpec) ValidateUpdate(old WatcherSpec, basePath *field.Path, namespace string) field.ErrorList {
return spec.WatcherSpecCore.ValidateUpdate(old.WatcherSpecCore, basePath, namespace)
}

// ValidateUpdate validates the WatcherSpecCore during the webhook invocation. It is
// expected to be called by the validation webhook in the higher level meta
// operator
func (r *WatcherSpecCore) ValidateUpdate(old WatcherSpecCore, basePath *field.Path, namespace string) field.ErrorList {
func (spec *WatcherSpecCore) ValidateUpdate(old WatcherSpecCore, basePath *field.Path, namespace string) field.ErrorList {
var allErrs field.ErrorList

if *r.DatabaseInstance == "" || r.DatabaseInstance == nil {
if *spec.DatabaseInstance == "" || spec.DatabaseInstance == nil {
allErrs = append(
allErrs,
field.Invalid(
basePath.Child("databaseInstance"), "", "databaseInstance field should not be empty"),
)
}

if *r.RabbitMqClusterName == "" || r.RabbitMqClusterName == nil {
if *spec.RabbitMqClusterName == "" || spec.RabbitMqClusterName == nil {
allErrs = append(
allErrs,
field.Invalid(
basePath.Child("rabbitMqClusterName"), "", "rabbitMqClusterName field should not be empty"),
)
}

allErrs = append(allErrs, r.ValidateWatcherTopology(basePath, namespace)...)
allErrs = append(allErrs, spec.ValidateWatcherTopology(basePath, namespace)...)

return allErrs
}
Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/watcherapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ type WatcherAPIList struct {
}

// IsReady returns true if the ReadyCondition is true
func (r *WatcherAPI) IsReady() bool {
return r.Status.Conditions.IsTrue(condition.ReadyCondition)
func (instance *WatcherAPI) IsReady() bool {
return instance.Status.Conditions.IsTrue(condition.ReadyCondition)
}

func init() {
Expand Down
10 changes: 0 additions & 10 deletions api/v1beta1/watcherapi_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/validation/field"
ctrl "sigs.k8s.io/controller-runtime"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
Expand All @@ -29,16 +28,8 @@ import (
// log is for logging in this package.
var watcherapilog = logf.Log.WithName("watcherapi-resource")

func (r *WatcherAPI) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
Complete()
}

// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!

//+kubebuilder:webhook:path=/mutate-watcher-openstack-org-v1beta1-watcherapi,mutating=true,failurePolicy=fail,sideEffects=None,groups=watcher.openstack.org,resources=watcherapis,verbs=create;update,versions=v1beta1,name=mwatcherapi.kb.io,admissionReviewVersions=v1

var _ webhook.Defaulter = &WatcherAPI{}

// Default implements webhook.Defaulter so a webhook will be registered for the type
Expand All @@ -49,7 +40,6 @@ func (r *WatcherAPI) Default() {
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
//+kubebuilder:webhook:path=/validate-watcher-openstack-org-v1beta1-watcherapi,mutating=false,failurePolicy=fail,sideEffects=None,groups=watcher.openstack.org,resources=watcherapis,verbs=create;update,versions=v1beta1,name=vwatcherapi.kb.io,admissionReviewVersions=v1

var _ webhook.Validator = &WatcherAPI{}

Expand Down
6 changes: 3 additions & 3 deletions api/v1beta1/watcherapplier_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type WatcherApplierStatus struct {
LastAppliedTopology *topologyv1.TopoRef `json:"lastAppliedTopology,omitempty"`
}

// WatcherApplierTemplatce defines the input parameters specified by the user to
// WatcherApplierTemplate defines the input parameters specified by the user to
// create a WatcherApplier via higher level CRDs.
type WatcherApplierTemplate struct {
WatcherSubCrsTemplate `json:",inline"`
Expand Down Expand Up @@ -104,8 +104,8 @@ type WatcherApplier struct {
}

// IsReady returns true if the ReadyCondition is true
func (r *WatcherApplier) IsReady() bool {
return r.Status.Conditions.IsTrue(condition.ReadyCondition)
func (instance *WatcherApplier) IsReady() bool {
return instance.Status.Conditions.IsTrue(condition.ReadyCondition)
}

//+kubebuilder:object:root=true
Expand Down
Loading