File tree Expand file tree Collapse file tree
functions/go/set-namespace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,10 @@ module github.com/GoogleContainerTools/kpt-functions-catalog/functions/go/set-na
22
33go 1.17
44
5- require github.com/GoogleContainerTools/kpt-functions-sdk/go/fn v0.0.0-20220322205615-b3b2aa33ba46
5+ require (
6+ github.com/GoogleContainerTools/kpt-functions-sdk/go/fn v0.0.0-20220322205615-b3b2aa33ba46
7+ k8s.io/apimachinery v0.23.4
8+ )
69
710require (
811 github.com/PuerkitoBio/purell v1.1.1 // indirect
Original file line number Diff line number Diff line change @@ -39,8 +39,6 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
3939dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 /go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU =
4040github.com/BurntSushi/toml v0.3.1 /go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU =
4141github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 /go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo =
42- github.com/GoogleContainerTools/kpt-functions-sdk/go/fn v0.0.0-20220316202203-f9115a993ebd h1:PzlNXoJTvlzct3n2hw3gmM6C9S/W4wmeaA3qqkM4TTQ =
43- github.com/GoogleContainerTools/kpt-functions-sdk/go/fn v0.0.0-20220316202203-f9115a993ebd /go.mod h1:hENpuHQH/bIfHUCuG4hvzb5i4doJ1KTId5EdWBg6AvU =
4442github.com/GoogleContainerTools/kpt-functions-sdk/go/fn v0.0.0-20220322205615-b3b2aa33ba46 h1:1MUhi+aih7/tGMkU5vmieVSu+U4qEVAJwq4JMX6/Xg0 =
4543github.com/GoogleContainerTools/kpt-functions-sdk/go/fn v0.0.0-20220322205615-b3b2aa33ba46 /go.mod h1:hENpuHQH/bIfHUCuG4hvzb5i4doJ1KTId5EdWBg6AvU =
4644github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 /go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ =
@@ -702,8 +700,6 @@ k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw=
702700k8s.io/klog/v2 v2.30.0 /go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0 =
703701k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e /go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw =
704702k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 /go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk =
705- k8s.io/kube-openapi v0.0.0-20220316025549-ddc66922ab18 h1:M0Korml79JW27ndc6lxLxkNP8QVqdpBj0MIEZliKy8A =
706- k8s.io/kube-openapi v0.0.0-20220316025549-ddc66922ab18 /go.mod h1:p8bjuqy9+BWvBDEBjdeVYtX6kMWWg6OhY1V1jhC9MPI =
707703k8s.io/kube-openapi v0.0.0-20220322231758-52feaf8c35bf h1:0debqTr1/MTyyjIkWlBj9ETK0s5rbZ/UDoXih1PBZ4c =
708704k8s.io/kube-openapi v0.0.0-20220322231758-52feaf8c35bf /go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk =
709705k8s.io/utils v0.0.0-20210802155522-efc7438f0176 /go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA =
Original file line number Diff line number Diff line change @@ -28,20 +28,7 @@ const (
2828 nameIdx = 4
2929)
3030
31- type UpdateMode int
32-
3331var (
34- // Users provide the `namespaceSelector`, only update the namespace field matching the`namespaceSelector`.
35- CustomSelector UpdateMode = 1
36-
37- // The `namespaceSelector` is not given but the input resource contains one and only one namespace object,
38- // only update the namespace field matching the namespace `metadata.name`.
39- NsObjectSelector UpdateMode = 2
40-
41- // Neither `namespaceSelector` or namespace objects are given, require all namespace-scoped resources have unique
42- // namespace value and update this namespace to the new value.
43- Restrict UpdateMode = 3
44-
4532 // <group>/namespaces/<namespace>/<kind>/<name>
4633 namespacedResourcePattern = regexp .MustCompile (`\A([-.\w]*)/namespaces/([-.\w]*)/([-.\w]*)/([-.\w]*)\z` )
4734 dependsOnKeyPattern = func (group , kind , name string ) string {
You can’t perform that action at this time.
0 commit comments