Skip to content

Commit 53aeb51

Browse files
glpatcernjessegeens
authored andcommitted
Remove shadow namespace and externalize create_home and user quota logic to script
* Replaced home creation function with external script * Removed shadow namespace and related code * eosfs: also removed user quota logic, externalized to the create_home_hook script
1 parent 1d73dc2 commit 53aeb51

File tree

4 files changed

+44
-361
lines changed

4 files changed

+44
-361
lines changed

pkg/eosclient/eosgrpc/eosgrpc.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -840,13 +840,9 @@ func (c *Client) GetQuota(ctx context.Context, username string, rootAuth eosclie
840840
return nil, errtypes.InternalError(fmt.Sprintf("Quota error from eos. info: '%#v'", resp.Quota))
841841
}
842842

843-
qi := new(eosclient.QuotaInfo)
844-
if resp == nil {
845-
return nil, errtypes.InternalError("Out of memory")
846-
}
847-
848843
// Let's loop on all the quotas that match this uid (apparently there can be many)
849844
// If there are many for this node, we sum them up
845+
qi := new(eosclient.QuotaInfo)
850846
for i := 0; i < len(resp.Quota.Quotanode); i++ {
851847
log.Debug().Str("func", "GetQuota").Str("quotanode:", fmt.Sprintf("%d: %#v", i, resp.Quota.Quotanode[i])).Msg("")
852848

pkg/storage/utils/eosfs/config.go

+3-24
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,6 @@ type Config struct {
2626
// QuotaNode for storing quota information
2727
QuotaNode string `mapstructure:"quota_node"`
2828

29-
// DefaultQuotaBytes sets the default maximum bytes available for a user
30-
DefaultQuotaBytes uint64 `mapstructure:"default_quota_bytes"`
31-
32-
// DefaultSecondaryQuotaBytes sets the default maximum bytes available for a secondary user
33-
DefaultSecondaryQuotaBytes uint64 `mapstructure:"default_secondary_quota_bytes"`
34-
35-
// DefaultQuotaFiles sets the default maximum files available for a user
36-
DefaultQuotaFiles uint64 `mapstructure:"default_quota_files"`
37-
38-
// ShadowNamespace for storing shadow data
39-
ShadowNamespace string `mapstructure:"shadow_namespace"`
40-
41-
// UploadsNamespace for storing upload data
42-
UploadsNamespace string `mapstructure:"uploads_namespace"`
43-
44-
// ShareFolder defines the name of the folder in the
45-
// shadowed namespace. Ex: /eos/user/.shadow/h/hugo/MyShares
46-
ShareFolder string `mapstructure:"share_folder"`
47-
4829
// Location of the eos binary.
4930
// Default is /usr/bin/eos.
5031
EosBinary string `mapstructure:"eos_binary"`
@@ -149,9 +130,6 @@ type Config struct {
149130
// revisions-related operations.
150131
ImpersonateOwnerforRevisions bool `mapstructure:"impersonate_owner_for_revisions"`
151132

152-
// Whether to enable the post create home hook
153-
EnablePostCreateHomeHook bool `mapstructure:"enable_post_create_home_hook"`
154-
155133
// HTTP connections to EOS: max number of idle conns
156134
MaxIdleConns int `mapstructure:"max_idle_conns"`
157135

@@ -177,8 +155,9 @@ type Config struct {
177155
// Default is 3600
178156
TokenExpiry int
179157

180-
// Path of the script to run after an user home folder has been created
181-
OnPostCreateHomeHook string `mapstructure:"on_post_create_home_hook"`
158+
// Path of the script to run in order to create a user home folder
159+
// TODO(lopresti): to be replaced by a call to the Resource Lifecycle API being developed
160+
CreateHomeHook string `mapstructure:"create_home_hook"`
182161

183162
// Maximum entries count a ListRecycle call may return: if exceeded, ListRecycle
184163
// will return a BadRequest error

0 commit comments

Comments
 (0)