-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: odubajDT <[email protected]>
- Loading branch information
Showing
9 changed files
with
785 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ CHART_VERSION=v0.5.4# x-release-please-version | |
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. | ||
ENVTEST_K8S_VERSION = 1.26.1 | ||
WAIT_TIMEOUT_SECONDS?=60 | ||
PUBLIC_JSON_SCHEMA_DIR=apis/core/v1beta1/schema | ||
|
||
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) | ||
ifeq (,$(shell go env GOBIN)) | ||
|
@@ -256,3 +257,14 @@ install-mockgen: | |
go install github.com/golang/mock/[email protected] | ||
mockgen: install-mockgen | ||
mockgen -source=controllers/common/flagd-injector.go -destination=controllers/common/mock/flagd-injector.go -package=commonmock | ||
|
||
.PHONY: pull-schemas-submodule | ||
pull-schemas-submodule: | ||
git submodule update | ||
|
||
# Update the schema at flagd.dev | ||
# PUBLIC_JSON_SCHEMA_DIR above controls the dir (and therefore major version) | ||
.PHONY: update-public-schema | ||
update-public-schema: pull-schemas-submodule | ||
rm -f $(PUBLIC_JSON_SCHEMA_DIR)*.json | ||
cp apis/flagd-schemas/json/*.json $(PUBLIC_JSON_SCHEMA_DIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
{ | ||
"$id": "https://flagd.dev/schema/v0/flags.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "flagd Flag Configuration", | ||
"description": "Defines flags for use in flagd, including typed variants and rules", | ||
"type": "object", | ||
"properties": { | ||
"flags": { | ||
"title": "Flags", | ||
"description": "Top-level flags object. All flags are defined here.", | ||
"type": "object", | ||
"$comment": "flag objects are one of the 4 flag types defined in $defs", | ||
"additionalProperties": false, | ||
"patternProperties": { | ||
"^.{1,}$": { | ||
"oneOf": [ | ||
{ | ||
"title": "Boolean flag", | ||
"description": "A flag having boolean values.", | ||
"$ref": "#/$defs/booleanFlag" | ||
}, | ||
{ | ||
"title": "String flag", | ||
"description": "A flag having string values.", | ||
"$ref": "#/$defs/stringFlag" | ||
}, | ||
{ | ||
"title": "Numeric flag", | ||
"description": "A flag having numeric values.", | ||
"$ref": "#/$defs/numberFlag" | ||
}, | ||
{ | ||
"title": "Object flag", | ||
"description": "A flag having arbitrary object values.", | ||
"$ref": "#/$defs/objectFlag" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"$evaluators": { | ||
"title": "Evaluators", | ||
"description": "Reusable targeting rules that can be referenced with \"$ref\": \"myRule\" in multiple flags.", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"patternProperties": { | ||
"^.{1,}$": { | ||
"$comment": "this relative ref means that targeting.json MUST be in the same dir, or available on the same HTTP path", | ||
"$ref": "./targeting.json#/$defs/targeting" | ||
} | ||
} | ||
} | ||
}, | ||
"$defs": { | ||
"flag": { | ||
"$comment": "base flag object; no title/description here, allows for better UX, keep it in the overrides", | ||
"type": "object", | ||
"properties": { | ||
"state": { | ||
"title": "Flag State", | ||
"description": "Indicates whether the flag is functional. Disabled flags are treated as if they don't exist.", | ||
"type": "string", | ||
"enum": [ | ||
"ENABLED", | ||
"DISABLED" | ||
] | ||
}, | ||
"defaultVariant": { | ||
"title": "Default Variant", | ||
"description": "The variant to serve if no dynamic targeting applies (including if the targeting returns null).", | ||
"type": "string" | ||
}, | ||
"targeting": { | ||
"$ref": "./targeting.json#/$defs/targeting" | ||
} | ||
}, | ||
"required": [ | ||
"state", | ||
"defaultVariant" | ||
] | ||
}, | ||
"booleanVariants": { | ||
"type": "object", | ||
"properties": { | ||
"variants": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"patternProperties": { | ||
"^.{1,}$": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"default": { | ||
"true": true, | ||
"false": false | ||
} | ||
} | ||
} | ||
}, | ||
"stringVariants": { | ||
"type": "object", | ||
"properties": { | ||
"variants": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"patternProperties": { | ||
"^.{1,}$": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"numberVariants": { | ||
"type": "object", | ||
"properties": { | ||
"variants": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"patternProperties": { | ||
"^.{1,}$": { | ||
"type": "number" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"objectVariants": { | ||
"type": "object", | ||
"properties": { | ||
"variants": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"patternProperties": { | ||
"^.{1,}$": { | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"$comment": "merge the variants with the base flag to build our typed flags", | ||
"booleanFlag": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/$defs/flag" | ||
}, | ||
{ | ||
"$ref": "#/$defs/booleanVariants" | ||
} | ||
] | ||
}, | ||
"stringFlag": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/$defs/flag" | ||
}, | ||
{ | ||
"$ref": "#/$defs/stringVariants" | ||
} | ||
] | ||
}, | ||
"numberFlag": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/$defs/flag" | ||
}, | ||
{ | ||
"$ref": "#/$defs/numberVariants" | ||
} | ||
] | ||
}, | ||
"objectFlag": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/$defs/flag" | ||
}, | ||
{ | ||
"$ref": "#/$defs/objectVariants" | ||
} | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.