Skip to content

OpenFeatureOperator CRDs library #482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions libs/openfeature/config.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# libs/<name>/config.jsonnet
local config = import 'jsonnet/config.jsonnet';
local versions = [
{ tag: "v0.8.1", version: "0.8" },
{ tag: "v0.7.2", version: "0.7" },
{ tag: "v0.6.1", version: "0.6" },
{ tag: "v0.5.7", version: "0.5" },
{ tag: "v0.2.36", version: "0.2" },
{ tag: "v0.1.1", version: "0.1" },
{ tag: "v0.0.9", version: "0.0" },
];

config.new(
name='openfeature',
specs=[
{
output: v.version,
crds: ['https://github.com/open-feature/open-feature-operator/releases/download/%s/release.yaml' % v.tag] ,
prefix: '^dev\\.openfeature\\.core\\..*',
localName: 'openfeature',
},
for v in versions
]
)
14 changes: 14 additions & 0 deletions pkg/builder/objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package builder

import (
"fmt"
"log"
"strings"
)

Expand Down Expand Up @@ -82,6 +83,7 @@ func (o ObjectType) ConciseString() string {

func printChildren(children map[string]Type, order []string, s string) string {
j := ""
order = removeStringsWithDollar(order)
for _, name := range order {
c := children[name]
colon := ":"
Expand Down Expand Up @@ -119,3 +121,15 @@ func printChildren(children map[string]Type, order []string, s string) string {
j = strings.TrimSuffix(j, s)
return j
}

func removeStringsWithDollar(input []string) []string {
var result []string
for _, str := range input {
if !strings.Contains(str, "$") {
result = append(result, str)
} else {
log.Default().Printf("Warning: %s contains a '$' and has been ommited from final libsonnet as a temporary fix", str)
}
}
return result
}
Comment on lines +125 to +135
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before merging I'll check if this has some side-effects, will be busy the next week but should have time after

Loading