I don't think it is a bug in Go.  ..data is a symlink, not a directory, os
IsDir() returning false is not unexpected.  Unfortunately, there isn't a
way to determine if the symlink points at a file or a directory without
following the link.

However, if you modify your code to skip entries in the directory listing
starting with "..", that should result in the functionality you desire
(i.e. only read secret files, not projection metadata).

On Wed, Jan 4, 2017 at 7:49 AM, Philippe Lafoucrière <
philippe.lafoucri...@tech-angels.com> wrote:

> We finally found the issue with these secrets: https://github.com/
> openshift/origin/issues/11164#issuecomment-269912867
> The secrets are mounted in a different way in os 1.3, and our go code was
> not reading the files anymore.
>
> [ta-pla-imac:~/dev/go/src/test]$ ls -ail secrets
> total 16
> 34464066 drwxr-xr-x   5 plafoucriere  staff  170  1 Jan 12:39 .
> 22330241 drwxr-xr-x  11 plafoucriere  staff  374  4 Jan 08:36 ..
> 34464673 drwxr-xr-x   4 plafoucriere  staff  136  1 Jan 12:39
> ..129812_30_12_16_47_54.674850353
> 34464703 lrwxr-xr-x   1 plafoucriere  staff   33  1 Jan 12:39 ..data ->
> ..129812_30_12_16_47_54.674850353
> 34464717 lrwxr-xr-x   1 plafoucriere  staff   10  1 Jan 12:39 foo ->
> ..data/foo
>
> Our code was failing because we skipped folders inside secrets (ie:
>  ..129812_30_12_16_47_54.674850353 was skipped, and ..data should have
> too). But file.IsDir() is false for ..data, and ReadFile was failing the
> read it: "read secrets/..data: is a directory".
> Looks like a bug to me in go, what do you think?
>
> _______________________________________________
> users mailing list
> users@lists.openshift.redhat.com
> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>
>
_______________________________________________
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users

Reply via email to