diff --git a/api/v1beta1/grafanadatasource_types.go b/api/v1beta1/grafanadatasource_types.go index 08ecf13c4..a8d4ab2e8 100644 --- a/api/v1beta1/grafanadatasource_types.go +++ b/api/v1beta1/grafanadatasource_types.go @@ -36,11 +36,14 @@ type GrafanaDatasourceInternal struct { Access string `json:"access,omitempty"` Database string `json:"database,omitempty"` User string `json:"user,omitempty"` - OrgID *int64 `json:"orgId,omitempty"` IsDefault *bool `json:"isDefault,omitempty"` BasicAuth *bool `json:"basicAuth,omitempty"` BasicAuthUser string `json:"basicAuthUser,omitempty"` - Editable *bool `json:"editable,omitempty"` + + // Deprecated field, it has no effect + OrgID *int64 `json:"orgId,omitempty"` + // Deprecated field, it has no effect + Editable *bool `json:"editable,omitempty"` // +kubebuilder:validation:Schemaless // +kubebuilder:pruning:PreserveUnknownFields diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index dfe3cd09a..7782a3533 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -914,11 +914,6 @@ func (in *GrafanaDatasource) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GrafanaDatasourceInternal) DeepCopyInto(out *GrafanaDatasourceInternal) { *out = *in - if in.OrgID != nil { - in, out := &in.OrgID, &out.OrgID - *out = new(int64) - **out = **in - } if in.IsDefault != nil { in, out := &in.IsDefault, &out.IsDefault *out = new(bool) @@ -929,6 +924,11 @@ func (in *GrafanaDatasourceInternal) DeepCopyInto(out *GrafanaDatasourceInternal *out = new(bool) **out = **in } + if in.OrgID != nil { + in, out := &in.OrgID, &out.OrgID + *out = new(int64) + **out = **in + } if in.Editable != nil { in, out := &in.Editable, &out.Editable *out = new(bool) diff --git a/bundle/manifests/grafana-operator.clusterserviceversion.yaml b/bundle/manifests/grafana-operator.clusterserviceversion.yaml index 23773e86f..f25b4c9db 100644 --- a/bundle/manifests/grafana-operator.clusterserviceversion.yaml +++ b/bundle/manifests/grafana-operator.clusterserviceversion.yaml @@ -33,13 +33,6 @@ metadata: "apiVersion": "grafana.integreatly.org/v1beta1", "kind": "GrafanaAlertRuleGroup", "metadata": { - "labels": { - "app.kubernetes.io/created-by": "grafana-operator", - "app.kubernetes.io/instance": "grafanaalertrulegroup-sample", - "app.kubernetes.io/managed-by": "kustomize", - "app.kubernetes.io/name": "grafanaalertrulegroup", - "app.kubernetes.io/part-of": "grafana-operator" - }, "name": "grafanaalertrulegroup-sample" }, "spec": { @@ -126,6 +119,32 @@ metadata: ] } }, + { + "apiVersion": "grafana.integreatly.org/v1beta1", + "kind": "GrafanaContactPoint", + "metadata": { + "labels": { + "app.kubernetes.io/created-by": "grafana-operator", + "app.kubernetes.io/instance": "grafanacontactpoint-sample", + "app.kubernetes.io/managed-by": "kustomize", + "app.kubernetes.io/name": "grafanacontactpoint", + "app.kubernetes.io/part-of": "grafana-operator" + }, + "name": "grafanacontactpoint-sample" + }, + "spec": { + "instanceSelector": { + "matchLabels": { + "dashboards": "grafana-a" + } + }, + "name": "grafanacontactpoint-sample", + "settings": { + "email": null + }, + "type": "email" + } + }, { "apiVersion": "grafana.integreatly.org/v1beta1", "kind": "GrafanaDashboard", @@ -150,7 +169,6 @@ metadata: "spec": { "datasource": { "access": "proxy", - "editable": true, "isDefault": true, "jsonData": { "timeInterval": "5s", @@ -192,13 +210,13 @@ metadata: capabilities: Basic Install categories: Monitoring containerImage: ghcr.io/grafana/grafana-operator@sha256:97561cef949b58f55ec67d133c02ac205e2ec3fb77388aeb868dacfcebad0752 - createdAt: "2024-03-05T15:09:12Z" + createdAt: "2024-04-19T08:44:59Z" description: Deploys and manages Grafana instances, dashboards and data sources operators.operatorframework.io/builder: operator-sdk-v1.32.0 operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 repository: https://github.com/grafana/grafana-operator support: Grafana Labs - name: grafana-operator.v5.6.3 + name: grafana-operator.v5.8.1 namespace: placeholder spec: apiservicedefinitions: {} @@ -209,6 +227,11 @@ spec: kind: GrafanaAlertRuleGroup name: grafanaalertrulegroups.grafana.integreatly.org version: v1beta1 + - description: GrafanaContactPoint is the Schema for the grafanacontactpoints API + displayName: Grafana Contact Point + kind: GrafanaContactPoint + name: grafanacontactpoints.grafana.integreatly.org + version: v1beta1 - description: GrafanaDashboard is the Schema for the grafanadashboards API displayName: Grafana Dashboard kind: GrafanaDashboard @@ -302,6 +325,32 @@ spec: - get - patch - update + - apiGroups: + - grafana.integreatly.org + resources: + - grafanacontactpoints + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - grafana.integreatly.org + resources: + - grafanacontactpoints/finalizers + verbs: + - update + - apiGroups: + - grafana.integreatly.org + resources: + - grafanacontactpoints/status + verbs: + - get + - patch + - update - apiGroups: - grafana.integreatly.org resources: @@ -456,12 +505,12 @@ spec: - --leader-elect env: - name: RELATED_IMAGE_GRAFANA - value: docker.io/grafana/grafana@sha256:ff68ed4324e471ffa269aa5308cdcf12276ef2d5a660daea95db9d629a32a7d8 + value: docker.io/grafana/grafana@sha256:9a2acaa26a0b302a56d8e113068a1297cf0726fcaff5e6bb77344888e5f1c976 - name: WATCH_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.annotations['olm.targetNamespaces'] - image: ghcr.io/grafana/grafana-operator@sha256:e398d39e48abdd16ae126233bc3b485b0c7f79e9b087fc5db5c164e9d64da276 + image: ghcr.io/grafana/grafana-operator@sha256:34229f59e1609764196870aa2672aa1b784e88583ec445ff04e810a8333b72a7 imagePullPolicy: Always livenessProbe: httpGet: @@ -553,9 +602,9 @@ spec: name: Grafana Labs url: https://grafana.com relatedImages: - - image: docker.io/grafana/grafana@sha256:ff68ed4324e471ffa269aa5308cdcf12276ef2d5a660daea95db9d629a32a7d8 + - image: docker.io/grafana/grafana@sha256:9a2acaa26a0b302a56d8e113068a1297cf0726fcaff5e6bb77344888e5f1c976 name: grafana - - image: ghcr.io/grafana/grafana-operator@sha256:e398d39e48abdd16ae126233bc3b485b0c7f79e9b087fc5db5c164e9d64da276 + - image: ghcr.io/grafana/grafana-operator@sha256:34229f59e1609764196870aa2672aa1b784e88583ec445ff04e810a8333b72a7 name: manager - image: ghcr.io/grafana/grafana-operator@sha256:97561cef949b58f55ec67d133c02ac205e2ec3fb77388aeb868dacfcebad0752 name: grafana-operator-97561cef949b58f55ec67d133c02ac205e2ec3fb77388aeb868dacfcebad0752-annotation diff --git a/bundle/manifests/grafana.integreatly.org_grafanaalertrulegroups.yaml b/bundle/manifests/grafana.integreatly.org_grafanaalertrulegroups.yaml index a4c650348..b018a7a28 100644 --- a/bundle/manifests/grafana.integreatly.org_grafanaalertrulegroups.yaml +++ b/bundle/manifests/grafana.integreatly.org_grafanaalertrulegroups.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.14.0 creationTimestamp: null name: grafanaalertrulegroups.grafana.integreatly.org spec: diff --git a/bundle/manifests/grafana.integreatly.org_grafanacontactpoints.yaml b/bundle/manifests/grafana.integreatly.org_grafanacontactpoints.yaml new file mode 100644 index 000000000..b04d25788 --- /dev/null +++ b/bundle/manifests/grafana.integreatly.org_grafanacontactpoints.yaml @@ -0,0 +1,143 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + creationTimestamp: null + name: grafanacontactpoints.grafana.integreatly.org +spec: + group: grafana.integreatly.org + names: + kind: GrafanaContactPoint + listKind: GrafanaContactPointList + plural: grafanacontactpoints + singular: grafanacontactpoint + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + allowCrossNamespaceImport: + type: boolean + disableResolveMessage: + type: boolean + instanceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + name: + type: string + resyncPeriod: + default: 10m + format: duration + pattern: ^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$ + type: string + settings: + x-kubernetes-preserve-unknown-fields: true + type: + enum: + - alertmanager + - dingding + - discord + - email + - googlechat + - kafka + - line + - opsgenie + - pagerduty + - pushover + - sensugo + - slack + - teams + - telegram + - threema + - victorops + - webhook + - wecom + type: string + required: + - instanceSelector + - name + - settings + type: object + status: + properties: + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + message: + maxLength: 32768 + type: string + observedGeneration: + format: int64 + minimum: 0 + type: integer + reason: + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + enum: + - "True" + - "False" + - Unknown + type: string + type: + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + required: + - conditions + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null diff --git a/bundle/manifests/grafana.integreatly.org_grafanadashboards.yaml b/bundle/manifests/grafana.integreatly.org_grafanadashboards.yaml index c116b2858..b448e1b75 100644 --- a/bundle/manifests/grafana.integreatly.org_grafanadashboards.yaml +++ b/bundle/manifests/grafana.integreatly.org_grafanadashboards.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.14.0 creationTimestamp: null name: grafanadashboards.grafana.integreatly.org spec: diff --git a/bundle/manifests/grafana.integreatly.org_grafanadatasources.yaml b/bundle/manifests/grafana.integreatly.org_grafanadatasources.yaml index 9cbfdd9e3..998e02206 100644 --- a/bundle/manifests/grafana.integreatly.org_grafanadatasources.yaml +++ b/bundle/manifests/grafana.integreatly.org_grafanadatasources.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.14.0 creationTimestamp: null name: grafanadatasources.grafana.integreatly.org spec: diff --git a/bundle/manifests/grafana.integreatly.org_grafanafolders.yaml b/bundle/manifests/grafana.integreatly.org_grafanafolders.yaml index fe5524252..477f167e6 100644 --- a/bundle/manifests/grafana.integreatly.org_grafanafolders.yaml +++ b/bundle/manifests/grafana.integreatly.org_grafanafolders.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.14.0 creationTimestamp: null name: grafanafolders.grafana.integreatly.org spec: diff --git a/bundle/manifests/grafana.integreatly.org_grafanas.yaml b/bundle/manifests/grafana.integreatly.org_grafanas.yaml index 8a5b5d989..a46311f54 100644 --- a/bundle/manifests/grafana.integreatly.org_grafanas.yaml +++ b/bundle/manifests/grafana.integreatly.org_grafanas.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.14.0 creationTimestamp: null name: grafanas.grafana.integreatly.org spec: @@ -15,6 +15,9 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: + - jsonPath: .status.version + name: Version + type: string - jsonPath: .status.stage name: Stage type: string @@ -3976,6 +3979,8 @@ spec: x-kubernetes-map-type: atomic type: array type: object + version: + type: string type: object status: properties: @@ -3999,6 +4004,8 @@ spec: type: string stageStatus: type: string + version: + type: string type: object type: object served: true diff --git a/config/grafana.integreatly.org_grafanadatasources.yaml b/config/grafana.integreatly.org_grafanadatasources.yaml index 9f4400dad..1d9a1f1cf 100644 --- a/config/grafana.integreatly.org_grafanadatasources.yaml +++ b/config/grafana.integreatly.org_grafanadatasources.yaml @@ -60,6 +60,7 @@ spec: database: type: string editable: + description: Deprecated field. Please, remove it from your manifests type: boolean isDefault: type: boolean @@ -69,6 +70,7 @@ spec: name: type: string orgId: + description: Deprecated field. Please, remove it from your manifests format: int64 type: integer secureJsonData: diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index bfc3974cc..e995e200f 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -15,4 +15,4 @@ configMapGenerator: images: - name: controller newName: ghcr.io/grafana/grafana-operator - newTag: v5.6.3 + newTag: v5.8.1 diff --git a/config/manifests/bases/grafana-operator.clusterserviceversion.yaml b/config/manifests/bases/grafana-operator.clusterserviceversion.yaml index 268e95e77..8a06be9b9 100644 --- a/config/manifests/bases/grafana-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/grafana-operator.clusterserviceversion.yaml @@ -22,6 +22,12 @@ spec: kind: GrafanaAlertRuleGroup name: grafanaalertrulegroups.grafana.integreatly.org version: v1beta1 + - description: GrafanaContactPoint is the Schema for the grafanacontactpoints + API + displayName: Grafana Contact Point + kind: GrafanaContactPoint + name: grafanacontactpoints.grafana.integreatly.org + version: v1beta1 - description: GrafanaDashboard is the Schema for the grafanadashboards API displayName: Grafana Dashboard kind: GrafanaDashboard @@ -77,9 +83,9 @@ spec: url: https://grafana.com replaces: grafana-operator.v5.6.0 skips: - - grafana-operator.v5.6.1 - - grafana-operator.v5.6.2 - - grafana-operator.v5.6.3 - - grafana-operator.v5.7.0 - - grafana-operator.v5.8.0 + - grafana-operator.v5.6.1 + - grafana-operator.v5.6.2 + - grafana-operator.v5.6.3 + - grafana-operator.v5.7.0 + - grafana-operator.v5.8.0 version: 0.0.0 diff --git a/config/samples/grafana_v1beta1_grafanadatasource.yaml b/config/samples/grafana_v1beta1_grafanadatasource.yaml index 02e1e0a55..b39dcedc4 100644 --- a/config/samples/grafana_v1beta1_grafanadatasource.yaml +++ b/config/samples/grafana_v1beta1_grafanadatasource.yaml @@ -16,6 +16,5 @@ spec: url: http://prometheus-service:9090 isDefault: true jsonData: - 'tlsSkipVerify': true - 'timeInterval': "5s" - editable: true + "tlsSkipVerify": true + "timeInterval": "5s" diff --git a/deploy/kustomize/base/crds.yaml b/deploy/kustomize/base/crds.yaml index d7a34369a..d15534e46 100644 --- a/deploy/kustomize/base/crds.yaml +++ b/deploy/kustomize/base/crds.yaml @@ -654,6 +654,7 @@ spec: database: type: string editable: + description: Deprecated field. Please, remove it from your manifests type: boolean isDefault: type: boolean @@ -663,6 +664,7 @@ spec: name: type: string orgId: + description: Deprecated field. Please, remove it from your manifests format: int64 type: integer secureJsonData: diff --git a/docs/docs/api.md b/docs/docs/api.md index e3f8100a3..ef88ef1f2 100644 --- a/docs/docs/api.md +++ b/docs/docs/api.md @@ -1475,7 +1475,7 @@ GrafanaDatasourceSpec defines the desired state of GrafanaDatasource