Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <[email protected]>
  • Loading branch information
odubajDT committed Nov 16, 2023
1 parent a6cc964 commit 11df26a
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 41 deletions.
4 changes: 2 additions & 2 deletions chart/open-feature-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ The command removes all the Kubernetes components associated with the chart and
| Name | Description | Value |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
| `sidecarConfiguration.port` | Sets the value of the `XXX_PORT` environment variable for the injected sidecar. | `8013` |
| `sidecarConfiguration.metricsPort` | Sets the value of the `XXX_METRICS_PORT` environment variable for the injected sidecar. | `8014` |
| `sidecarConfiguration.managementPort` | Sets the value of the `XXX_MANAGEMENT_PORT` environment variable for the injected sidecar. | `8014` |
| `sidecarConfiguration.socketPath` | Sets the value of the `XXX_SOCKET_PATH` environment variable for the injected sidecar. | `""` |
| `sidecarConfiguration.image.repository` | Sets the image for the injected sidecar. | `ghcr.io/open-feature/flagd` |
| `sidecarConfiguration.image.tag` | Sets the version tag for the injected sidecar. | `v0.7.0` |
Expand All @@ -114,7 +114,7 @@ The command removes all the Kubernetes components associated with the chart and
| Name | Description | Value |
| ------------------------------------------ | ------------------------------------------------------------------------------- | ---------------------------------- |
| `flagdProxyConfiguration.port` | Sets the port to expose the sync API on. | `8015` |
| `flagdProxyConfiguration.metricsPort` | Sets the port to expose the metrics API on. | `8016` |
| `flagdProxyConfiguration.managementPort` | Sets the port to expose the management API on. | `8016` |
| `flagdProxyConfiguration.image.repository` | Sets the image for the flagd-proxy deployment. | `ghcr.io/open-feature/flagd-proxy` |
| `flagdProxyConfiguration.image.tag` | Sets the tag for the flagd-proxy deployment. | `v0.2.8` |
| `flagdProxyConfiguration.debugLogging` | Controls the addition of the `--debug` flag to the container startup arguments. | `false` |
Expand Down
8 changes: 4 additions & 4 deletions chart/open-feature-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ defaultNamespace: open-feature-operator-system
sidecarConfiguration:
## @param sidecarConfiguration.port Sets the value of the `XXX_PORT` environment variable for the injected sidecar.
port: 8013
## @param sidecarConfiguration.metricsPort Sets the value of the `XXX_METRICS_PORT` environment variable for the injected sidecar.
metricsPort: 8014
## @param sidecarConfiguration.managementPort Sets the value of the `XXX_MANAGEMENT_PORT` environment variable for the injected sidecar.
managementPort: 8014
## @param sidecarConfiguration.socketPath Sets the value of the `XXX_SOCKET_PATH` environment variable for the injected sidecar.
socketPath: ""
image:
Expand Down Expand Up @@ -40,8 +40,8 @@ sidecarConfiguration:
flagdProxyConfiguration:
## @param flagdProxyConfiguration.port Sets the port to expose the sync API on.
port: 8015
## @param flagdProxyConfiguration.metricsPort Sets the port to expose the metrics API on.
metricsPort: 8016
## @param flagdProxyConfiguration.managementPort Sets the port to expose the management API on.
managementPort: 8016
image:
## @param flagdProxyConfiguration.image.repository Sets the image for the flagd-proxy deployment.
repository: "ghcr.io/open-feature/flagd-proxy"
Expand Down
12 changes: 6 additions & 6 deletions common/flagdinjector/flagdinjector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -948,12 +948,12 @@ func intPtr(i int64) *int64 {

func getProxyConfig() *flagdproxy.FlagdProxyConfiguration {
return &flagdproxy.FlagdProxyConfiguration{
Port: 8013,
MetricsPort: 8014,
DebugLogging: false,
Image: "flagd",
Tag: "0.5.0",
Namespace: "my-namespace",
Port: 8013,
ManagementPort: 8014,
DebugLogging: false,
Image: "flagd",
Tag: "0.5.0",
Namespace: "my-namespace",
}
}

Expand Down
38 changes: 19 additions & 19 deletions common/flagdproxy/flagdproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ const (
FlagdProxyServiceAccountName = "open-feature-operator-flagd-proxy"
FlagdProxyServiceName = "flagd-proxy-svc"
// renovate: datasource=github-tags depName=open-feature/flagd/flagd-proxy
DefaultFlagdProxyTag = "v0.3.0"
DefaultFlagdProxyImage = "ghcr.io/open-feature/flagd-proxy"
DefaultFlagdProxyPort = 8015
DefaultFlagdProxyMetricsPort = 8016
DefaultFlagdProxyDebugLogging = false
DefaultFlagdProxyNamespace = "open-feature-operator-system"

envVarPodNamespace = "POD_NAMESPACE"
envVarProxyImage = "FLAGD_PROXY_IMAGE"
envVarProxyTag = "FLAGD_PROXY_TAG"
envVarProxyPort = "FLAGD_PROXY_PORT"
envVarProxyMetricsPort = "FLAGD_PROXY_METRICS_PORT"
envVarProxyDebugLogging = "FLAGD_PROXY_DEBUG_LOGGING"
operatorDeploymentName = "open-feature-operator-controller-manager"
DefaultFlagdProxyTag = "v0.3.0"
DefaultFlagdProxyImage = "ghcr.io/open-feature/flagd-proxy"
DefaultFlagdProxyPort = 8015
DefaultFlagdProxyManagementPort = 8016
DefaultFlagdProxyDebugLogging = false
DefaultFlagdProxyNamespace = "open-feature-operator-system"

envVarPodNamespace = "POD_NAMESPACE"
envVarProxyImage = "FLAGD_PROXY_IMAGE"
envVarProxyTag = "FLAGD_PROXY_TAG"
envVarProxyPort = "FLAGD_PROXY_PORT"
envVarProxyManagementPort = "FLAGD_PROXY_MANAGEMENT_PORT"
envVarProxyDebugLogging = "FLAGD_PROXY_DEBUG_LOGGING"
operatorDeploymentName = "open-feature-operator-controller-manager"
)

type FlagdProxyHandler struct {
Expand All @@ -45,7 +45,7 @@ type FlagdProxyHandler struct {

type FlagdProxyConfiguration struct {
Port int
MetricsPort int
ManagementPort int
DebugLogging bool
Image string
Tag string
Expand Down Expand Up @@ -78,11 +78,11 @@ func NewFlagdProxyConfiguration() (*FlagdProxyConfiguration, error) {
}
config.Port = port

metricsPort, err := utils.GetIntEnvVar(envVarProxyMetricsPort, DefaultFlagdProxyMetricsPort)
managementPort, err := utils.GetIntEnvVar(envVarProxyManagementPort, DefaultFlagdProxyManagementPort)
if err != nil {
return config, err
}
config.MetricsPort = metricsPort
config.ManagementPort = managementPort

kpDebugLogging, err := utils.GetBoolEnvVar(envVarProxyDebugLogging, DefaultFlagdProxyDebugLogging)
if err != nil {
Expand Down Expand Up @@ -164,7 +164,7 @@ func (f *FlagdProxyHandler) newFlagdProxyManifest(ownerReferences []metav1.Owner
args := []string{
"start",
"--metrics-port",
fmt.Sprintf("%d", f.config.MetricsPort),
fmt.Sprintf("%d", f.config.ManagementPort),
}
if f.config.DebugLogging {
args = append(args, "--debug")
Expand Down Expand Up @@ -209,7 +209,7 @@ func (f *FlagdProxyHandler) newFlagdProxyManifest(ownerReferences []metav1.Owner
},
{
Name: "metrics-port",
ContainerPort: int32(f.config.MetricsPort),
ContainerPort: int32(f.config.ManagementPort),
},
},
Args: args,
Expand Down
6 changes: 3 additions & 3 deletions common/flagdproxy/flagdproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestNewFlagdProxyConfiguration(t *testing.T) {
require.NotNil(t, kpConfig)
require.Equal(t, &FlagdProxyConfiguration{
Port: 8015,
MetricsPort: 8016,
ManagementPort: 8016,
DebugLogging: false,
Image: DefaultFlagdProxyImage,
Tag: DefaultFlagdProxyTag,
Expand All @@ -35,7 +35,7 @@ func TestNewFlagdProxyConfiguration_OverrideEnvVars(t *testing.T) {
t.Setenv(envVarProxyTag, "my-tag")
t.Setenv(envVarPodNamespace, "my-namespace")
t.Setenv(envVarProxyPort, "8080")
t.Setenv(envVarProxyMetricsPort, "8081")
t.Setenv(envVarProxyManagementPort, "8081")
t.Setenv(envVarProxyDebugLogging, "true")

kpConfig, err := NewFlagdProxyConfiguration()
Expand All @@ -44,7 +44,7 @@ func TestNewFlagdProxyConfiguration_OverrideEnvVars(t *testing.T) {
require.NotNil(t, kpConfig)
require.Equal(t, &FlagdProxyConfiguration{
Port: 8080,
MetricsPort: 8081,
ManagementPort: 8081,
DebugLogging: true,
Image: "my-image",
Tag: "my-tag",
Expand Down
4 changes: 2 additions & 2 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: controller
newTag: latest
newName: docker.io/odubajdt/operator
newTag: beta99
8 changes: 4 additions & 4 deletions config/overlays/helm/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ spec:
cpu: "{{ .Values.controllerManager.manager.resources.requests.cpu }}"
memory: "{{ .Values.controllerManager.manager.resources.requests.memory }}"
env:
- name: SIDECAR_METRICS_PORT
value: "{{ .Values.sidecarConfiguration.metricsPort }}"
- name: SIDECAR_MANAGEMENT_PORT
value: "{{ .Values.sidecarConfiguration.managementPort }}"
- name: SIDECAR_PORT
value: "{{ .Values.sidecarConfiguration.port }}"
- name: SIDECAR_SOCKET_PATH
Expand All @@ -46,8 +46,8 @@ spec:
value: "{{ .Values.flagdProxyConfiguration.image.tag }}"
- name: FLAGD_PROXY_PORT
value: "{{ .Values.flagdProxyConfiguration.port }}"
- name: FLAGD_PROXY_METRICS_PORT
value: "{{ .Values.flagdProxyConfiguration.metricsPort }}"
- name: FLAGD_PROXY_MANAGEMENT_PORT
value: "{{ .Values.flagdProxyConfiguration.managementPort }}"
- name: FLAGD_PROXY_DEBUG_LOGGING
value: "{{ .Values.flagdProxyConfiguration.debugLogging }}"
- name: kube-rbac-proxy
Expand Down
2 changes: 1 addition & 1 deletion config/samples/core_v1beta1_featureflagsource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: FeatureFlagSource
metadata:
name: featureflagsource-sample
spec:
metricsPort: 8080
managementPort: 8080
evaluator: json
defaultSyncProvider: file
tag: latest
Expand Down

0 comments on commit 11df26a

Please sign in to comment.