Skip to content

Commit

Permalink
Remove shadow namespace and externalize create_home and user quota lo…
Browse files Browse the repository at this point in the history
…gic 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
  • Loading branch information
glpatcern authored and Jesse Geens committed Dec 9, 2024
1 parent 1d73dc2 commit 53aeb51
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 361 deletions.
6 changes: 1 addition & 5 deletions pkg/eosclient/eosgrpc/eosgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -840,13 +840,9 @@ func (c *Client) GetQuota(ctx context.Context, username string, rootAuth eosclie
return nil, errtypes.InternalError(fmt.Sprintf("Quota error from eos. info: '%#v'", resp.Quota))
}

qi := new(eosclient.QuotaInfo)
if resp == nil {
return nil, errtypes.InternalError("Out of memory")
}

// Let's loop on all the quotas that match this uid (apparently there can be many)
// If there are many for this node, we sum them up
qi := new(eosclient.QuotaInfo)
for i := 0; i < len(resp.Quota.Quotanode); i++ {
log.Debug().Str("func", "GetQuota").Str("quotanode:", fmt.Sprintf("%d: %#v", i, resp.Quota.Quotanode[i])).Msg("")

Expand Down
27 changes: 3 additions & 24 deletions pkg/storage/utils/eosfs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,6 @@ type Config struct {
// QuotaNode for storing quota information
QuotaNode string `mapstructure:"quota_node"`

// DefaultQuotaBytes sets the default maximum bytes available for a user
DefaultQuotaBytes uint64 `mapstructure:"default_quota_bytes"`

// DefaultSecondaryQuotaBytes sets the default maximum bytes available for a secondary user
DefaultSecondaryQuotaBytes uint64 `mapstructure:"default_secondary_quota_bytes"`

// DefaultQuotaFiles sets the default maximum files available for a user
DefaultQuotaFiles uint64 `mapstructure:"default_quota_files"`

// ShadowNamespace for storing shadow data
ShadowNamespace string `mapstructure:"shadow_namespace"`

// UploadsNamespace for storing upload data
UploadsNamespace string `mapstructure:"uploads_namespace"`

// ShareFolder defines the name of the folder in the
// shadowed namespace. Ex: /eos/user/.shadow/h/hugo/MyShares
ShareFolder string `mapstructure:"share_folder"`

// Location of the eos binary.
// Default is /usr/bin/eos.
EosBinary string `mapstructure:"eos_binary"`
Expand Down Expand Up @@ -149,9 +130,6 @@ type Config struct {
// revisions-related operations.
ImpersonateOwnerforRevisions bool `mapstructure:"impersonate_owner_for_revisions"`

// Whether to enable the post create home hook
EnablePostCreateHomeHook bool `mapstructure:"enable_post_create_home_hook"`

// HTTP connections to EOS: max number of idle conns
MaxIdleConns int `mapstructure:"max_idle_conns"`

Expand All @@ -177,8 +155,9 @@ type Config struct {
// Default is 3600
TokenExpiry int

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

// Maximum entries count a ListRecycle call may return: if exceeded, ListRecycle
// will return a BadRequest error
Expand Down
Loading

0 comments on commit 53aeb51

Please sign in to comment.