Skip to content

Commit

Permalink
fix: removed old prefix from flagd-proxy provider config (#463)
Browse files Browse the repository at this point in the history
Signed-off-by: James Milligan <james@omnant.co.uk>
  • Loading branch information
james-milligan authored Apr 12, 2023
1 parent e0d639a commit 39a99c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webhooks/pod_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func (m *PodMutator) buildSources(ctx context.Context, flagSourceConfig *v1alpha
case source.Provider.IsGrpc():
sourceCfg = m.toGrpcProviderConfig(source)
case source.Provider.IsFlagdProxy():
sourceCfg, err = m.handleFlagdProxy(ctx, pod, source)
sourceCfg, err = m.toFlagdProxyConfig(ctx, pod, source)
if err != nil {
return []types.SourceConfig{}, err
}
Expand Down Expand Up @@ -427,7 +427,7 @@ func (m *PodMutator) isFlagdProxyReady(ctx context.Context) (bool, bool, error)
return true, true, nil
}

func (m *PodMutator) handleFlagdProxy(ctx context.Context, pod *corev1.Pod, source v1alpha1.Source) (types.SourceConfig, error) {
func (m *PodMutator) toFlagdProxyConfig(ctx context.Context, pod *corev1.Pod, source v1alpha1.Source) (types.SourceConfig, error) {
// does the proxy exist
exists, ready, err := m.isFlagdProxyReady(ctx)
if err != nil {
Expand All @@ -440,7 +440,7 @@ func (m *PodMutator) handleFlagdProxy(ctx context.Context, pod *corev1.Pod, sour
return types.SourceConfig{
Provider: "grpc",
Selector: fmt.Sprintf("core.openfeature.dev/%s/%s", ns, n),
URI: fmt.Sprintf("grpc://%s.%s.svc.cluster.local:%d", controllers.FlagdProxyServiceName, m.FlagdProxyConfig.Namespace, m.FlagdProxyConfig.Port),
URI: fmt.Sprintf("%s.%s.svc.cluster.local:%d", controllers.FlagdProxyServiceName, m.FlagdProxyConfig.Namespace, m.FlagdProxyConfig.Port),
}, nil
}

Expand Down

0 comments on commit 39a99c6

Please sign in to comment.