-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: add fields to migrate from 3.5 to 3.4
Signed-off-by: Bogdan Kanivets <bkanivets@apple.com>
- Loading branch information
Bogdan Kanivets
committed
Sep 10, 2023
1 parent
e5638d9
commit 7fdfd99
Showing
12 changed files
with
446 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2023 The etcd Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package schema | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
|
||
"go.uber.org/zap/zaptest" | ||
|
||
"go.etcd.io/etcd/api/v3/version" | ||
serverversion "go.etcd.io/etcd/server/v3/etcdserver/version" | ||
betesting "go.etcd.io/etcd/server/v3/storage/backend/testing" | ||
) | ||
|
||
func TestDowngradeInfoFromBackend(t *testing.T) { | ||
lg := zaptest.NewLogger(t) | ||
be, _ := betesting.NewDefaultTmpBackend(t) | ||
defer betesting.Close(t, be) | ||
|
||
mbe := NewMembershipBackend(lg, be) | ||
|
||
mbe.MustCreateBackendBuckets() | ||
mbe.be.ForceCommit() | ||
assert.Nil(t, mbe.DowngradeInfoFromBackend()) | ||
|
||
dinfo := &serverversion.DowngradeInfo{Enabled: true, TargetVersion: version.V3_5.String()} | ||
mbe.MustSaveDowngradeToBackend(dinfo) | ||
|
||
info := mbe.DowngradeInfoFromBackend() | ||
|
||
assert.Equal(t, dinfo, info) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.