Skip to content

Commit

Permalink
chore: generalize renovate configuration (#495)
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Wiesinger <moritz.wiesinger@dynatrace.com>
  • Loading branch information
mowies committed Jul 6, 2023
1 parent 09dcbc1 commit 1ec3183
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 108 deletions.
63 changes: 32 additions & 31 deletions apis/core/v1alpha1/flagsourceconfiguration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,33 @@ import (
type SyncProviderType string

const (
SidecarEnvVarPrefix string = "SIDECAR_ENV_VAR_PREFIX"
InputConfigurationEnvVarPrefix string = "SIDECAR"
SidecarMetricPortEnvVar string = "METRICS_PORT"
SidecarPortEnvVar string = "PORT"
SidecarSocketPathEnvVar string = "SOCKET_PATH"
SidecarEvaluatorEnvVar string = "EVALUATOR"
SidecarImageEnvVar string = "IMAGE"
SidecarVersionEnvVar string = "TAG"
SidecarProviderArgsEnvVar string = "PROVIDER_ARGS"
SidecarDefaultSyncProviderEnvVar string = "SYNC_PROVIDER"
SidecarLogFormatEnvVar string = "LOG_FORMAT"
SidecarProbesEnabledVar string = "PROBES_ENABLED"
defaultSidecarEnvVarPrefix string = "FLAGD"
DefaultMetricPort int32 = 8014
defaultPort int32 = 8013
defaultSocketPath string = ""
defaultEvaluator string = "json"
defaultImage string = "ghcr.io/open-feature/flagd"
defaultTag string = "v0.5.4"
defaultLogFormat string = "json"
defaultProbesEnabled bool = true
SyncProviderKubernetes SyncProviderType = "kubernetes"
SyncProviderFilepath SyncProviderType = "filepath"
SyncProviderHttp SyncProviderType = "http"
SyncProviderGrpc SyncProviderType = "grpc"
SyncProviderFlagdProxy SyncProviderType = "flagd-proxy"
SidecarEnvVarPrefix string = "SIDECAR_ENV_VAR_PREFIX"
InputConfigurationEnvVarPrefix string = "SIDECAR"
SidecarMetricPortEnvVar string = "METRICS_PORT"
SidecarPortEnvVar string = "PORT"
SidecarSocketPathEnvVar string = "SOCKET_PATH"
SidecarEvaluatorEnvVar string = "EVALUATOR"
SidecarImageEnvVar string = "IMAGE"
SidecarVersionEnvVar string = "TAG"
SidecarProviderArgsEnvVar string = "PROVIDER_ARGS"
SidecarDefaultSyncProviderEnvVar string = "SYNC_PROVIDER"
SidecarLogFormatEnvVar string = "LOG_FORMAT"
SidecarProbesEnabledVar string = "PROBES_ENABLED"
defaultSidecarEnvVarPrefix string = "FLAGD"
DefaultMetricPort int32 = 8014
defaultPort int32 = 8013
defaultSocketPath string = ""
defaultEvaluator string = "json"
defaultImage string = "ghcr.io/open-feature/flagd"
// renovate: datasource=github-tags depName=open-feature/flagd/flagd
defaultTag string = "v0.5.4"
defaultLogFormat string = "json"
defaultProbesEnabled bool = true
SyncProviderKubernetes SyncProviderType = "kubernetes"
SyncProviderFilepath SyncProviderType = "filepath"
SyncProviderHttp SyncProviderType = "http"
SyncProviderGrpc SyncProviderType = "grpc"
SyncProviderFlagdProxy SyncProviderType = "flagd-proxy"
)

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

//+kubebuilder:resource:shortName="fsc"
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:storageversion
// +kubebuilder:resource:shortName="fsc"
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion

// FlagSourceConfiguration is the Schema for the FlagSourceConfigurations API
type FlagSourceConfiguration struct {
Expand All @@ -178,7 +179,7 @@ type FlagSourceConfiguration struct {
Status FlagSourceConfigurationStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true
// +kubebuilder:object:root=true

// FlagSourceConfigurationList contains a list of FlagSourceConfiguration
type FlagSourceConfigurationList struct {
Expand Down
11 changes: 6 additions & 5 deletions controllers/common/flagd-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ import (
)

const (
ManagedByAnnotationValue = "open-feature-operator"
FlagdProxyDeploymentName = "flagd-proxy"
FlagdProxyServiceAccountName = "open-feature-operator-flagd-proxy"
FlagdProxyServiceName = "flagd-proxy-svc"
DefaultFlagdProxyTag = "v0.2.2" //FLAGD_PROXY_TAG_RENOVATE
ManagedByAnnotationValue = "open-feature-operator"
FlagdProxyDeploymentName = "flagd-proxy"
FlagdProxyServiceAccountName = "open-feature-operator-flagd-proxy"
FlagdProxyServiceName = "flagd-proxy-svc"
// renovate: datasource=github-tags depName=open-feature/flagd/flagd-proxy
DefaultFlagdProxyTag = "v0.2.2"
DefaultFlagdProxyImage = "ghcr.io/open-feature/flagd-proxy"
DefaultFlagdProxyPort = 8015
DefaultFlagdProxyMetricsPort = 8016
Expand Down
92 changes: 20 additions & 72 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
],
"kubernetes": {
"fileMatch": [
"^chart/templates/rendered\\.yaml$",
"^config/default/.*-patch\\.yaml$",
"^chart/templates/rendered\\.ya?ml$",
"^config/default/.*-patch\\.ya?ml$",
"test\\/.*\\.ya?ml$"
]
},
Expand All @@ -22,34 +22,26 @@
"^.*open-feature/flagd.*$"
],
"groupName": "open-feature/flagd"
}
],
"regexManagers": [
{
"fileMatch": ["^apis/core/.*/flagsourceconfiguration_types.go$"],
"matchStrings": ["defaultTag\\s*string\\s*= \"(?<currentValue>.*?)\"\\s"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd/(?<version>.*)$"
},
{
"fileMatch": ["^chart/open-feature-operator/values.yaml$"],
"matchStrings": ["repository: \"ghcr\\.io\/open-feature\/flagd\"\\n\\s*tag: (?<currentValue>.*?)\\s"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd/(?<version>.*)$"
"matchDepNames": [
"open-feature/flagd",
"open-feature/flagd/flagd"
],
"extractVersion": "^flagd/(?<version>.*?)$"
},
{
"fileMatch": ["^chart/open-feature-operator/README.md$"],
"matchStrings": ["current flagd version: \\`(?<currentValue>.*?)\\`"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd/(?<version>.*)$"
},
"matchDepNames": [
"open-feature/flagd-proxy",
"open-feature/flagd/flagd-proxy"
],
"extractVersion": "^flagd-proxy/(?<version>.*?)$"
}
],
"regexManagers": [
{
"fileMatch": [
"^docs/getting_started.md$",
"^test/e2e/kuttl/inject-flagd/01-assert.yaml$"
"^docs/getting_started.md$"
],
"matchStrings": ["ghcr\\.io\\/open-feature\\/flagd:(?<currentValue>.*?)\\s"],
"depNameTemplate": "open-feature/flagd",
Expand All @@ -62,57 +54,13 @@
"(^|\\/)Dockerfile",
"(^|\\/).*\\.ya?ml$",
"(^|\\/).*\\.toml$",
"(^|\\/).*\\.sh$"
"(^|\\/).*\\.sh$",
"^controllers/common/flagd-proxy.go$",
"^apis/core/.*/flagsourceconfiguration_types.go$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.+?) depName=(?<depName>.+?)\\s.*?_VERSION ?(\\??=|\\: ?) ?\\\"?(?<currentValue>.+?)?\\\"?\\s"
"(#|\\/\\/) renovate: datasource=(?<datasource>.+?) depName=(?<depName>.+?)\\s.*?(?<separator>\\??=|\\: ?) ?\\\"?(?<currentValue>.+?)?\\\"?\\s"
]
},
{
"fileMatch": ["^controllers/core/flagsourceconfiguration/flagd-proxy.go$"],
"matchStrings": ["\"(?<currentValue>.*?)\" \\/\\/FLAGD_PROXY_TAG_RENOVATE"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
},
{
"fileMatch": ["^chart/open-feature-operator/values.yaml$"],
"matchStrings": ["repository: \"ghcr\\.io\/open-feature\/flagd-proxy\"\\n\\s*tag: (?<currentValue>.*?)\\s"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
},
{
"fileMatch": ["^chart/open-feature-operator/README.md$"],
"matchStrings": ["current flagd-proxy version: \\`(?<currentValue>.*?)\\`"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
},
{
"fileMatch": [
"^test/e2e/kuttl/fsconfig-flagd-proxy-sync/00-install.yaml$",
"^test/e2e/kuttl/fsconfig-flagd-proxy-sync/01-assert.yaml$",
"^test/e2e/kuttl/fsconfig-k8s-sync/00-install.yaml$",
"^test/e2e/kuttl/fsconfig-k8s-sync/01-assert.yaml$",
"^test/e2e/kuttl/fsconfig-file-sync/00-install.yaml$",
"^test/e2e/kuttl/fsconfig-file-sync/01-assert.yaml$"
],
"matchStrings": ["image: ghcr\\.io\/open-feature\/flagd:(?<currentValue>.*?)\\s"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
},
{
"fileMatch": [
"^test/e2e/kuttl/fsconfig-flagd-proxy-sync/00-install.yaml$",
"^test/e2e/kuttl/fsconfig-k8s-sync/00-install.yaml$",
"^test/e2e/kuttl/fsconfig-file-sync/00-install.yaml$"
],
"matchStrings": ["tag: (?<currentValue>.*?)\\s"],
"depNameTemplate": "open-feature/flagd",
"datasourceTemplate": "github-releases",
"extractVersionTemplate": "^flagd-proxy/(?<version>.*)$"
}
]
}
1 change: 1 addition & 0 deletions test/e2e/kuttl/fsconfig-file-sync/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ spec:
metricsPort: 8080
evaluator: json
defaultSyncProvider: filepath
# renovate: datasource=github-tags depName=open-feature/flagd/flagd
tag: v0.5.4
sources:
- source: end-to-end-test
Expand Down
1 change: 1 addition & 0 deletions test/e2e/kuttl/fsconfig-flagd-proxy-sync/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ spec:
metricsPort: 8080
evaluator: json
defaultSyncProvider: flagd-proxy
# renovate: datasource=github-tags depName=open-feature/flagd/flagd
tag: v0.5.4
sources:
- source: end-to-end-test
Expand Down
1 change: 1 addition & 0 deletions test/e2e/kuttl/fsconfig-k8s-sync/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ spec:
metricsPort: 8080
evaluator: json
defaultSyncProvider: kubernetes
# renovate: datasource=github-tags depName=open-feature/flagd/flagd
tag: v0.5.4
sources:
- source: end-to-end-test
Expand Down

0 comments on commit 1ec3183

Please sign in to comment.