Skip to content

Commit

Permalink
ci: use renovate for Gateway and KIC versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed May 31, 2024
1 parent 8f38b0e commit 7a2641b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
11 changes: 8 additions & 3 deletions .github/ISSUE_TEMPLATE/---release.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ If the troubleshooting section does not contain the answer to the problem you en

## Verify default hardcoded versions

The package [internal/consts][consts-pkg] contains a list of default versions for the operator. These versions should be updated to match the new release. The example consts to look for:
> **NOTE**: These versions should be automatically updated via Renovate.
> As part of the release workflow please verify that this is indeed the case and the automation still works.
The packages [internal/consts][consts-pkg] and [pkg/versions][versions-pkg] contains a list of default versions for the operator.
These versions should be updated to match the new release. The example consts to look for:

- `DefaultDataPlaneTag`
- `DefaultControlPlaneTag`
- `DefaultControlPlaneVersion`
- `WebhookCertificateConfigBaseImage`

## GitHub PAT
Expand Down Expand Up @@ -88,5 +92,6 @@ Steps:

[releases]: https://github.com/Kong/gateway-operator/releases
[release-action]: https://github.com/Kong/gateway-operator/actions/workflows/release.yaml
[consts-pkg]: https://github.com/Kong/gateway-operator/blob/main/internal/consts/consts.go
[consts-pkg]: https://github.com/Kong/gateway-operator/blob/main/pkg/consts/consts.go
[versions-pkg]: https://github.com/Kong/gateway-operator/blob/main/internal/versions/
[kgo-prs]: https://github.com/Kong/gateway-operator/pulls
3 changes: 1 addition & 2 deletions internal/versions/controlplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import (

const (
// DefaultControlPlaneVersion is the default version of the ControlPlane to use.
// TODO: automatically update this via renovate https://github.com/Kong/gateway-operator/issues/121
//
// NOTE: This needs to be a full semver version (i.e. it needs to include
// the minor and the patch version). The reason for this is that it's used in the
// tests, e.g. https://github.com/Kong/gateway-operator/blob/02bd1e11243/test/e2e/environment_test.go#L201-L206
// and those tests create KIC's URLs for things like roles or CRDs.
// Since KIC only defines the full tags in its repo (as expected) we cannot use
// a partial version here, as it would not match KIC's tag.
DefaultControlPlaneVersion = "3.1.3"
DefaultControlPlaneVersion = "3.1.3" // renovate: datasource=docker depName=kong/kubernetes-ingress-controller
)

// minimumControlPlaneVersion indicates the bare minimum version of the
Expand Down
2 changes: 1 addition & 1 deletion pkg/consts/dataplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const (
// DefaultDataPlaneTag is the base container image tag that can be used
// by default for a DataPlane resource if all other attempts to dynamically
// decide an image tag fail.
DefaultDataPlaneTag = "3.6" // TODO: automatically update this via renovate https://github.com/Kong/gateway-operator/issues/121
DefaultDataPlaneTag = "3.6" // renovate: datasource=docker depName=kong/kong-gateway

// DefaultDataPlaneImage is the default container image that can be used if
// all other attempts to dynamically decide the default image fail.
Expand Down
12 changes: 12 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)\\n.+\"(?<currentValue>.*?)\""
]
},
{
"description": "Match versions in pkg/consts/dataplane.go that are properly annotated with `# renovate: datasource={} versioning={}.`",
"customType": "regex",
"datasourceTemplate": "docker",
"fileMatch": [
"^pkg/consts/dataplane\\.go$",
"^internal/versions/controlplane\\.go$"
],
"matchStrings": [
".+\\s+=\\s+\"(?<currentValue>.+)\"\\s+//\\s+renovate:\\s+datasource=(?<datasource>.*)\\s+(?<depName>.+?)"
]
}
]
}

0 comments on commit 7a2641b

Please sign in to comment.