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-2404: EE-1120: Chore/refactor edge #229

Merged
merged 34 commits into from
Feb 17, 2022
Merged

Conversation

SvenDowideit
Copy link
Contributor

@SvenDowideit SvenDowideit commented Jan 25, 2022

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

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

BASED on #228 - which should be merged first

(ignore the first 7 commits)

My plan for this is to setup to the code to make Async edge and mTLS make more sense for someone that is used to the webUI

Signed-off-by: Sven Dowideit <[email protected]>
Signed-off-by: Sven Dowideit <[email protected]>
cmd/agent/main.go Outdated Show resolved Hide resolved
edge/key.go Outdated Show resolved Hide resolved
http/handler/handler.go Outdated Show resolved Hide resolved
os/options.go Outdated Show resolved Hide resolved
Copy link
Contributor

@chiptus chiptus left a comment

Choose a reason for hiding this comment

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

looks good, left a few questions

@SvenDowideit SvenDowideit changed the title Chore/refactor edge EE-2404: Chore/refactor edge Feb 3, 2022
@SvenDowideit SvenDowideit changed the title EE-2404: Chore/refactor edge EE-1120: Chore/refactor edge Feb 3, 2022
@SvenDowideit SvenDowideit changed the title EE-1120: Chore/refactor edge EE-2404: EE-1120: Chore/refactor edge Feb 3, 2022
@deviantony deviantony changed the base branch from develop to ce-2.13 February 16, 2022 19:39
@deviantony
Copy link
Member

I've think I've addressed most of the comments here, keen for another review @SvenDowideit @cheloRydel @andres-portainer @chiptus

@SvenDowideit
Copy link
Contributor Author

yup, feels like its going in good directions - LGTM

@deviantony
Copy link
Member

A last one for you @SvenDowideit , the last commit address the comment we talked about in #230 (review)

@SvenDowideit
Copy link
Contributor Author

yup, more LGTM - I finally found a less bad place to implement the async stuff, so i'll make a PR today for you all - and you'll see i needed to do something similar

Copy link
Contributor

@chiptus chiptus left a comment

Choose a reason for hiding this comment

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

over all looks good to me, there's a typo, plus a comment to remove.
another thing to consider is renaming the edge middleware

edge/edge.go Outdated Show resolved Hide resolved
edge/poll.go Outdated Show resolved Hide resolved
edge/stack/stack.go Show resolved Hide resolved
http/server.go Outdated Show resolved Hide resolved
http/server.go Outdated Show resolved Hide resolved
cmd/agent/main.go Outdated Show resolved Hide resolved
edge/stack/stack.go Show resolved Hide resolved
http/server.go Outdated Show resolved Hide resolved
Copy link
Contributor

@cheloRydel cheloRydel left a comment

Choose a reason for hiding this comment

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

LGTM

@deviantony deviantony merged commit 332cd65 into ce-2.13 Feb 17, 2022
@deviantony deviantony deleted the chore/refactor-edge branch February 17, 2022 21:00
@deviantony deviantony mentioned this pull request Feb 23, 2022
sbusso pushed a commit that referenced this pull request Feb 23, 2022
* EE-2404: EE-1120: feat(kingpin) use kingpin to parse ENV vars, and thus allow cli-params _and_ --help (#228)

* feat(kingpin) use kingpin to parse ENV vars, and thus allow cli-params _and_ --help

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

* clean out unused env var names

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

* use the ENV text from the README

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

* HostManagementEnabled was hardcoded to true - I presume this was once a feature?

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

* do we need to store a copy of a bool we have access to?

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

* add the LogLevels to the flag options

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

* Don't try over-writing the existing /data/agent_edge_key - its 0444

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

* feat(edge): rollback key retrieval changes

* refactor(edge): remove comment

* feat(main): rollback changes to ip detection

* refactor(options): remove unused options

* refactor(options): remove comment

Co-authored-by: deviantony <[email protected]>

* feat(options): cli flag consistency between server/agent (#240)

* EE-2404: EE-1120: Chore/refactor edge (#229)

* feat(kingpin) use kingpin to parse ENV vars, and thus allow cli-params _and_ --help

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

* clean out unused env var names

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

* use the ENV text from the README

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

* HostManagementEnabled was hardcoded to true - I presume this was once a feature?

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

* do we need to store a copy of a bool we have access to?

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

* add the LogLevels to the flag options

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

* Don't try over-writing the existing /data/agent_edge_key - its 0444

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

* EdgeKey retreival code should be with the other EdgeKey code

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

* PROPOSAL: don't create an edgeManager if we're not in Edge mode

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

* add todo

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

* JUST git mv internal/edge/ to edge/

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

* git mv the scheduler code from filesystem/ to edge/scheduler/

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

* git mv edge/logs.go edge/scheduler/logs.go - jobID in logs == schedule.ID

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

* git mv edge/stack.go edge/stack/stack.go

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

* feat(edge): rollback key retrieval changes

* refactor(edge): remove comment

* feat(main): rollback changes to ip detection

* refactor(options): remove unused options

* refactor(options): remove comment

* refactor(http): update parameters

* refactor(edge): refactor of the edge package

* refactor(edge): refactor of the edge package

* refactor(edge): import refactor

* refactor(edge): refactor of the edge module

* refactor(edge): refactor imports

* refactor(http): do not store pointer to EdgeManager in Handler

* refactor(edge): refactor edge tunnel capability mgmt

* refactor(edge): rename parameter

* refactor(main): update Edge condition check

* refactor(http): review Edge mode server's handler enhancement

Co-authored-by: deviantony <[email protected]>

* refactor(edge): remove comment

* fix(edge): fix mod of stack file from 644 to 0644

* refactor(edge): move http/client to edge/client

* refactor(edge): move edge server from http package to edge/http

* chore(agent): clean up the code EE-2559 (#251)

Co-authored-by: Sven Dowideit <[email protected]>
Co-authored-by: andres-portainer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants