-
Notifications
You must be signed in to change notification settings - Fork 65
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
Added more memory tier with proper resource access #969
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,15 +41,15 @@ var expectedProdTiers = map[string]bool{ | |
} | ||
|
||
var expectedTestTiers = map[string]bool{ | ||
"advanced": true, // tier_name: true/false (if based on the other tier) | ||
"advanced": true, | ||
"base": false, | ||
"nocluster": false, | ||
"appstudio": false, | ||
} | ||
|
||
func nsTypes(tier string) []string { | ||
switch tier { | ||
case "appstudio": | ||
case "appstudio", "appstudiolarge": | ||
return []string{"tenant"} | ||
case "appstudio-env": | ||
return []string{"env"} | ||
|
@@ -62,7 +62,7 @@ func nsTypes(tier string) []string { | |
|
||
func roles(tier string) []string { | ||
switch tier { | ||
case "appstudio", "appstudio-env": | ||
case "appstudio", "appstudiolarge", "appstudio-env": | ||
return []string{"admin", "maintainer", "contributor"} | ||
default: | ||
return []string{"admin"} | ||
|
@@ -173,7 +173,7 @@ func TestLoadTemplatesByTiers(t *testing.T) { | |
tmpls, err := loadTemplatesByTiers(assets) | ||
// then | ||
require.NoError(t, err) | ||
require.Len(t, tmpls, 4) | ||
require.Len(t, tmpls, 4) // advanced,appstudio,base,nocluster | ||
require.NotContains(t, "foo", tmpls) // make sure that the `foo: bar` entry was ignored | ||
|
||
for _, tier := range tiers(expectedTestTiers) { | ||
|
@@ -599,11 +599,27 @@ func assertNamespaceTemplate(t *testing.T, decoder runtime.Decoder, actual templ | |
} else { | ||
templatePath = fmt.Sprintf("%s/ns_%s.yaml", tier, typeName) | ||
} | ||
t.Logf("checking template '%s' (based on another tier: %t)", templatePath, basedOnOtherTier(expectedTiers, tier)) | ||
content, err := assets.Asset(templatePath) | ||
require.NoError(t, err) | ||
expected := templatev1.Template{} | ||
_, _, err = decoder.Decode(content, nil, &expected) | ||
require.NoError(t, err) | ||
// then override the templates' parameters (if applicable) | ||
if basedOnOtherTier(expectedTiers, tier) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why this is needed. Could you please comment on this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this comes from my contribution to #944 but I don't recall all the details :/ |
||
content, err = assets.Asset(fmt.Sprintf("%s/based_on_tier.yaml", tier)) | ||
require.NoError(t, err) | ||
extension := BasedOnTier{} | ||
err = yaml.Unmarshal(content, &extension) | ||
require.NoError(t, err) | ||
for i, p := range expected.Parameters { | ||
for _, ep := range extension.Parameters { | ||
if p.Name == ep.Name { | ||
expected.Parameters[i].Value = ep.Value | ||
} | ||
} | ||
} | ||
} | ||
assert.Equal(t, expected, actual) | ||
assert.NotEmpty(t, actual.Objects) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure that you want to remove the quota for cpu limits completely?