diff --git a/api/v1alpha1/frontendenvironment_types.go b/api/v1alpha1/frontendenvironment_types.go index f4dfda31..1105c09e 100644 --- a/api/v1alpha1/frontendenvironment_types.go +++ b/api/v1alpha1/frontendenvironment_types.go @@ -44,7 +44,7 @@ type FrontendEnvironmentSpec struct { //MonitorMode determines where a ServiceMonitor object will be placed // local will add it to the frontend's namespace // app-interface will add it to "openshift-customer-monitoring" - Monitoring MonitoringConfig `json:"monitoring"` + Monitoring *MonitoringConfig `json:"monitoring,omitempty"` } type MonitoringConfig struct { diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index c1d4430e..c752feb7 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -423,7 +423,11 @@ func (in *FrontendEnvironmentSpec) DeepCopyInto(out *FrontendEnvironmentSpec) { *out = make([]string, len(*in)) copy(*out, *in) } - out.Monitoring = in.Monitoring + if in.Monitoring != nil { + in, out := &in.Monitoring, &out.Monitoring + *out = new(MonitoringConfig) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FrontendEnvironmentSpec. diff --git a/config/crd/bases/cloud.redhat.com_frontendenvironments.yaml b/config/crd/bases/cloud.redhat.com_frontendenvironments.yaml index 3544ae1a..fcce4168 100644 --- a/config/crd/bases/cloud.redhat.com_frontendenvironments.yaml +++ b/config/crd/bases/cloud.redhat.com_frontendenvironments.yaml @@ -77,7 +77,6 @@ spec: type: string type: array required: - - monitoring - sso type: object status: diff --git a/controllers/frontend_controller_suite_test.go b/controllers/frontend_controller_suite_test.go index 78dbf547..73fde853 100644 --- a/controllers/frontend_controller_suite_test.go +++ b/controllers/frontend_controller_suite_test.go @@ -135,7 +135,7 @@ var _ = Describe("Frontend controller with image", func() { Spec: crd.FrontendEnvironmentSpec{ SSO: "https://something-auth", Hostname: "something", - Monitoring: crd.MonitoringConfig{ + Monitoring: &crd.MonitoringConfig{ Mode: "app-interface", }, }, @@ -250,7 +250,7 @@ var _ = Describe("Frontend controller with service", func() { "192.168.0.0/24", "10.10.0.0/24", }, - Monitoring: crd.MonitoringConfig{ + Monitoring: &crd.MonitoringConfig{ Mode: "local", }, }, @@ -524,7 +524,7 @@ var _ = Describe("Frontend controller with chrome", func() { Spec: crd.FrontendEnvironmentSpec{ SSO: "https://something-auth", Hostname: "something", - Monitoring: crd.MonitoringConfig{ + Monitoring: &crd.MonitoringConfig{ Mode: "app-interface", }, }, @@ -672,7 +672,7 @@ var _ = Describe("ServiceMonitor Creation", func() { Spec: crd.FrontendEnvironmentSpec{ SSO: "https://something-auth", Hostname: "something", - Monitoring: crd.MonitoringConfig{ + Monitoring: &crd.MonitoringConfig{ Mode: "app-interface", }, }, @@ -875,7 +875,7 @@ var _ = Describe("Dependencies", func() { Spec: crd.FrontendEnvironmentSpec{ SSO: "https://something-auth", Hostname: "something", - Monitoring: crd.MonitoringConfig{ + Monitoring: &crd.MonitoringConfig{ Mode: "app-interface", }, }, diff --git a/controllers/reconcile.go b/controllers/reconcile.go index 0eded771..ecac18a2 100644 --- a/controllers/reconcile.go +++ b/controllers/reconcile.go @@ -62,7 +62,7 @@ func (r *FrontendReconciliation) run() error { return err } - if !r.Frontend.Spec.ServiceMonitor.Disabled && !r.FrontendEnvironment.Spec.Monitoring.Disabled { + if r.FrontendEnvironment.Spec.Monitoring != nil && !r.Frontend.Spec.ServiceMonitor.Disabled && !r.FrontendEnvironment.Spec.Monitoring.Disabled { if err := r.createServiceMonitor(); err != nil { return err } diff --git a/deploy.yml b/deploy.yml index 686f9959..db5b3d49 100644 --- a/deploy.yml +++ b/deploy.yml @@ -386,7 +386,6 @@ objects: type: string type: array required: - - monitoring - sso type: object status: diff --git a/docs/antora/modules/ROOT/pages/api_reference.adoc b/docs/antora/modules/ROOT/pages/api_reference.adoc index c6b11698..64fe3979 100644 --- a/docs/antora/modules/ROOT/pages/api_reference.adoc +++ b/docs/antora/modules/ROOT/pages/api_reference.adoc @@ -75,7 +75,7 @@ BundleList contains a list of Bundle | *`kind`* __string__ | `BundleList` | *`metadata`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#listmeta-v1-meta[$$ListMeta$$]__ | Refer to Kubernetes API documentation for fields of `metadata`. -| *`items`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-bundle[$$Bundle$$]__ | +| *`items`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-bundle[$$Bundle$$] array__ | |=== @@ -104,8 +104,8 @@ BundleList contains a list of Bundle | *`product`* __string__ | | *`isExternal`* __boolean__ | | *`filterable`* __boolean__ | -| *`permissions`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-bundlepermission[$$BundlePermission$$]__ | -| *`routes`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-embeddedroute[$$EmbeddedRoute$$]__ | +| *`permissions`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-bundlepermission[$$BundlePermission$$] array__ | +| *`routes`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-embeddedroute[$$EmbeddedRoute$$] array__ | | *`expandable`* __boolean__ | | *`dynamicNav`* __string__ | |=== @@ -126,10 +126,20 @@ BundleList contains a list of Bundle |=== | Field | Description | *`method`* __string__ | -| *`args`* __string array__ | +| *`args`* __string array array__ | |=== +[id="{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-bundlepermissionargs"] +==== BundlePermissionArgs + + + +.Appears In: +**** +- xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-bundlepermission[$$BundlePermission$$] +**** + [id="{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-bundlespec"] @@ -149,8 +159,8 @@ BundleSpec defines the desired state of Bundle | *`title`* __string__ | | *`appList`* __string array__ | | *`envName`* __string__ | -| *`extraNavItems`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-extranavitem[$$ExtraNavItem$$]__ | -| *`customNav`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-bundlenavitem[$$BundleNavItem$$]__ | +| *`extraNavItems`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-extranavitem[$$ExtraNavItem$$] array__ | +| *`customNav`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-bundlenavitem[$$BundleNavItem$$] array__ | |=== @@ -291,7 +301,7 @@ FrontendEnvironmentList contains a list of FrontendEnvironment | *`kind`* __string__ | `FrontendEnvironmentList` | *`metadata`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#listmeta-v1-meta[$$ListMeta$$]__ | Refer to Kubernetes API documentation for fields of `metadata`. -| *`items`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-frontendenvironment[$$FrontendEnvironment$$]__ | +| *`items`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-frontendenvironment[$$FrontendEnvironment$$] array__ | |=== @@ -349,7 +359,7 @@ FrontendList contains a list of Frontend | *`kind`* __string__ | `FrontendList` | *`metadata`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#listmeta-v1-meta[$$ListMeta$$]__ | Refer to Kubernetes API documentation for fields of `metadata`. -| *`items`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-frontend[$$Frontend$$]__ | +| *`items`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-frontend[$$Frontend$$] array__ | |=== @@ -375,9 +385,8 @@ FrontendSpec defines the desired state of Frontend | *`service`* __string__ | | *`serviceMonitor`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-servicemonitorconfig[$$ServiceMonitorConfig$$]__ | | *`module`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-fedmodule[$$FedModule$$]__ | -| *`navItems`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-bundlenavitem[$$BundleNavItem$$]__ | +| *`navItems`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-bundlenavitem[$$BundleNavItem$$] array__ | | *`assetsPrefix`* __string__ | -| *`customConfig`* __JSON__ | |=== @@ -405,8 +414,8 @@ FrontendSpec defines the desired state of Frontend | *`filterable`* __boolean__ | | *`expandable`* __boolean__ | | *`notifier`* __string__ | -| *`routes`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-embeddedroute[$$EmbeddedRoute$$]__ | -| *`permissions`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-bundlepermission[$$BundlePermission$$]__ | +| *`routes`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-embeddedroute[$$EmbeddedRoute$$] array__ | +| *`permissions`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-bundlepermission[$$BundlePermission$$] array__ | |=== @@ -426,6 +435,8 @@ FrontendSpec defines the desired state of Frontend | *`id`* __string__ | | *`module`* __string__ | | *`routes`* __xref:{anchor_prefix}-github-com-redhatinsights-frontend-operator-api-v1alpha1-route[$$Route$$] array__ | +| *`dependencies`* __string array__ | +| *`optionalDependencies`* __string array__ | |===