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 c86833c commit a6cc964
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ CRDOC ?= $(LOCALBIN)/crdoc
KUSTOMIZE_VERSION ?= v4.5.7
# renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools
CONTROLLER_TOOLS_VERSION ?= v0.10.0
CRDOC_VERSION ?= v0.7.0
CRDOC_VERSION ?= v0.6.2

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand Down
22 changes: 9 additions & 13 deletions apis/core/v1beta1/common/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@ import (
"github.com/stretchr/testify/require"
)

func Test_FLagSourceConfiguration_EnvVarKey(t *testing.T) {
require.Equal(t, "pre_suf", EnvVarKey("pre", "suf"))
}

func Test_FLagSourceConfiguration_FeatureFlagConfigurationId(t *testing.T) {
require.Equal(t, "pre_suf", FeatureFlagConfigurationId("pre", "suf"))
}

func Test_FLagSourceConfiguration_FeatureFlagConfigMapKey(t *testing.T) {
require.Equal(t, "pre_suf.flagd.json", FeatureFlagConfigMapKey("pre", "suf"))
}

func Test_FeatureFlagSource_SyncProvider(t *testing.T) {
k := SyncProviderKubernetes
f := SyncProviderFilepath
Expand All @@ -35,6 +23,14 @@ func Test_FeatureFlagSource_SyncProvider(t *testing.T) {
require.False(t, g.IsHttp())
}

func Test_FLagSourceConfiguration_envVarKey(t *testing.T) {
func Test_FLagSourceConfiguration_EnvVarKey(t *testing.T) {
require.Equal(t, "pre_suf", EnvVarKey("pre", "suf"))
}

func Test_FLagSourceConfiguration_FeatureFlagConfigurationId(t *testing.T) {
require.Equal(t, "pre_suf", FeatureFlagConfigurationId("pre", "suf"))
}

func Test_FLagSourceConfiguration_FeatureFlagConfigMapKey(t *testing.T) {
require.Equal(t, "pre_suf.flagd.json", FeatureFlagConfigMapKey("pre", "suf"))
}
4 changes: 2 additions & 2 deletions common/flagdinjector/fake/flagdinjector_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions config/crd/bases/core.openfeature.dev_featureflagsources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ spec:
description: LogFormat allows for the sidecar log format to be overridden,
defaults to 'json'
type: string
metricsPort:
description: MetricsPort defines the port to serve metrics on, defaults
to 8014
managementPort:
description: ManagemetPort defines the port to serve management on,
defaults to 8014
format: int32
type: integer
otelCollectorUri:
Expand Down
4 changes: 2 additions & 2 deletions docs/crds.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,10 @@ FeatureFlagSourceSpec defines the desired state of FeatureFlagSource
</td>
<td>false</td>
</tr><tr>
<td><b>metricsPort</b></td>
<td><b>managementPort</b></td>
<td>integer</td>
<td>
MetricsPort defines the port to serve metrics on, defaults to 8014<br/>
ManagemetPort defines the port to serve management on, defaults to 8014<br/>
<br/>
<i>Format</i>: int32<br/>
</td>
Expand Down
5 changes: 0 additions & 5 deletions webhooks/pod_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ func (m *PodMutator) Handle(ctx context.Context, req admission.Request) admissio
return admission.Errored(http.StatusBadRequest, err)
}

//TODO check this
if pod.Namespace == "" {
pod.Namespace = req.Namespace
}

annotations := pod.GetAnnotations()
// Check enablement
if !checkOFEnabled(annotations) {
Expand Down

0 comments on commit a6cc964

Please sign in to comment.