diff --git a/platform.go b/platform.go index 1913eee..5bcc2c1 100644 --- a/platform.go +++ b/platform.go @@ -174,6 +174,10 @@ func NewBindingsFromPath(path string) (Bindings, error) { bindings := Bindings{} for _, file := range files { + if strings.HasPrefix(filepath.Base(file), ".") { + // ignore hidden files + continue + } binding, err := NewBindingFromPath(file) if err != nil { return nil, fmt.Errorf("unable to create new binding from %s\n%w", file, err) diff --git a/platform_test.go b/platform_test.go index 4c4fcf8..674f30f 100644 --- a/platform_test.go +++ b/platform_test.go @@ -66,6 +66,10 @@ func testPlatform(t *testing.T, context spec.G, it spec.S) { Expect(os.MkdirAll(filepath.Join(path, "bravo", "secret"), 0755)).To(Succeed()) Expect(ioutil.WriteFile(filepath.Join(path, "bravo", "secret", "test-secret-key"), []byte("test-secret-value"), 0600)).To(Succeed()) Expect(ioutil.WriteFile(filepath.Join(path, "bravo", "secret", "test-secret-key-trimmed"), []byte(" test-secret-value-trimmed \n"), 0600)).To(Succeed()) + + Expect(os.MkdirAll(filepath.Join(path, ".hidden", "metadata"), 0755)).To(Succeed()) + Expect(ioutil.WriteFile(filepath.Join(path, ".hidden", "metadata", "kind"), []byte("test-kind"), 0600)).To(Succeed()) + Expect(ioutil.WriteFile(filepath.Join(path, ".hiddenFile"), []byte("test-kind"), 0600)).To(Succeed()) }) context("Binding", func() { @@ -205,6 +209,10 @@ func testPlatform(t *testing.T, context spec.G, it spec.S) { Expect(ioutil.WriteFile(filepath.Join(path, "bravo", "type"), []byte("test-type"), 0600)).To(Succeed()) Expect(ioutil.WriteFile(filepath.Join(path, "bravo", "provider"), []byte("test-provider"), 0600)).To(Succeed()) Expect(ioutil.WriteFile(filepath.Join(path, "bravo", "test-secret-key"), []byte("test-secret-value"), 0600)).To(Succeed()) + + Expect(os.MkdirAll(filepath.Join(path, ".hidden", "metadata"), 0755)).To(Succeed()) + Expect(ioutil.WriteFile(filepath.Join(path, ".hidden", "metadata", "kind"), []byte("test-kind"), 0600)).To(Succeed()) + Expect(ioutil.WriteFile(filepath.Join(path, ".hiddenFile"), []byte("test-kind"), 0600)).To(Succeed()) }) context("Binding", func() {