Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EE-1120: Feat/registry sync #231

Closed
wants to merge 17 commits into from
Closed

EE-1120: Feat/registry sync #231

wants to merge 17 commits into from

Conversation

SvenDowideit
Copy link
Contributor

@SvenDowideit SvenDowideit commented Feb 1, 2022

Replaced by #250

https://portainer.atlassian.net/browse/EE-1120

just the last commit - the rest if the refactoring from #229

Signed-off-by: Sven Dowideit <[email protected]>
Signed-off-by: Sven Dowideit <[email protected]>
@SvenDowideit SvenDowideit force-pushed the feat/registry-sync branch 2 times, most recently from 51fd35b to c0b0677 Compare February 1, 2022 11:27
@SvenDowideit SvenDowideit changed the title Feat/registry sync EE-2404: Feat/registry sync Feb 3, 2022
@SvenDowideit SvenDowideit changed the title EE-2404: Feat/registry sync EE-1120: Feat/registry sync Feb 3, 2022
…0, directly into the docker daemon

Signed-off-by: Sven Dowideit <[email protected]>

edgeKeyFilePath := fmt.Sprintf("%s/%s", agent.DataDirectory, agent.EdgeKeyFile)

keyFileExists, err := filesystem.FileExists(edgeKeyFilePath)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: this check seems a bit redundant (and not concurrency-friendly), if the file doesn't exist then filesystem.ReadFromFile() will catch it below anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Referenced in #248

err = filesystem.WriteFile(agent.DataDirectory, agent.EdgeKeyFile, []byte(key), 0444)
if err != nil {
return err
// TODO: yeah, we don't know if we got it from the fs, so lets try again :/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just write the file with os.O_CREATE | os.O_EXCL instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a reference for that one in #239

@deviantony deviantony mentioned this pull request Feb 18, 2022
4 tasks
@deviantony deviantony marked this pull request as draft February 18, 2022 02:45
@cheloRydel
Copy link
Contributor

Replaced by #250

@cheloRydel cheloRydel closed this Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants