Skip to content

Commit

Permalink
Merge branch 'main' into add-image-pull-secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
toddbaert authored Jun 3, 2024
2 parents ede9512 + aef1010 commit 5e4124c
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 20 deletions.
7 changes: 5 additions & 2 deletions apis/core/v1beta1/flagd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,19 @@ type IngressSpec struct {
PathType networkingv1.PathType `json:"pathType,omitempty"`

// FlagdPath is the path to be used for accessing the flagd flag evaluation API
// Default: /flagd.evaluation.v1.Service
// +optional
FlagdPath string `json:"flagdPath,omitempty"`

// OFREPPath is the path to be used for accessing the OFREP API
// Default: /ofrep
// +optional
OFREPPath string `json:"ofrepPath"`
OFREPPath string `json:"ofrepPath,omitempty"`

// SyncPath is the path to be used for accessing the sync API
// Default: /flagd.sync.v1.Service
// +optional
SyncPath string `json:"syncPath"`
SyncPath string `json:"syncPath,omitempty"`
}

// FlagdStatus defines the observed state of Flagd
Expand Down
15 changes: 9 additions & 6 deletions config/crd/bases/core.openfeature.dev_flagds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ spec:
description: Enabled enables/disables the ingress for flagd
type: boolean
flagdPath:
description: FlagdPath is the path to be used for accessing the
flagd flag evaluation API
description: |-
FlagdPath is the path to be used for accessing the flagd flag evaluation API
Default: /flagd.evaluation.v1.Service
type: string
hosts:
description: Hosts list of hosts to be added to the ingress
Expand All @@ -69,16 +70,18 @@ spec:
class to be used for flagd
type: string
ofrepPath:
description: OFREPPath is the path to be used for accessing the
OFREP API
description: |-
OFREPPath is the path to be used for accessing the OFREP API
Default: /ofrep
type: string
pathType:
description: PathType is the path type to be used for the ingress
rules
type: string
syncPath:
description: SyncPath is the path to be used for accessing the
sync API
description: |-
SyncPath is the path to be used for accessing the sync API
Default: /flagd.sync.v1.Service
type: string
tls:
description: TLS configuration for the ingress
Expand Down
6 changes: 3 additions & 3 deletions controllers/core/flagd/resources/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import (

api "github.com/open-feature/open-feature-operator/apis/core/v1beta1"
"github.com/open-feature/open-feature-operator/common"
"github.com/open-feature/open-feature-operator/controllers/core/flagd/common"
resources "github.com/open-feature/open-feature-operator/controllers/core/flagd/common"
networkingv1 "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)

const (
defaultFlagdPath = "/flagd"
defaultFlagdPath = "/flagd.evaluation.v1.Service"
defaultOFREPPath = "/ofrep"
defaultSyncPath = "/sync"
defaultSyncPath = "/flagd.sync.v1.Service"
)

type FlagdIngress struct {
Expand Down
8 changes: 4 additions & 4 deletions controllers/core/flagd/resources/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestFlagdIngress_getIngress(t *testing.T) {
HTTP: &networkingv1.HTTPIngressRuleValue{
Paths: []networkingv1.HTTPIngressPath{
{
Path: "/flagd",
Path: "/flagd.evaluation.v1.Service",
PathType: &pathType,
Backend: networkingv1.IngressBackend{
Service: &networkingv1.IngressServiceBackend{
Expand All @@ -97,7 +97,7 @@ func TestFlagdIngress_getIngress(t *testing.T) {
},
},
{
Path: "/sync",
Path: "/flagd.sync.v1.Service",
PathType: &pathType,
Backend: networkingv1.IngressBackend{
Service: &networkingv1.IngressServiceBackend{
Expand All @@ -119,7 +119,7 @@ func TestFlagdIngress_getIngress(t *testing.T) {
HTTP: &networkingv1.HTTPIngressRuleValue{
Paths: []networkingv1.HTTPIngressPath{
{
Path: "/flagd",
Path: "/flagd.evaluation.v1.Service",
PathType: &pathType,
Backend: networkingv1.IngressBackend{
Service: &networkingv1.IngressServiceBackend{
Expand All @@ -145,7 +145,7 @@ func TestFlagdIngress_getIngress(t *testing.T) {
},
},
{
Path: "/sync",
Path: "/flagd.sync.v1.Service",
PathType: &pathType,
Backend: networkingv1.IngressBackend{
Service: &networkingv1.IngressServiceBackend{
Expand Down
9 changes: 6 additions & 3 deletions docs/crds.md
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,8 @@ Ingress
<td><b>flagdPath</b></td>
<td>string</td>
<td>
FlagdPath is the path to be used for accessing the flagd flag evaluation API<br/>
FlagdPath is the path to be used for accessing the flagd flag evaluation API
Default: /flagd.evaluation.v1.Service<br/>
</td>
<td>false</td>
</tr><tr>
Expand All @@ -963,7 +964,8 @@ Ingress
<td><b>ofrepPath</b></td>
<td>string</td>
<td>
OFREPPath is the path to be used for accessing the OFREP API<br/>
OFREPPath is the path to be used for accessing the OFREP API
Default: /ofrep<br/>
</td>
<td>false</td>
</tr><tr>
Expand All @@ -977,7 +979,8 @@ Ingress
<td><b>syncPath</b></td>
<td>string</td>
<td>
SyncPath is the path to be used for accessing the sync API<br/>
SyncPath is the path to be used for accessing the sync API
Default: /flagd.sync.v1.Service<br/>
</td>
<td>false</td>
</tr><tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ spec:
name: flagd-sample
port:
number: 8013
path: /flagd
path: /flagd.evaluation.v1.Service
pathType: ImplementationSpecific
- backend:
service:
Expand All @@ -118,5 +118,5 @@ spec:
name: flagd-sample
port:
number: 8015
path: /sync
path: /flagd.sync.v1.Service
pathType: ImplementationSpecific

0 comments on commit 5e4124c

Please sign in to comment.