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

update bootstrap logic #4438

Merged
merged 7 commits into from
Nov 10, 2021
Merged

update bootstrap logic #4438

merged 7 commits into from
Nov 10, 2021

Conversation

briandowns
Copy link
Contributor

Signed-off-by: Brian Downs brian.downs@gmail.com

Proposed Changes

Types of Changes

Resolves issue #4335 as well as changes the expected behavior from a 2 way synchronization of data between disk and database to a 1 way with the database being authoritative and disk changes resulting in a processing halt.

Verification

Scenario 2
Same steps for verifying #4335

Scenario 2
Start server 1.
Stop server 1.
Change the contents of a file in the bootstrap data: client-ca.crt for example.
Start server 1.
Observe a failure indicating that the file has been changed and a suggestion for it to be removed to be subsequently recovered.

A handy means of verifying that the same data exists on any node:

md5sum /var/lib/rancher/k3s/server/tls/client-ca.crt

Linked Issues

#4335

User-Facing Change


Further Comments

@briandowns briandowns requested a review from a team as a code owner November 9, 2021 20:01
@briandowns briandowns self-assigned this Nov 9, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 9, 2021

Codecov Report

Merging #4438 (9bbb722) into master (d85b246) will decrease coverage by 0.06%.
The diff coverage is 4.76%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4438      +/-   ##
==========================================
- Coverage   11.62%   11.55%   -0.07%     
==========================================
  Files         135      135              
  Lines        9343     9425      +82     
==========================================
+ Hits         1086     1089       +3     
- Misses       8023     8103      +80     
+ Partials      234      233       -1     
Flag Coverage Δ
inttests 0.74% <0.00%> (-0.01%) ⬇️
unittests 11.12% <4.76%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/bootstrap/bootstrap.go 20.00% <0.00%> (-0.52%) ⬇️
pkg/cli/etcdsnapshot/etcd_snapshot.go 0.00% <0.00%> (ø)
pkg/cluster/bootstrap.go 0.00% <0.00%> (ø)
pkg/cluster/cluster.go 0.00% <0.00%> (ø)
pkg/cluster/storage.go 0.00% <0.00%> (ø)
pkg/daemons/control/server.go 0.00% <0.00%> (ø)
pkg/daemons/executor/etcd.go 37.03% <ø> (ø)
pkg/etcd/etcd.go 16.62% <53.84%> (+0.11%) ⬆️
pkg/agent/netpol/utils/iptables.go 21.62% <0.00%> (+5.40%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d85b246...9bbb722. Read the comment docs.

Copy link
Contributor

@galal-hussein galal-hussein left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks!

pkg/cluster/bootstrap.go Outdated Show resolved Hide resolved
Copy link
Member

@brandond brandond left a comment

Choose a reason for hiding this comment

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

one nit on leaking the tempdir, LGTM other than that.

pkg/cluster/bootstrap.go Outdated Show resolved Hide resolved
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Copy link
Member

@dereknola dereknola left a comment

Choose a reason for hiding this comment

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

Yay tests!

@briandowns briandowns merged commit adaeae3 into k3s-io:master Nov 10, 2021
briandowns added a commit to briandowns/k3s that referenced this pull request Nov 10, 2021
* update bootstrap logic resolving a startup bug and account for etcd

Signed-off-by: Brian Downs <brian.downs@gmail.com>
briandowns added a commit to briandowns/k3s that referenced this pull request Nov 10, 2021
* update bootstrap logic resolving a startup bug and account for etcd

Signed-off-by: Brian Downs <brian.downs@gmail.com>
briandowns added a commit to briandowns/k3s that referenced this pull request Nov 10, 2021
* update bootstrap logic resolving a startup bug and account for etcd

Signed-off-by: Brian Downs <brian.downs@gmail.com>
briandowns added a commit to briandowns/k3s that referenced this pull request Nov 10, 2021
* update bootstrap logic resolving a startup bug and account for etcd

Signed-off-by: Brian Downs <brian.downs@gmail.com>
briandowns added a commit to briandowns/k3s that referenced this pull request Nov 10, 2021
* update bootstrap logic resolving a startup bug and account for etcd

Signed-off-by: Brian Downs <brian.downs@gmail.com>
briandowns added a commit to briandowns/k3s that referenced this pull request Nov 10, 2021
* update bootstrap logic resolving a startup bug and account for etcd

Signed-off-by: Brian Downs <brian.downs@gmail.com>
briandowns added a commit to briandowns/k3s that referenced this pull request Nov 10, 2021
* update bootstrap logic resolving a startup bug and account for etcd

Signed-off-by: Brian Downs <brian.downs@gmail.com>
brandond added a commit to brandond/k3s that referenced this pull request Jul 7, 2022
Since k3s-io#4438 removed 2-way sync and treats any changed+newer files on disk as an error, we no longer need to determine if files are newer on disk/db or if there is a conflicting mix of both. Any changed+newer file is an error, unless we're doing a cluster reset in which case everything is unconditionally replaced.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond added a commit to brandond/k3s that referenced this pull request Jul 7, 2022
Since k3s-io#4438 removed 2-way sync and treats any changed+newer files on disk as an error, we no longer need to determine if files are newer on disk/db or if there is a conflicting mix of both. Any changed+newer file is an error, unless we're doing a cluster reset in which case everything is unconditionally replaced.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond added a commit to brandond/k3s that referenced this pull request Jul 8, 2022
Since k3s-io#4438 removed 2-way sync and treats any changed+newer files on disk as an error, we no longer need to determine if files are newer on disk/db or if there is a conflicting mix of both. Any changed+newer file is an error, unless we're doing a cluster reset in which case everything is unconditionally replaced.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond added a commit to brandond/k3s that referenced this pull request Jul 8, 2022
Since k3s-io#4438 removed 2-way sync and treats any changed+newer files on disk as an error, we no longer need to determine if files are newer on disk/db or if there is a conflicting mix of both. Any changed+newer file is an error, unless we're doing a cluster reset in which case everything is unconditionally replaced.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond added a commit to brandond/k3s that referenced this pull request Jul 8, 2022
Since k3s-io#4438 removed 2-way sync and treats any changed+newer files on disk as an error, we no longer need to determine if files are newer on disk/db or if there is a conflicting mix of both. Any changed+newer file is an error, unless we're doing a cluster reset in which case everything is unconditionally replaced.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond added a commit that referenced this pull request Jul 12, 2022
Since #4438 removed 2-way sync and treats any changed+newer files on disk as an error, we no longer need to determine if files are newer on disk/db or if there is a conflicting mix of both. Any changed+newer file is an error, unless we're doing a cluster reset in which case everything is unconditionally replaced.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond added a commit that referenced this pull request Jul 12, 2022
Since #4438 removed 2-way sync and treats any changed+newer files on disk as an error, we no longer need to determine if files are newer on disk/db or if there is a conflicting mix of both. Any changed+newer file is an error, unless we're doing a cluster reset in which case everything is unconditionally replaced.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond added a commit that referenced this pull request Jul 12, 2022
Since #4438 removed 2-way sync and treats any changed+newer files on disk as an error, we no longer need to determine if files are newer on disk/db or if there is a conflicting mix of both. Any changed+newer file is an error, unless we're doing a cluster reset in which case everything is unconditionally replaced.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
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