Skip to content

Commit ca748fa

Browse files
[Refactor] Move image/ to internal
This PR is an effort towards reducing the public surface of APIs. It move image/ to internal/image Signed-off-by: Varsha Prasad Narsing <[email protected]> (cherry picked from commit 1f5890709fdc17de6f44f42b5138dd0f7e64bc74)
1 parent 5e6cbac commit ca748fa

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

api/filters/imagetag/updater.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package imagetag
66
import (
77
"sigs.k8s.io/kustomize/api/filters/filtersutil"
88

9-
"sigs.k8s.io/kustomize/api/image"
9+
"sigs.k8s.io/kustomize/api/internal/image"
1010
"sigs.k8s.io/kustomize/api/types"
1111
"sigs.k8s.io/kustomize/kyaml/yaml"
1212
)
File renamed without changes.

api/image/image_test.go renamed to api/internal/image/image_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// Copyright 2020 The Kubernetes Authors.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package image
4+
package image_test
55

66
import (
77
"testing"
88

99
"github.com/stretchr/testify/assert"
10+
"sigs.k8s.io/kustomize/api/internal/image"
1011
)
1112

1213
func TestIsImageMatched(t *testing.T) {
@@ -50,7 +51,7 @@ func TestIsImageMatched(t *testing.T) {
5051

5152
for _, tc := range testCases {
5253
t.Run(tc.testName, func(t *testing.T) {
53-
assert.Equal(t, tc.isMatched, IsImageMatched(tc.value, tc.name))
54+
assert.Equal(t, tc.isMatched, image.IsImageMatched(tc.value, tc.name))
5455
})
5556
}
5657
}
@@ -116,7 +117,7 @@ func TestSplit(t *testing.T) {
116117

117118
for _, tc := range testCases {
118119
t.Run(tc.testName, func(t *testing.T) {
119-
name, tag, digest := Split(tc.value)
120+
name, tag, digest := image.Split(tc.value)
120121
assert.Equal(t, tc.name, name)
121122
assert.Equal(t, tc.tag, tag)
122123
assert.Equal(t, tc.digest, digest)

go.work.sum

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,14 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc
3030
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
3131
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
3232
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
33-
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
3433
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
3534
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
3635
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
3736
golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ=
3837
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
3938
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
4039
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
40+
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
4141
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
4242
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
43-
k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
44-
k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a/go.mod h1:y5VtZWM9sHHc2ZodIH/6SHzXj+TPU5USoA8lcIeKEKY=
45-
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg=
46-
k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
4743
sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU=

0 commit comments

Comments
 (0)