Conversation
9dd05a9 to
b3fce77
Compare
| "path/filepath" | ||
| ) | ||
|
|
||
| var ModeExecutable os.FileMode = 0111 |
There was a problem hiding this comment.
I think the correct filemode should be 0100, since the permissions are not actually a hierarchy (assuming it is an executable and not a script, since a script needs to be readable too iirc)
There was a problem hiding this comment.
Indeed, the last 1 is probably not relevant. 0110 is enough I think, only test if the current user or group can execute ?
There was a problem hiding this comment.
Don't think that is 100% correct either, since it will mark a file which as 0010 permissions as executable, but if the file is owned by your user, it is actually not. Tested this a bit locally, and a file owned by my user can indeed not execute some other file I own if its marked as 0077.
This answer on stackexchange seems to give a pretty detailed explanation https://unix.stackexchange.com/a/411901
|
|
||
| // FIXME: not sure about the public interface of this package yet | ||
| // most probably will need to run as a daemon too | ||
| func (u *UpgradeModule) Run(period time.Duration, p Publisher) error { |
There was a problem hiding this comment.
It seems this function never returns, so this error return can go
There was a problem hiding this comment.
I'm still actually a bit unhappy about this function.
Don't you think I should maybe remove the infinite loop from the Run method, and move the recurring logic part of the main file ?
So this package only holds logic about upgrade itself. And it's up to the caller to decide how often to run it ?
There was a problem hiding this comment.
I'm not sure, the period is already decided by an argument. So the question is more, would someone ever want to not call all these actions together I guess?
There was a problem hiding this comment.
yeah but if I remove the infinite loop, then I also remove the period argument.
And the Run method is actually the only think to run when you want to check/apply a new upgrade.
There was a problem hiding this comment.
True, I misunderstood your earlier comment, though you wanted to remove this function and just expose the individual functions that it calls. I think that is indeed acceptable.
upgrade flow is working At the moment I implement a publisher that check for new update against an HTTP server Still need to document the enpoints of such a server
No description provided.