Skip to content

Commit 318c52d

Browse files
chore: fix file source documentation (#556)
Signed-off-by: Kavindu Dodanduwa <[email protected]> Co-authored-by: Todd Baert <[email protected]>
1 parent ccb8c1d commit 318c52d

File tree

11 files changed

+21
-19
lines changed

11 files changed

+21
-19
lines changed

apis/core/v1beta1/featureflagsource_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ type Source struct {
115115
// Source is a URI of the flag sources
116116
Source string `json:"source"`
117117

118-
// Provider type - kubernetes, http(s), grpc(s) or filepath
118+
// Provider type - kubernetes, http(s), grpc(s) or file
119119
// +optional
120120
Provider common.SyncProviderType `json:"provider"`
121121

chart/open-feature-operator/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ The command removes all the Kubernetes components associated with the chart and
101101
| `sidecarConfiguration.image.tag` | Sets the version tag for the injected sidecar. | `v0.7.0` |
102102
| `sidecarConfiguration.providerArgs` | Used to append arguments to the sidecar startup command. This value is a comma separated string of key values separated by '=', e.g. `key=value,key2=value2` results in the appending of `--sync-provider-args key=value --sync-provider-args key2=value2`. | `""` |
103103
| `sidecarConfiguration.envVarPrefix` | Sets the prefix for all environment variables set in the injected sidecar. | `FLAGD` |
104-
| `sidecarConfiguration.defaultSyncProvider` | Sets the value of the `XXX_SYNC_PROVIDER` environment variable for the injected sidecar container. There are 4 valid sync providers: `kubernetes`, `grpc`, `filepath` and `http`. | `kubernetes` |
104+
| `sidecarConfiguration.defaultSyncProvider` | Sets the value of the `XXX_SYNC_PROVIDER` environment variable for the injected sidecar container. There are 4 valid sync providers: `kubernetes`, `grpc`, `file` and `http`. | `kubernetes` |
105105
| `sidecarConfiguration.evaluator` | Sets the value of the `XXX_EVALUATOR` environment variable for the injected sidecar container. | `json` |
106106
| `sidecarConfiguration.logFormat` | Sets the value of the `XXX_LOG_FORMAT` environment variable for the injected sidecar container. There are 2 valid log formats: `json` and `console`. | `json` |
107107
| `sidecarConfiguration.probesEnabled` | Enable or Disable Liveness and Readiness probes of the flagd sidecar. When enabled, HTTP probes( paths - `/readyz`, `/healthz`) are set with an initial delay of 5 seconds. | `true` |

chart/open-feature-operator/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ sidecarConfiguration:
2121
providerArgs: ""
2222
## @param sidecarConfiguration.envVarPrefix Sets the prefix for all environment variables set in the injected sidecar.
2323
envVarPrefix: "FLAGD"
24-
## @param sidecarConfiguration.defaultSyncProvider Sets the value of the `XXX_SYNC_PROVIDER` environment variable for the injected sidecar container. There are 4 valid sync providers: `kubernetes`, `grpc`, `filepath` and `http`.
24+
## @param sidecarConfiguration.defaultSyncProvider Sets the value of the `XXX_SYNC_PROVIDER` environment variable for the injected sidecar container. There are 4 valid sync providers: `kubernetes`, `grpc`, `file` and `http`.
2525
defaultSyncProvider: kubernetes
2626
## @param sidecarConfiguration.evaluator Sets the value of the `XXX_EVALUATOR` environment variable for the injected sidecar container.
2727
evaluator: json

common/flagdinjector/flagdinjector.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,7 @@ func (fi *FlagdContainerInjector) toFilepathProviderConfig(ctx context.Context,
280280
})
281281

282282
return types.SourceConfig{
283-
URI: fmt.Sprintf("%s/%s", mountPath, utils.FeatureFlagConfigMapKey(ns, n)),
284-
// todo - this constant needs to be aligned with flagd. We have a mixed usage of file vs filepath
283+
URI: fmt.Sprintf("%s/%s", mountPath, utils.FeatureFlagConfigMapKey(ns, n)),
285284
Provider: "file",
286285
}, nil
287286
}

config/crd/bases/core.openfeature.dev_featureflagsources.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ spec:
254254
type: string
255255
provider:
256256
description: Provider type - kubernetes, http(s), grpc(s) or
257-
filepath
257+
file
258258
type: string
259259
providerID:
260260
description: ProviderID is an identifier to be used in grpc

docs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ flowchart TD
2121
A[Pod]-->|Annotation: openfeature.dev/featureflagsource| B[FeatureFlagSource CR]
2222
B--> |Flag source| C[FeatureFlag CR]
2323
B--> |Flag source| D[HTTP sync]
24-
B--> |Flag source| E[Filepath sync]
24+
B--> |Flag source| E[File sync]
2525
B--> |Flag source| F[GRPC sync]
2626
B--> |Flag source| G[flagd-proxy]
2727
```

docs/concepts.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ The high level architecture of the operator is as follows:
1515

1616
- Kubernetes: sync configuration that configures injected flagd sidecar instances to monitor the Kubernetes API
1717
for changes in flag definition custom resources (`FeatureFlag`).
18-
- filepath: sync configuration that creates and mounts ConfigMap files from flag configuration custom resources
19-
(`FeatureFlag`) and configures injected flagd sidecar instances to monitor them.
18+
- file: sync configuration that creates and mounts ConfigMap files from flag configuration custom resources (`FeatureFlag`) and configures injected flagd sidecar instances to source them.
2019
- grpc: sync configuration that listens for flagd compatible grpc stream
2120
- http: sync configuration which watch and periodically poll flagd compatible http endpoint
2221
- [flagd-proxy](./flagd_proxy.md)
@@ -38,7 +37,7 @@ able to fetch Feature Flag information. For further information on how to avoid
3837

3938
**When deploying an application via GitOps, we recommend using the `flagd-proxy` mode, which doesn't suffer from the shortcomings above.**
4039

41-
The `"filepath"` provider requires no such communication, but relies on the fact that [Kubernetes automatically updates mounted ConfigMaps](https://kubernetes.io/docs/concepts/configuration/configmap/#mounted-configmaps-are-updated-automatically).
40+
The `"file"` provider requires no such communication, but relies on the fact that [Kubernetes automatically updates mounted ConfigMaps](https://kubernetes.io/docs/concepts/configuration/configmap/#mounted-configmaps-are-updated-automatically).
4241
The disadvantage of this approach is that flag configuration updates may take as long as two minutes to propagate, depending on cluster configuration:
4342

4443
> "the total delay from the moment when the ConfigMap is updated to the moment when new keys are projected to the Pod can be as long as the kubelet sync period + cache propagation delay"

docs/crds.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ FeatureFlagSourceSpec defines the desired state of FeatureFlagSource
403403
<td><b>provider</b></td>
404404
<td>string</td>
405405
<td>
406-
Provider type - kubernetes, http(s), grpc(s) or filepath<br/>
406+
Provider type - kubernetes, http(s), grpc(s) or file<br/>
407407
</td>
408408
<td>false</td>
409409
</tr><tr>

docs/feature_flag_source.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,17 @@ This source type is useful when there is a need for restricting workload permiss
4444

4545
Read more about proxy approach to access kubernetes resources: [flagd-proxy](./flagd_proxy.md)
4646

47-
### filepath
47+
### file
4848

49-
Injected sidecar can use volume mounted files as flag sources.
50-
For this, provider type `filepath` is used as below example,
49+
In this mode, `FeatureFlag` custom resources are volume mounted to the injected flagd sidecar.
50+
flagd then source flag configurations from this volume.
51+
52+
For example, given `FeatureFlag` exist at `flags/sample-flags`, this source configuration look like below,
5153

5254
```yaml
5355
sources:
54-
- source: /etc/flagd/config.json
55-
provider: filepath
56+
- source: flags/sample-flags
57+
provider: file
5658
```
5759

5860
### http
@@ -125,7 +127,7 @@ spec:
125127
port: 80
126128
evaluator: json
127129
image: my-custom-sidecar-image
128-
defaultSyncProvider: filepath
130+
defaultSyncProvider: file
129131
tag: main
130132
sources:
131133
- source: namespace/name

docs/permissions.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ The definition of this role can be found [here](../config/rbac//leader_election_
1919

2020
### Manager Role
2121

22-
The `manager-role` applies the rules described below, its definition can be found [here](../config/rbac/role.yaml). It provides the operator with sufficient permissions over the `core.openfeature.dev` resources, and the required permissions for injecting the `flagd` sidecar into appropriate pods. The `ConfigMap` permissions are needed to allow the mounting of `FeatureFlag` resources for filepath syncs.
22+
The `manager-role` applies the rules described below, its definition can be found [here](../config/rbac/role.yaml).
23+
It provides the operator with sufficient permissions over the `core.openfeature.dev` resources, and the required permissions for injecting the `flagd` sidecar into appropriate pods.
24+
The `ConfigMap` permissions are needed to allow the mounting of `FeatureFlag` resources for file syncs.
2325

2426
| API Group | Resource | Verbs |
2527
|-----------------------------|---------------------------------------|-------------------------------------------------|

docs/threat_model.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ flowchart LR
110110

111111
`flagd` makes an authenticated http request to retrieve its initial flag configuration state from the CR. Subsequently, it registers an event handler to listen to changes to the CR. The configuration is at threat of information disclosure and tampering, the security control is authentication.
112112

113-
##### filepath sync provider
113+
##### file sync provider
114114

115115
```mermaid
116116
flowchart LR

0 commit comments

Comments
 (0)