Skip to content

Commit 7befa71

Browse files
authored
docs: Default Grafana version in CRDs + Release Artifacts in new Versioning doc (#2257)
* feat(Grafana): Add default version to manifest field description * docs: Versioning page with some links and explanations * feat(Make): Update versioning doc with `prep-release` target
1 parent e8cd651 commit 7befa71

File tree

7 files changed

+47
-7
lines changed

7 files changed

+47
-7
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ manifests: $(CONTROLLER_GEN) $(KUSTOMIZE) $(YQ) ## Generate WebhookConfiguration
6969
# Remove CRD descriptions under Grafana#.spec.deployment
7070
$(YQ) -i '.spec.versions[] |= del(.schema.openAPIV3Schema.properties.spec.properties.deployment.properties | .. | select(has("description")).description)' config/crd/bases/grafana.integreatly.org_grafanas.yaml
7171
$(YQ) -i '.spec.versions[] |= del(.schema.openAPIV3Schema.properties.spec.properties.deployment.properties | .. | select(has("description")).description)' deploy/helm/grafana-operator/files/crds/grafana.integreatly.org_grafanas.yaml
72+
$(YQ) -i '.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.version.description += "\ndefault: $(GRAFANA_VERSION)"' config/crd/bases/grafana.integreatly.org_grafanas.yaml
73+
$(YQ) -i '.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.version.description += "\ndefault: $(GRAFANA_VERSION)"' deploy/helm/grafana-operator/files/crds/grafana.integreatly.org_grafanas.yaml
7274

7375
$(YQ) -i '(select(.kind == "Deployment") | .spec.template.spec.containers[0].env[] | select (.name == "RELATED_IMAGE_GRAFANA")).value="$(GRAFANA_IMAGE):$(GRAFANA_VERSION)"' config/manager/manager.yaml
7476

@@ -334,5 +336,6 @@ prep-release: $(YQ)
334336
$(YQ) -i '.params.version="v$(VERSION)"' hugo/config.yaml
335337
sed -i 's/--version v5.*/--version v$(VERSION)/g' README.md
336338
sed -i 's/^VERSION ?= 5.*/VERSION ?= $(VERSION)/g' Makefile
339+
grep -q "$(GRAFANA_VERSION)" docs/docs/versioning.md || sed -Ei 's/\|-\|-\|/|-|-|\n| \`v$(VERSION)\` | \`$(GRAFANA_VERSION)\` |/' docs/docs/versioning.md
337340
$(YQ) -i '.images[0].newTag="v$(VERSION)"' deploy/kustomize/base/kustomization.yaml
338341
make helm-docs

api/v1beta1/grafana_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ type GrafanaSpec struct {
7373
Route *RouteOpenshiftV1 `json:"route,omitempty"`
7474
// Service sets how the service object should look like with your grafana instance, contains a number of defaults.
7575
Service *ServiceV1 `json:"service,omitempty"`
76-
// Version specifies the version of Grafana to use for this deployment. It follows the same format as the docker.io/grafana/grafana tags
76+
// Version sets the tag of the default image: docker.io/grafana/grafana.
77+
// Allows full image refs with/without sha256checksum: "registry/repo/image:tag@sha"
7778
Version string `json:"version,omitempty"`
7879
// Deployment sets how the deployment object should look like with your grafana instance, contains a number of defaults.
7980
Deployment *DeploymentV1 `json:"deployment,omitempty"`

config/crd/bases/grafana.integreatly.org_grafanas.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5094,7 +5094,10 @@ spec:
50945094
description: Suspend pauses reconciliation of owned resources like deployments, Services, Etc. upon changes
50955095
type: boolean
50965096
version:
5097-
description: Version specifies the version of Grafana to use for this deployment. It follows the same format as the docker.io/grafana/grafana tags
5097+
description: |-
5098+
Version sets the tag of the default image: docker.io/grafana/grafana.
5099+
Allows full image refs with/without sha256checksum: "registry/repo/image:tag@sha"
5100+
default: 12.2.1
50985101
type: string
50995102
type: object
51005103
status:

deploy/helm/grafana-operator/files/crds/grafana.integreatly.org_grafanas.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5094,7 +5094,10 @@ spec:
50945094
description: Suspend pauses reconciliation of owned resources like deployments, Services, Etc. upon changes
50955095
type: boolean
50965096
version:
5097-
description: Version specifies the version of Grafana to use for this deployment. It follows the same format as the docker.io/grafana/grafana tags
5097+
description: |-
5098+
Version sets the tag of the default image: docker.io/grafana/grafana.
5099+
Allows full image refs with/without sha256checksum: "registry/repo/image:tag@sha"
5100+
default: 12.2.1
50985101
type: string
50995102
type: object
51005103
status:

deploy/kustomize/base/crds.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8500,9 +8500,10 @@ spec:
85008500
deployments, Services, Etc. upon changes
85018501
type: boolean
85028502
version:
8503-
description: Version specifies the version of Grafana to use for this
8504-
deployment. It follows the same format as the docker.io/grafana/grafana
8505-
tags
8503+
description: |-
8504+
Version sets the tag of the default image: docker.io/grafana/grafana.
8505+
Allows full image refs with/without sha256checksum: "registry/repo/image:tag@sha"
8506+
default: 12.2.1
85068507
type: string
85078508
type: object
85088509
status:

docs/docs/api.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6389,7 +6389,9 @@ GrafanaSpec defines the desired state of Grafana
63896389
<td><b>version</b></td>
63906390
<td>string</td>
63916391
<td>
6392-
Version specifies the version of Grafana to use for this deployment. It follows the same format as the docker.io/grafana/grafana tags<br/>
6392+
Version sets the tag of the default image: docker.io/grafana/grafana.
6393+
Allows full image refs with/without sha256checksum: "registry/repo/image:tag@sha"
6394+
default: 12.2.1<br/>
63936395
</td>
63946396
<td>false</td>
63956397
</tr></tbody>

docs/docs/versioning.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Versioning
3+
weight: 60
4+
---
5+
6+
The Grafana version when unspecified in `Grafana#spec.version`
7+
8+
| Operator Version | Default Grafana Image |
9+
|-|-|
10+
| `v5.20.0` | `12.2.0` |
11+
| `v5.19.0` | `12.1.0` |
12+
| `v5.16.0` | `11.3.0` |
13+
| `v5.9.2` | `10.4.3` |
14+
| `v5.7.0` | `9.5.17` |
15+
| `v5.0.0` | `9.1.6` |
16+
17+
## Published Artifacts and Changelogs
18+
19+
Changelogs are published under [Github Releases](https://github.com/grafana/grafana-operator/releases/).
20+
21+
Previous artifacts are available under [Github Packages](https://github.com/orgs/grafana/packages?repo_name=grafana-operator).
22+
23+
| Type | Source |
24+
| ----------------- | ---------------------------------------------------- |
25+
| Docker Image | `ghcr.io/grafana/grafana-operator` |
26+
| Helm Chart | `oci://ghcr.io/grafana/helm-charts/grafana-operator` |
27+
| Flux OCI Artifact | `ghcr.io/grafana/kustomize/grafana-operator` |

0 commit comments

Comments
 (0)