Skip to content

Commit 1ec3183

Browse files
authored
chore: generalize renovate configuration (#495)
Signed-off-by: Moritz Wiesinger <[email protected]>
1 parent 09dcbc1 commit 1ec3183

File tree

6 files changed

+61
-108
lines changed

6 files changed

+61
-108
lines changed

apis/core/v1alpha1/flagsourceconfiguration_types.go

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,33 @@ import (
3030
type SyncProviderType string
3131

3232
const (
33-
SidecarEnvVarPrefix string = "SIDECAR_ENV_VAR_PREFIX"
34-
InputConfigurationEnvVarPrefix string = "SIDECAR"
35-
SidecarMetricPortEnvVar string = "METRICS_PORT"
36-
SidecarPortEnvVar string = "PORT"
37-
SidecarSocketPathEnvVar string = "SOCKET_PATH"
38-
SidecarEvaluatorEnvVar string = "EVALUATOR"
39-
SidecarImageEnvVar string = "IMAGE"
40-
SidecarVersionEnvVar string = "TAG"
41-
SidecarProviderArgsEnvVar string = "PROVIDER_ARGS"
42-
SidecarDefaultSyncProviderEnvVar string = "SYNC_PROVIDER"
43-
SidecarLogFormatEnvVar string = "LOG_FORMAT"
44-
SidecarProbesEnabledVar string = "PROBES_ENABLED"
45-
defaultSidecarEnvVarPrefix string = "FLAGD"
46-
DefaultMetricPort int32 = 8014
47-
defaultPort int32 = 8013
48-
defaultSocketPath string = ""
49-
defaultEvaluator string = "json"
50-
defaultImage string = "ghcr.io/open-feature/flagd"
51-
defaultTag string = "v0.5.4"
52-
defaultLogFormat string = "json"
53-
defaultProbesEnabled bool = true
54-
SyncProviderKubernetes SyncProviderType = "kubernetes"
55-
SyncProviderFilepath SyncProviderType = "filepath"
56-
SyncProviderHttp SyncProviderType = "http"
57-
SyncProviderGrpc SyncProviderType = "grpc"
58-
SyncProviderFlagdProxy SyncProviderType = "flagd-proxy"
33+
SidecarEnvVarPrefix string = "SIDECAR_ENV_VAR_PREFIX"
34+
InputConfigurationEnvVarPrefix string = "SIDECAR"
35+
SidecarMetricPortEnvVar string = "METRICS_PORT"
36+
SidecarPortEnvVar string = "PORT"
37+
SidecarSocketPathEnvVar string = "SOCKET_PATH"
38+
SidecarEvaluatorEnvVar string = "EVALUATOR"
39+
SidecarImageEnvVar string = "IMAGE"
40+
SidecarVersionEnvVar string = "TAG"
41+
SidecarProviderArgsEnvVar string = "PROVIDER_ARGS"
42+
SidecarDefaultSyncProviderEnvVar string = "SYNC_PROVIDER"
43+
SidecarLogFormatEnvVar string = "LOG_FORMAT"
44+
SidecarProbesEnabledVar string = "PROBES_ENABLED"
45+
defaultSidecarEnvVarPrefix string = "FLAGD"
46+
DefaultMetricPort int32 = 8014
47+
defaultPort int32 = 8013
48+
defaultSocketPath string = ""
49+
defaultEvaluator string = "json"
50+
defaultImage string = "ghcr.io/open-feature/flagd"
51+
// renovate: datasource=github-tags depName=open-feature/flagd/flagd
52+
defaultTag string = "v0.5.4"
53+
defaultLogFormat string = "json"
54+
defaultProbesEnabled bool = true
55+
SyncProviderKubernetes SyncProviderType = "kubernetes"
56+
SyncProviderFilepath SyncProviderType = "filepath"
57+
SyncProviderHttp SyncProviderType = "http"
58+
SyncProviderGrpc SyncProviderType = "grpc"
59+
SyncProviderFlagdProxy SyncProviderType = "flagd-proxy"
5960
)
6061

6162
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
@@ -164,10 +165,10 @@ type FlagSourceConfigurationStatus struct {
164165
// Important: Run "make" to regenerate code after modifying this file
165166
}
166167

167-
//+kubebuilder:resource:shortName="fsc"
168-
//+kubebuilder:object:root=true
169-
//+kubebuilder:subresource:status
170-
//+kubebuilder:storageversion
168+
// +kubebuilder:resource:shortName="fsc"
169+
// +kubebuilder:object:root=true
170+
// +kubebuilder:subresource:status
171+
// +kubebuilder:storageversion
171172

172173
// FlagSourceConfiguration is the Schema for the FlagSourceConfigurations API
173174
type FlagSourceConfiguration struct {
@@ -178,7 +179,7 @@ type FlagSourceConfiguration struct {
178179
Status FlagSourceConfigurationStatus `json:"status,omitempty"`
179180
}
180181

181-
//+kubebuilder:object:root=true
182+
// +kubebuilder:object:root=true
182183

183184
// FlagSourceConfigurationList contains a list of FlagSourceConfiguration
184185
type FlagSourceConfigurationList struct {

controllers/common/flagd-proxy.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ import (
1717
)
1818

1919
const (
20-
ManagedByAnnotationValue = "open-feature-operator"
21-
FlagdProxyDeploymentName = "flagd-proxy"
22-
FlagdProxyServiceAccountName = "open-feature-operator-flagd-proxy"
23-
FlagdProxyServiceName = "flagd-proxy-svc"
24-
DefaultFlagdProxyTag = "v0.2.2" //FLAGD_PROXY_TAG_RENOVATE
20+
ManagedByAnnotationValue = "open-feature-operator"
21+
FlagdProxyDeploymentName = "flagd-proxy"
22+
FlagdProxyServiceAccountName = "open-feature-operator-flagd-proxy"
23+
FlagdProxyServiceName = "flagd-proxy-svc"
24+
// renovate: datasource=github-tags depName=open-feature/flagd/flagd-proxy
25+
DefaultFlagdProxyTag = "v0.2.2"
2526
DefaultFlagdProxyImage = "ghcr.io/open-feature/flagd-proxy"
2627
DefaultFlagdProxyPort = 8015
2728
DefaultFlagdProxyMetricsPort = 8016

renovate.json

Lines changed: 20 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
],
1212
"kubernetes": {
1313
"fileMatch": [
14-
"^chart/templates/rendered\\.yaml$",
15-
"^config/default/.*-patch\\.yaml$",
14+
"^chart/templates/rendered\\.ya?ml$",
15+
"^config/default/.*-patch\\.ya?ml$",
1616
"test\\/.*\\.ya?ml$"
1717
]
1818
},
@@ -22,34 +22,26 @@
2222
"^.*open-feature/flagd.*$"
2323
],
2424
"groupName": "open-feature/flagd"
25-
}
26-
],
27-
"regexManagers": [
28-
{
29-
"fileMatch": ["^apis/core/.*/flagsourceconfiguration_types.go$"],
30-
"matchStrings": ["defaultTag\\s*string\\s*= \"(?<currentValue>.*?)\"\\s"],
31-
"depNameTemplate": "open-feature/flagd",
32-
"datasourceTemplate": "github-releases",
33-
"extractVersionTemplate": "^flagd/(?<version>.*)$"
3425
},
3526
{
36-
"fileMatch": ["^chart/open-feature-operator/values.yaml$"],
37-
"matchStrings": ["repository: \"ghcr\\.io\/open-feature\/flagd\"\\n\\s*tag: (?<currentValue>.*?)\\s"],
38-
"depNameTemplate": "open-feature/flagd",
39-
"datasourceTemplate": "github-releases",
40-
"extractVersionTemplate": "^flagd/(?<version>.*)$"
27+
"matchDepNames": [
28+
"open-feature/flagd",
29+
"open-feature/flagd/flagd"
30+
],
31+
"extractVersion": "^flagd/(?<version>.*?)$"
4132
},
4233
{
43-
"fileMatch": ["^chart/open-feature-operator/README.md$"],
44-
"matchStrings": ["current flagd version: \\`(?<currentValue>.*?)\\`"],
45-
"depNameTemplate": "open-feature/flagd",
46-
"datasourceTemplate": "github-releases",
47-
"extractVersionTemplate": "^flagd/(?<version>.*)$"
48-
},
34+
"matchDepNames": [
35+
"open-feature/flagd-proxy",
36+
"open-feature/flagd/flagd-proxy"
37+
],
38+
"extractVersion": "^flagd-proxy/(?<version>.*?)$"
39+
}
40+
],
41+
"regexManagers": [
4942
{
5043
"fileMatch": [
51-
"^docs/getting_started.md$",
52-
"^test/e2e/kuttl/inject-flagd/01-assert.yaml$"
44+
"^docs/getting_started.md$"
5345
],
5446
"matchStrings": ["ghcr\\.io\\/open-feature\\/flagd:(?<currentValue>.*?)\\s"],
5547
"depNameTemplate": "open-feature/flagd",
@@ -62,57 +54,13 @@
6254
"(^|\\/)Dockerfile",
6355
"(^|\\/).*\\.ya?ml$",
6456
"(^|\\/).*\\.toml$",
65-
"(^|\\/).*\\.sh$"
57+
"(^|\\/).*\\.sh$",
58+
"^controllers/common/flagd-proxy.go$",
59+
"^apis/core/.*/flagsourceconfiguration_types.go$"
6660
],
6761
"matchStrings": [
68-
"# renovate: datasource=(?<datasource>.+?) depName=(?<depName>.+?)\\s.*?_VERSION ?(\\??=|\\: ?) ?\\\"?(?<currentValue>.+?)?\\\"?\\s"
62+
"(#|\\/\\/) renovate: datasource=(?<datasource>.+?) depName=(?<depName>.+?)\\s.*?(?<separator>\\??=|\\: ?) ?\\\"?(?<currentValue>.+?)?\\\"?\\s"
6963
]
70-
},
71-
{
72-
"fileMatch": ["^controllers/core/flagsourceconfiguration/flagd-proxy.go$"],
73-
"matchStrings": ["\"(?<currentValue>.*?)\" \\/\\/FLAGD_PROXY_TAG_RENOVATE"],
74-
"depNameTemplate": "open-feature/flagd",
75-
"datasourceTemplate": "github-releases",
76-
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
77-
},
78-
{
79-
"fileMatch": ["^chart/open-feature-operator/values.yaml$"],
80-
"matchStrings": ["repository: \"ghcr\\.io\/open-feature\/flagd-proxy\"\\n\\s*tag: (?<currentValue>.*?)\\s"],
81-
"depNameTemplate": "open-feature/flagd",
82-
"datasourceTemplate": "github-releases",
83-
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
84-
},
85-
{
86-
"fileMatch": ["^chart/open-feature-operator/README.md$"],
87-
"matchStrings": ["current flagd-proxy version: \\`(?<currentValue>.*?)\\`"],
88-
"depNameTemplate": "open-feature/flagd",
89-
"datasourceTemplate": "github-releases",
90-
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
91-
},
92-
{
93-
"fileMatch": [
94-
"^test/e2e/kuttl/fsconfig-flagd-proxy-sync/00-install.yaml$",
95-
"^test/e2e/kuttl/fsconfig-flagd-proxy-sync/01-assert.yaml$",
96-
"^test/e2e/kuttl/fsconfig-k8s-sync/00-install.yaml$",
97-
"^test/e2e/kuttl/fsconfig-k8s-sync/01-assert.yaml$",
98-
"^test/e2e/kuttl/fsconfig-file-sync/00-install.yaml$",
99-
"^test/e2e/kuttl/fsconfig-file-sync/01-assert.yaml$"
100-
],
101-
"matchStrings": ["image: ghcr\\.io\/open-feature\/flagd:(?<currentValue>.*?)\\s"],
102-
"depNameTemplate": "open-feature/flagd",
103-
"datasourceTemplate": "github-releases",
104-
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
105-
},
106-
{
107-
"fileMatch": [
108-
"^test/e2e/kuttl/fsconfig-flagd-proxy-sync/00-install.yaml$",
109-
"^test/e2e/kuttl/fsconfig-k8s-sync/00-install.yaml$",
110-
"^test/e2e/kuttl/fsconfig-file-sync/00-install.yaml$"
111-
],
112-
"matchStrings": ["tag: (?<currentValue>.*?)\\s"],
113-
"depNameTemplate": "open-feature/flagd",
114-
"datasourceTemplate": "github-releases",
115-
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
11664
}
11765
]
11866
}

test/e2e/kuttl/fsconfig-file-sync/00-install.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ spec:
77
metricsPort: 8080
88
evaluator: json
99
defaultSyncProvider: filepath
10+
# renovate: datasource=github-tags depName=open-feature/flagd/flagd
1011
tag: v0.5.4
1112
sources:
1213
- source: end-to-end-test

test/e2e/kuttl/fsconfig-flagd-proxy-sync/00-install.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ spec:
77
metricsPort: 8080
88
evaluator: json
99
defaultSyncProvider: flagd-proxy
10+
# renovate: datasource=github-tags depName=open-feature/flagd/flagd
1011
tag: v0.5.4
1112
sources:
1213
- source: end-to-end-test

test/e2e/kuttl/fsconfig-k8s-sync/00-install.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ spec:
77
metricsPort: 8080
88
evaluator: json
99
defaultSyncProvider: kubernetes
10+
# renovate: datasource=github-tags depName=open-feature/flagd/flagd
1011
tag: v0.5.4
1112
sources:
1213
- source: end-to-end-test

0 commit comments

Comments
 (0)