-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
✨ Add support for regexp in profile activation kubeContext #2065
Changes from 2 commits
af3de31
46e5cd1
047e154
33b63ae
f0782e7
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 |
---|---|---|
|
@@ -377,8 +377,10 @@ func TestActivatedProfiles(t *testing.T) { | |
{Name: "activated", Activation: []latest.Activation{{KubeContext: "prod-context"}}}, | ||
{Name: "not-activated", Activation: []latest.Activation{{KubeContext: "dev-context"}}}, | ||
{Name: "also-activated", Activation: []latest.Activation{{KubeContext: "!dev-context"}}}, | ||
{Name: "activated-regexp", Activation: []latest.Activation{{KubeContext: "prod-.*"}}}, | ||
{Name: "not-activated-regexp", Activation: []latest.Activation{{KubeContext: "dev-.*"}}}, | ||
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. we should cover the !(regex) and invalid regex cases too. 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. Should I create another profile so I can test those cases more easily? For instance, in order to test the invalid regex I would need a profile that matches when comparing strings, I guess. Also, is there any character limitation for the profile? I couldn't find any in create_context.go Regarding the 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. Feel free to add as many profiles as needed. Also, simple tests are better! |
||
}, | ||
expected: []string{"activated", "also-activated"}, | ||
expected: []string{"activated", "also-activated", "activated-regexp"}, | ||
}, { | ||
description: "AND between activation criteria", | ||
opts: &cfg.SkaffoldOptions{ | ||
|
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.
I think we should support the
!
prefix for regular expressions too, e.g.:!dev-.*
should activate on all that don't match it