Skip to content

Commit d0b556d

Browse files
committed
Merge branch 'renovate/gcr.io-kubebuilder-kube-rbac-proxy-0.x' of github.com:open-feature/open-feature-operator into renovate/gcr.io-kubebuilder-kube-rbac-proxy-0.x
2 parents 57bd440 + 2462b1c commit d0b556d

27 files changed

+438
-445
lines changed

.github/workflows/pr-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- '**.md'
1212
env:
1313
# Default minimum version of Go to support.
14-
DEFAULT_GO_VERSION: 1.18
14+
DEFAULT_GO_VERSION: 1.19
1515

1616
permissions:
1717
contents: read

.github/workflows/release-please.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
env:
99
# Default minimum version of Go to support.
10-
DEFAULT_GO_VERSION: 1.18
10+
DEFAULT_GO_VERSION: 1.19
1111
REGISTRY: ghcr.io
1212
IMAGE_NAME: ${{ github.repository }}
1313
GITHUB_PAGES_BRANCH: gh-pages

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# These owners will be the default owners for everything in
22
# the repo. Unless a later match takes precedence
3-
* @AlexsJones @beeme1mr
3+
* @AlexsJones @beeme1mr @skyerus

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ IMG ?= controller:latest
44
# customize overlay to be used in the build, DEFAULT or HELM
55
KUSTOMIZE_OVERLAY ?= DEFAULT
66
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
7-
FLAGD_VERSION=v0.2.5
7+
FLAGD_VERSION=v0.2.7
88
CHART_VERSION=v0.2.20# x-release-please-version
99
ENVTEST_K8S_VERSION = 1.25
1010

@@ -71,7 +71,7 @@ test: manifests generate fmt vet envtest ## Run tests.
7171
e2e-test: manifests generate fmt vet
7272
kubectl -n open-feature-operator-system apply -f ./test/e2e/e2e.yml
7373
kubectl wait --for=condition=Available=True deploy --all -n 'open-feature-operator-system'
74-
./test/e2e/e2e.sh '{"value":true,"reason":"DEFAULT","variant":"on"}'
74+
./test/e2e/run.sh
7575

7676
.PHONY: lint
7777
lint:

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ _Requires [cert manager](https://cert-manager.io/docs/installation/kubernetes/)
2020

2121
## Helm
2222

23+
Install cert manager (if not already installed):
24+
```
25+
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.9.1/cert-manager.yaml
26+
```
27+
Install helm charts:
2328
```
2429
helm repo add openfeature https://open-feature.github.io/open-feature-operator/
2530
```
@@ -124,15 +129,16 @@ spec:
124129
```
125130

126131
1. Reference the CR within the pod spec annotations
132+
The `openfeature.dev/featureflagconfiguration` annotation is a comma separated list of CR references, listed as `{namespace}/{name}`. e.g. `"default/featureflagconfiguration-sample, test/featureflagconfiguration-sample-2"`. If no namespace is defined, it is assumed that the flag configuration is in the same namespace as the deployed pod.
127133

128134
```
129135
apiVersion: v1
130136
kind: Pod
131137
metadata:
132138
name: nginx
133139
annotations:
134-
openfeature.dev: "enabled"
135-
openfeature.dev/featureflagconfiguration: "featureflagconfiguration-sample"
140+
openfeature.dev/enabled: "true"
141+
openfeature.dev/featureflagconfiguration: "default/featureflagconfiguration-sample"
136142
spec:
137143
containers:
138144
- name: nginx

apis/core/v1alpha1/featureflagconfiguration_types.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ limitations under the License.
1717
package v1alpha1
1818

1919
import (
20+
"fmt"
21+
2022
"github.com/open-feature/open-feature-operator/pkg/utils"
2123
corev1 "k8s.io/api/core/v1"
2224
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -51,12 +53,31 @@ type FlagDSpec struct {
5153

5254
type FeatureFlagSyncProvider struct {
5355
Name string `json:"name"`
56+
// +optional
57+
// +nullable
58+
HttpSyncConfiguration *HttpSyncConfiguration `json:"httpSyncConfiguration"`
59+
}
60+
61+
// HttpSyncConfiguration defines the desired configuration for a http sync
62+
type HttpSyncConfiguration struct {
63+
// Target is the target url for flagd to poll
64+
Target string `json:"target"`
65+
// +optional
66+
BearerToken string `json:"bearerToken,omitempty"`
5467
}
5568

5669
func (ffsp FeatureFlagSyncProvider) IsKubernetes() bool {
5770
return ffsp.Name == "kubernetes"
5871
}
5972

73+
func (ffsp FeatureFlagSyncProvider) IsHttp() bool {
74+
return ffsp.Name == "http"
75+
}
76+
77+
func (ffsp FeatureFlagSyncProvider) IsFilepath() bool {
78+
return ffsp.Name == "filepath"
79+
}
80+
6081
type FeatureFlagServiceProvider struct {
6182
// +kubebuilder:validation:Enum=flagd
6283
Name string `json:"name"`
@@ -118,7 +139,7 @@ func GenerateFfConfigMap(name string, namespace string, references []metav1.Owne
118139
OwnerReferences: references,
119140
},
120141
Data: map[string]string{
121-
"config.json": spec.FeatureFlagSpec,
142+
fmt.Sprintf("%s.json", name): spec.FeatureFlagSpec,
122143
},
123144
}
124145
}

apis/core/v1alpha1/zz_generated.deepcopy.go

Lines changed: 21 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/core/v1alpha2/featureflagconfiguration_conversion.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package v1alpha2
1919
import (
2020
"encoding/json"
2121
"fmt"
22+
2223
"github.com/open-feature/open-feature-operator/apis/core/v1alpha1"
2324
ctrl "sigs.k8s.io/controller-runtime"
2425
"sigs.k8s.io/controller-runtime/pkg/conversion"
@@ -43,6 +44,12 @@ func (src *FeatureFlagConfiguration) ConvertTo(dstRaw conversion.Hub) error {
4344

4445
if src.Spec.SyncProvider != nil {
4546
dst.Spec.SyncProvider = &v1alpha1.FeatureFlagSyncProvider{Name: src.Spec.SyncProvider.Name}
47+
if src.Spec.SyncProvider.HttpSyncConfiguration != nil {
48+
dst.Spec.SyncProvider.HttpSyncConfiguration = &v1alpha1.HttpSyncConfiguration{
49+
Target: src.Spec.SyncProvider.HttpSyncConfiguration.Target,
50+
BearerToken: src.Spec.SyncProvider.HttpSyncConfiguration.BearerToken,
51+
}
52+
}
4653
}
4754

4855
if src.Spec.FlagDSpec != nil {
@@ -71,7 +78,15 @@ func (dst *FeatureFlagConfiguration) ConvertFrom(srcRaw conversion.Hub) error {
7178
}
7279

7380
if src.Spec.SyncProvider != nil {
74-
dst.Spec.SyncProvider = &FeatureFlagSyncProvider{Name: src.Spec.SyncProvider.Name}
81+
dst.Spec.SyncProvider = &FeatureFlagSyncProvider{
82+
Name: src.Spec.SyncProvider.Name,
83+
}
84+
if src.Spec.SyncProvider.HttpSyncConfiguration != nil {
85+
dst.Spec.SyncProvider.HttpSyncConfiguration = &HttpSyncConfiguration{
86+
Target: src.Spec.SyncProvider.HttpSyncConfiguration.Target,
87+
BearerToken: src.Spec.SyncProvider.HttpSyncConfiguration.BearerToken,
88+
}
89+
}
7590
}
7691

7792
if src.Spec.FlagDSpec != nil {

apis/core/v1alpha2/featureflagconfiguration_types.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package v1alpha2
1818

1919
import (
2020
"encoding/json"
21+
2122
"github.com/open-feature/open-feature-operator/pkg/utils"
2223
corev1 "k8s.io/api/core/v1"
2324
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -75,6 +76,17 @@ type FlagSpec struct {
7576

7677
type FeatureFlagSyncProvider struct {
7778
Name string `json:"name"`
79+
// +optional
80+
// +nullable
81+
HttpSyncConfiguration *HttpSyncConfiguration `json:"httpSyncConfiguration"`
82+
}
83+
84+
// HttpSyncConfiguration defines the desired configuration for a http sync
85+
type HttpSyncConfiguration struct {
86+
// Target is the target url for flagd to poll
87+
Target string `json:"target"`
88+
// +optional
89+
BearerToken string `json:"bearerToken,omitempty"`
7890
}
7991

8092
func (ffsp FeatureFlagSyncProvider) IsKubernetes() bool {
@@ -95,6 +107,7 @@ type FeatureFlagConfigurationStatus struct {
95107
// Important: Run "make" to regenerate code after modifying this file
96108
}
97109

110+
//+kubebuilder:resource:shortName="ff"
98111
//+kubebuilder:object:root=true
99112
//+kubebuilder:subresource:status
100113

apis/core/v1alpha2/zz_generated.deepcopy.go

Lines changed: 21 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)