Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to use new CreateServiceReadyCondition #464

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 api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/openstack-k8s-operators/heat-operator/api
go 1.21

require (
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241028071009-a8404d0ab6bb
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241029151503-4878b3fa3333
k8s.io/api v0.29.10
k8s.io/apimachinery v0.29.10
sigs.k8s.io/controller-runtime v0.17.6
Expand Down
4 changes: 2 additions & 2 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo
github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI=
github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241028071009-a8404d0ab6bb h1:hbHzQN4NiRJPLZ10ctnPPygmaFIxQyYovCfgp7e9K88=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241028071009-a8404d0ab6bb/go.mod h1:YpNTuJhDWhbXM50O3qBkhO7M+OOyRmWkNVmJ4y3cyFs=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241029151503-4878b3fa3333 h1:yejekTWudX5af3mCJQ1MUPLEa0X6sIsklf07o9KilRk=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241029151503-4878b3fa3333/go.mod h1:YpNTuJhDWhbXM50O3qBkhO7M+OOyRmWkNVmJ4y3cyFs=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/heatapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func init() {
func (instance HeatAPI) StatusConditionsList() condition.Conditions {
return condition.CreateList(
condition.UnknownCondition(condition.ReadyCondition, condition.InitReason, condition.ReadyInitMessage),
condition.UnknownCondition(condition.ExposeServiceReadyCondition, condition.InitReason, condition.ExposeServiceReadyInitMessage),
condition.UnknownCondition(condition.CreateServiceReadyCondition, condition.InitReason, condition.CreateServiceReadyInitMessage),
condition.UnknownCondition(condition.InputReadyCondition, condition.InitReason, condition.InputReadyInitMessage),
condition.UnknownCondition(condition.ServiceConfigReadyCondition, condition.InitReason, condition.ServiceConfigReadyInitMessage),
condition.UnknownCondition(condition.DeploymentReadyCondition, condition.InitReason, condition.DeploymentReadyInitMessage),
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/heatcfnapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func init() {
func (instance *HeatCfnAPI) StatusConditionsList() condition.Conditions {
return condition.CreateList(
condition.UnknownCondition(condition.ReadyCondition, condition.InitReason, condition.ReadyInitMessage),
condition.UnknownCondition(condition.ExposeServiceReadyCondition, condition.InitReason, condition.ExposeServiceReadyInitMessage),
condition.UnknownCondition(condition.CreateServiceReadyCondition, condition.InitReason, condition.CreateServiceReadyInitMessage),
condition.UnknownCondition(condition.InputReadyCondition, condition.InitReason, condition.InputReadyInitMessage),
condition.UnknownCondition(condition.ServiceConfigReadyCondition, condition.InitReason, condition.ServiceConfigReadyInitMessage),
condition.UnknownCondition(condition.DeploymentReadyCondition, condition.InitReason, condition.DeploymentReadyInitMessage),
Expand Down
14 changes: 7 additions & 7 deletions controllers/heatapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,10 @@ func (r *HeatAPIReconciler) reconcileInit(
)
if err != nil {
instance.Status.Conditions.Set(condition.FalseCondition(
condition.ExposeServiceReadyCondition,
condition.CreateServiceReadyCondition,
condition.ErrorReason,
condition.SeverityWarning,
condition.ExposeServiceReadyErrorMessage,
condition.CreateServiceReadyErrorMessage,
err.Error()))

return ctrl.Result{}, err
Expand Down Expand Up @@ -451,19 +451,19 @@ func (r *HeatAPIReconciler) reconcileInit(
ctrlResult, err := svc.CreateOrPatch(ctx, helper)
if err != nil {
instance.Status.Conditions.Set(condition.FalseCondition(
condition.ExposeServiceReadyCondition,
condition.CreateServiceReadyCondition,
condition.ErrorReason,
condition.SeverityWarning,
condition.ExposeServiceReadyErrorMessage,
condition.CreateServiceReadyErrorMessage,
err.Error()))

return ctrlResult, err
} else if (ctrlResult != ctrl.Result{}) {
instance.Status.Conditions.Set(condition.FalseCondition(
condition.ExposeServiceReadyCondition,
condition.CreateServiceReadyCondition,
condition.RequestedReason,
condition.SeverityInfo,
condition.ExposeServiceReadyRunningMessage))
condition.CreateServiceReadyRunningMessage))
return ctrlResult, nil
}
// create service - end
Expand All @@ -481,7 +481,7 @@ func (r *HeatAPIReconciler) reconcileInit(
}
}

instance.Status.Conditions.MarkTrue(condition.ExposeServiceReadyCondition, condition.ExposeServiceReadyMessage)
instance.Status.Conditions.MarkTrue(condition.CreateServiceReadyCondition, condition.CreateServiceReadyMessage)

// expose service - end

Expand Down
14 changes: 7 additions & 7 deletions controllers/heatcfnapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,10 @@ func (r *HeatCfnAPIReconciler) reconcileInit(
)
if err != nil {
instance.Status.Conditions.Set(condition.FalseCondition(
condition.ExposeServiceReadyCondition,
condition.CreateServiceReadyCondition,
condition.ErrorReason,
condition.SeverityWarning,
condition.ExposeServiceReadyErrorMessage,
condition.CreateServiceReadyErrorMessage,
err.Error()))

return ctrl.Result{}, err
Expand Down Expand Up @@ -453,19 +453,19 @@ func (r *HeatCfnAPIReconciler) reconcileInit(
ctrlResult, err := svc.CreateOrPatch(ctx, helper)
if err != nil {
instance.Status.Conditions.Set(condition.FalseCondition(
condition.ExposeServiceReadyCondition,
condition.CreateServiceReadyCondition,
condition.ErrorReason,
condition.SeverityWarning,
condition.ExposeServiceReadyErrorMessage,
condition.CreateServiceReadyErrorMessage,
err.Error()))

return ctrlResult, err
} else if (ctrlResult != ctrl.Result{}) {
instance.Status.Conditions.Set(condition.FalseCondition(
condition.ExposeServiceReadyCondition,
condition.CreateServiceReadyCondition,
condition.RequestedReason,
condition.SeverityInfo,
condition.ExposeServiceReadyRunningMessage))
condition.CreateServiceReadyRunningMessage))
return ctrlResult, nil
}
// create service - end
Expand All @@ -483,7 +483,7 @@ func (r *HeatCfnAPIReconciler) reconcileInit(
}
}

instance.Status.Conditions.MarkTrue(condition.ExposeServiceReadyCondition, condition.ExposeServiceReadyMessage)
instance.Status.Conditions.MarkTrue(condition.CreateServiceReadyCondition, condition.CreateServiceReadyMessage)

// expose service - end

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/openstack-k8s-operators/heat-operator/api v0.3.1-0.20240214134649-6643d1b09d49
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241024081600-3e23dc62002c
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241028071533-ae2b9a574fda
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241028071009-a8404d0ab6bb
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241029151503-4878b3fa3333
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.5.1-0.20241028071009-a8404d0ab6bb
github.com/openstack-k8s-operators/lib-common/modules/test v0.5.1-0.20241028071009-a8404d0ab6bb
github.com/openstack-k8s-operators/mariadb-operator/api v0.5.1-0.20241028074300-17b2cf83d27e
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241024081600-3
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20241024081600-3e23dc62002c/go.mod h1:J9oUh3eGBvAFfyUMiPxPRBSxAcO8rnwITN4RTh/It+8=
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241028071533-ae2b9a574fda h1:aCBLS8MvLJhiOOVyYcukaReeqM01c26eKjRI2w29FWI=
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20241028071533-ae2b9a574fda/go.mod h1:llI4Qbt8Rj9sWLpkY32u3UJBh1tFKPiS1RGgBaYVq/g=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241028071009-a8404d0ab6bb h1:hbHzQN4NiRJPLZ10ctnPPygmaFIxQyYovCfgp7e9K88=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241028071009-a8404d0ab6bb/go.mod h1:YpNTuJhDWhbXM50O3qBkhO7M+OOyRmWkNVmJ4y3cyFs=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241029151503-4878b3fa3333 h1:yejekTWudX5af3mCJQ1MUPLEa0X6sIsklf07o9KilRk=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20241029151503-4878b3fa3333/go.mod h1:YpNTuJhDWhbXM50O3qBkhO7M+OOyRmWkNVmJ4y3cyFs=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.5.1-0.20241028071009-a8404d0ab6bb h1:kcXt7azDv8c5Bdu46u0nBmhGDMaX/bJrtiYhNSLxRDg=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.5.1-0.20241028071009-a8404d0ab6bb/go.mod h1:IASoGvp5QM/tBJUd/8i8uIjj4DBnI+64Ydh4r7pmnvA=
github.com/openstack-k8s-operators/lib-common/modules/test v0.5.1-0.20241028071009-a8404d0ab6bb h1:YgSMEU/uEx9k1LVt4nnlumV37pXMCgOxi7dHDMwT6q8=
Expand Down
Loading