diff options
| author | chrislu <chris.lu@gmail.com> | 2022-06-20 14:15:59 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-06-20 14:15:59 -0700 |
| commit | 1d0c53ea56f84bfef5115e756ebe31d9ece62f20 (patch) | |
| tree | b5ee942ce63760722caf018885b2d2399587d96b /weed/remote_storage/hdfs/hdfs_kerberos.go | |
| parent | bf5a5abfb1925ee981306d8e49bc52bcded2279b (diff) | |
| download | seaweedfs-1d0c53ea56f84bfef5115e756ebe31d9ece62f20.tar.xz seaweedfs-1d0c53ea56f84bfef5115e756ebe31d9ece62f20.zip | |
remote storage: stop supporting hdfs as a remote storage
Diffstat (limited to 'weed/remote_storage/hdfs/hdfs_kerberos.go')
| -rw-r--r-- | weed/remote_storage/hdfs/hdfs_kerberos.go | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/weed/remote_storage/hdfs/hdfs_kerberos.go b/weed/remote_storage/hdfs/hdfs_kerberos.go deleted file mode 100644 index ba152020a..000000000 --- a/weed/remote_storage/hdfs/hdfs_kerberos.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build hdfs -// +build hdfs - -package hdfs - -import ( - "fmt" - "os" - "os/user" - "strings" - - krb "github.com/jcmturner/gokrb5/v8/client" - "github.com/jcmturner/gokrb5/v8/config" - "github.com/jcmturner/gokrb5/v8/credentials" -) - -// copy-paste from https://github.com/colinmarc/hdfs/blob/master/cmd/hdfs/kerberos.go -func getKerberosClient() (*krb.Client, error) { - configPath := os.Getenv("KRB5_CONFIG") - if configPath == "" { - configPath = "/etc/krb5.conf" - } - - cfg, err := config.Load(configPath) - if err != nil { - return nil, err - } - - // Determine the ccache location from the environment, falling back to the - // default location. - ccachePath := os.Getenv("KRB5CCNAME") - if strings.Contains(ccachePath, ":") { - if strings.HasPrefix(ccachePath, "FILE:") { - ccachePath = strings.SplitN(ccachePath, ":", 2)[1] - } else { - return nil, fmt.Errorf("unusable ccache: %s", ccachePath) - } - } else if ccachePath == "" { - u, err := user.Current() - if err != nil { - return nil, err - } - - ccachePath = fmt.Sprintf("/tmp/krb5cc_%s", u.Uid) - } - - ccache, err := credentials.LoadCCache(ccachePath) - if err != nil { - return nil, err - } - - client, err := krb.NewFromCCache(ccache, cfg) - if err != nil { - return nil, err - } - - return client, nil -} |
