Skip to content

Commit

Permalink
Address code review suggestion to rename IsKubernetesFileFormat
Browse files Browse the repository at this point in the history
to `IsKubernetesFileExtension`.
  • Loading branch information
tejal29 committed Mar 12, 2019
1 parent 8f97409 commit 7aff98d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/skaffold/initializer/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func DoInit(out io.Writer, c Config) error {
logrus.Debugf("%s is a valid skaffold configuration: continuing since --force=true", path)
return nil
}
if IsSupportedKubernetesFormat(path) {
if IsSupportedKubernetesFileExtension(path) {
potentialConfigs = append(potentialConfigs, path)
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/initializer/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema"
)

// IsSupportedKubernetesFormat is for determining if a file under a glob pattern
// IsSupportedKubernetesFileExtension is for determining if a file under a glob pattern
// is deployable file format. It makes no attempt to check whether or not the file
// is actually deployable or has the correct contents.
func IsSupportedKubernetesFormat(n string) bool {
func IsSupportedKubernetesFileExtension(n string) bool {
for _, s := range kubectl.ValidSuffixes {
if strings.HasSuffix(n, s) {
return true
Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/initializer/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/GoogleContainerTools/skaffold/testutil"
)

func TestIsSupportedKubernetesFormat(t *testing.T) {
func TestIsSupportedKubernetesFileExtension(t *testing.T) {
tests := []struct {
name string
filename string
Expand Down Expand Up @@ -52,7 +52,7 @@ func TestIsSupportedKubernetesFormat(t *testing.T) {
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
if IsSupportedKubernetesFormat(test.filename) != test.expected {
if IsSupportedKubernetesFileExtension(test.filename) != test.expected {
t.Errorf("expected to see %t for %s, but instead got %t", test.expected,
test.filename, !test.expected)
}
Expand Down

0 comments on commit 7aff98d

Please sign in to comment.