Skip to content

Commit

Permalink
Merge pull request #549 from furkatgofurov7/fix-setting-s3folder
Browse files Browse the repository at this point in the history
🐛 Fix setting folder S3 on etcd backups
  • Loading branch information
furkatgofurov7 authored Jan 10, 2025
2 parents 31818d7 + 54c9eec commit c2badd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
4 changes: 1 addition & 3 deletions pkg/rke2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,10 @@ func newRKE2ServerConfig(opts ServerConfigOpts) (*ServerConfig, []bootstrapv1.Fi
})
}

rke2ServerConfig.EtcdSnapshotDir = opts.ServerConfig.Etcd.BackupConfig.S3.Folder
rke2ServerConfig.EtcdS3SkipSslVerify = !opts.ServerConfig.Etcd.BackupConfig.S3.EnforceSSLVerify
} else {
rke2ServerConfig.EtcdSnapshotDir = opts.ServerConfig.Etcd.BackupConfig.Directory
}

rke2ServerConfig.EtcdSnapshotDir = opts.ServerConfig.Etcd.BackupConfig.Directory
rke2ServerConfig.EtcdSnapshotName = opts.ServerConfig.Etcd.BackupConfig.SnapshotName
rke2ServerConfig.EtcdSnapshotRetention = opts.ServerConfig.Etcd.BackupConfig.Retention
rke2ServerConfig.EtcdSnapshotScheduleCron = opts.ServerConfig.Etcd.BackupConfig.ScheduleCron
Expand Down
7 changes: 1 addition & 6 deletions pkg/rke2/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ var _ = Describe("RKE2ServerConfig", func() {
Bucket: "testbucket",
Region: "testregion",
Endpoint: "testendpoint",
Folder: "testfolder",
EnforceSSLVerify: true,
},
Directory: "testdir",
Expand Down Expand Up @@ -195,11 +194,7 @@ var _ = Describe("RKE2ServerConfig", func() {
Expect(rke2ServerConfig.EtcdS3Folder).To(Equal(serverConfig.Etcd.BackupConfig.S3.Folder))
Expect(rke2ServerConfig.EtcdS3Endpoint).To(Equal(serverConfig.Etcd.BackupConfig.S3.Endpoint))
Expect(rke2ServerConfig.EtcdS3EndpointCA).To(Equal("/etc/rancher/rke2/etcd-s3-ca.crt"))
if serverConfig.Etcd.BackupConfig.S3 != nil {
Expect(rke2ServerConfig.EtcdSnapshotDir).To(Equal(serverConfig.Etcd.BackupConfig.S3.Folder))
} else {
Expect(rke2ServerConfig.EtcdSnapshotDir).To(Equal(serverConfig.Etcd.BackupConfig.Directory))
}
Expect(rke2ServerConfig.EtcdSnapshotDir).To(Equal(serverConfig.Etcd.BackupConfig.Directory))
Expect(rke2ServerConfig.EtcdSnapshotName).To(Equal(serverConfig.Etcd.BackupConfig.SnapshotName))
Expect(rke2ServerConfig.EtcdSnapshotRetention).To(Equal(serverConfig.Etcd.BackupConfig.Retention))
Expect(rke2ServerConfig.EtcdSnapshotScheduleCron).To(Equal(serverConfig.Etcd.BackupConfig.ScheduleCron))
Expand Down

0 comments on commit c2badd9

Please sign in to comment.