Skip to content

Commit 021fad1

Browse files
authored
Merge pull request #782 from jsafrane/prow-update-release-5.0
release-5.0: update release-tools
2 parents 0c16202 + 2364c51 commit 021fad1

File tree

15 files changed

+165
-131
lines changed

15 files changed

+165
-131
lines changed

client/apis/volumesnapshot/v1/types.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ type VolumeSnapshotSource struct {
123123
// VolumeSnapshotStatus and VolumeSnapshotContentStatus. Fields in VolumeSnapshotStatus
124124
// are updated based on fields in VolumeSnapshotContentStatus. They are eventual
125125
// consistency. These fields are duplicate in both objects due to the following reasons:
126-
// - Fields in VolumeSnapshotContentStatus can be used for filtering when importing a
127-
// volumesnapshot.
128-
// - VolumsnapshotStatus is used by end users because they cannot see VolumeSnapshotContent.
129-
// - CSI snapshotter sidecar is light weight as it only watches VolumeSnapshotContent
130-
// object, not VolumeSnapshot object.
126+
// - Fields in VolumeSnapshotContentStatus can be used for filtering when importing a
127+
// volumesnapshot.
128+
// - VolumsnapshotStatus is used by end users because they cannot see VolumeSnapshotContent.
129+
// - CSI snapshotter sidecar is light weight as it only watches VolumeSnapshotContent
130+
// object, not VolumeSnapshot object.
131131
type VolumeSnapshotStatus struct {
132132
// boundVolumeSnapshotContentName is the name of the VolumeSnapshotContent
133133
// object to which this VolumeSnapshot object intends to bind to.
@@ -355,11 +355,11 @@ type VolumeSnapshotContentSource struct {
355355
// VolumeSnapshotStatus and VolumeSnapshotContentStatus. Fields in VolumeSnapshotStatus
356356
// are updated based on fields in VolumeSnapshotContentStatus. They are eventual
357357
// consistency. These fields are duplicate in both objects due to the following reasons:
358-
// - Fields in VolumeSnapshotContentStatus can be used for filtering when importing a
359-
// volumesnapshot.
360-
// - VolumsnapshotStatus is used by end users because they cannot see VolumeSnapshotContent.
361-
// - CSI snapshotter sidecar is light weight as it only watches VolumeSnapshotContent
362-
// object, not VolumeSnapshot object.
358+
// - Fields in VolumeSnapshotContentStatus can be used for filtering when importing a
359+
// volumesnapshot.
360+
// - VolumsnapshotStatus is used by end users because they cannot see VolumeSnapshotContent.
361+
// - CSI snapshotter sidecar is light weight as it only watches VolumeSnapshotContent
362+
// object, not VolumeSnapshot object.
363363
type VolumeSnapshotContentStatus struct {
364364
// snapshotHandle is the CSI "snapshot_id" of a snapshot on the underlying storage system.
365365
// If not specified, it indicates that dynamic snapshot creation has either failed

client/clientset/versioned/fake/register.go

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/clientset/versioned/scheme/register.go

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/common-controller/framework_test.go

+26-25
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ import (
7878
// function to call as the actual test. Available functions are:
7979
// - testSyncSnapshot - calls syncSnapshot on the first snapshot in initialSnapshots.
8080
// - testSyncSnapshotError - calls syncSnapshot on the first snapshot in initialSnapshots
81-
// and expects an error to be returned.
81+
// and expects an error to be returned.
8282
// - testSyncContent - calls syncContent on the first content in initialContents.
8383
// - any custom function for specialized tests.
84+
//
8485
// The test then contains list of contents/snapshots that are expected at the end
8586
// of the test and list of generated events.
8687
type controllerTest struct {
@@ -123,21 +124,21 @@ var noerrors = []reactorError{}
123124

124125
// snapshotReactor is a core.Reactor that simulates etcd and API server. It
125126
// stores:
126-
// - Latest version of snapshots contents saved by the controller.
127-
// - Queue of all saves (to simulate "content/snapshot updated" events). This queue
128-
// contains all intermediate state of an object - e.g. a snapshot.VolumeName
129-
// is updated first and snapshot.Phase second. This queue will then contain both
130-
// updates as separate entries.
131-
// - Number of changes since the last call to snapshotReactor.syncAll().
132-
// - Optionally, content and snapshot fake watchers which should be the same ones
133-
// used by the controller. Any time an event function like deleteContentEvent
134-
// is called to simulate an event, the reactor's stores are updated and the
135-
// controller is sent the event via the fake watcher.
136-
// - Optionally, list of error that should be returned by reactor, simulating
137-
// etcd / API server failures. These errors are evaluated in order and every
138-
// error is returned only once. I.e. when the reactor finds matching
139-
// reactorError, it return appropriate error and removes the reactorError from
140-
// the list.
127+
// - Latest version of snapshots contents saved by the controller.
128+
// - Queue of all saves (to simulate "content/snapshot updated" events). This queue
129+
// contains all intermediate state of an object - e.g. a snapshot.VolumeName
130+
// is updated first and snapshot.Phase second. This queue will then contain both
131+
// updates as separate entries.
132+
// - Number of changes since the last call to snapshotReactor.syncAll().
133+
// - Optionally, content and snapshot fake watchers which should be the same ones
134+
// used by the controller. Any time an event function like deleteContentEvent
135+
// is called to simulate an event, the reactor's stores are updated and the
136+
// controller is sent the event via the fake watcher.
137+
// - Optionally, list of error that should be returned by reactor, simulating
138+
// etcd / API server failures. These errors are evaluated in order and every
139+
// error is returned only once. I.e. when the reactor finds matching
140+
// reactorError, it return appropriate error and removes the reactorError from
141+
// the list.
141142
type snapshotReactor struct {
142143
secrets map[string]*v1.Secret
143144
volumes map[string]*v1.PersistentVolume
@@ -1296,11 +1297,11 @@ var (
12961297
)
12971298

12981299
// wrapTestWithInjectedOperation returns a testCall that:
1299-
// - starts the controller and lets it run original testCall until
1300-
// scheduleOperation() call. It blocks the controller there and calls the
1301-
// injected function to simulate that something is happening when the
1302-
// controller waits for the operation lock. Controller is then resumed and we
1303-
// check how it behaves.
1300+
// - starts the controller and lets it run original testCall until
1301+
// scheduleOperation() call. It blocks the controller there and calls the
1302+
// injected function to simulate that something is happening when the
1303+
// controller waits for the operation lock. Controller is then resumed and we
1304+
// check how it behaves.
13041305
func wrapTestWithInjectedOperation(toWrap testCall, injectBeforeOperation func(ctrl *csiSnapshotCommonController, reactor *snapshotReactor)) testCall {
13051306

13061307
return func(ctrl *csiSnapshotCommonController, reactor *snapshotReactor, test controllerTest) error {
@@ -1344,10 +1345,10 @@ func evaluateTestResults(ctrl *csiSnapshotCommonController, reactor *snapshotRea
13441345

13451346
// Test single call to syncSnapshot and syncContent methods.
13461347
// For all tests:
1347-
// 1. Fill in the controller with initial data
1348-
// 2. Call the tested function (syncSnapshot/syncContent) via
1349-
// controllerTest.testCall *once*.
1350-
// 3. Compare resulting contents and snapshots with expected contents and snapshots.
1348+
// 1. Fill in the controller with initial data
1349+
// 2. Call the tested function (syncSnapshot/syncContent) via
1350+
// controllerTest.testCall *once*.
1351+
// 3. Compare resulting contents and snapshots with expected contents and snapshots.
13511352
func runSyncTests(t *testing.T, tests []controllerTest, snapshotClasses []*crdv1.VolumeSnapshotClass) {
13521353
snapshotscheme.AddToScheme(scheme.Scheme)
13531354
for _, test := range tests {

pkg/common-controller/snapshot_controller.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -773,11 +773,12 @@ func (ctrl *csiSnapshotCommonController) storeContentUpdate(content interface{})
773773
// given event on the snapshot. It saves the status and emits the event only when
774774
// the status has actually changed from the version saved in API server.
775775
// Parameters:
776-
// snapshot - snapshot to update
777-
// setReadyToFalse bool - indicates whether to set the snapshot's ReadyToUse status to false.
778-
// if true, ReadyToUse will be set to false;
779-
// otherwise, ReadyToUse will not be changed.
780-
// eventtype, reason, message - event to send, see EventRecorder.Event()
776+
//
777+
// snapshot - snapshot to update
778+
// setReadyToFalse bool - indicates whether to set the snapshot's ReadyToUse status to false.
779+
// if true, ReadyToUse will be set to false;
780+
// otherwise, ReadyToUse will not be changed.
781+
// eventtype, reason, message - event to send, see EventRecorder.Event()
781782
func (ctrl *csiSnapshotCommonController) updateSnapshotErrorStatusWithEvent(snapshot *crdv1.VolumeSnapshot, setReadyToFalse bool, eventtype, reason, message string) error {
782783
klog.V(5).Infof("updateSnapshotErrorStatusWithEvent[%s]", utils.SnapshotKey(snapshot))
783784

pkg/common-controller/snapshot_update_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ var metaTimeNow = &metav1.Time{
3434
var emptyString = ""
3535

3636
// Test single call to syncSnapshot and syncContent methods.
37-
// 1. Fill in the controller with initial data
38-
// 2. Call the tested function (syncSnapshot/syncContent) via
39-
// controllerTest.testCall *once*.
40-
// 3. Compare resulting contents and snapshots with expected contents and snapshots.
37+
// 1. Fill in the controller with initial data
38+
// 2. Call the tested function (syncSnapshot/syncContent) via
39+
// controllerTest.testCall *once*.
40+
// 3. Compare resulting contents and snapshots with expected contents and snapshots.
4141
func TestSync(t *testing.T) {
4242
size := int64(1)
4343
snapshotErr := newVolumeError("Mock content error")

pkg/common-controller/snapshotclass_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import (
2222
)
2323

2424
// Test single call to checkAndUpdateSnapshotClass.
25-
// 1. Fill in the controller with initial data
26-
// 2. Call the tested function checkAndUpdateSnapshotClass via
27-
// controllerTest.testCall *once*.
28-
// 3. Compare resulting snapshotclass.
25+
// 1. Fill in the controller with initial data
26+
// 2. Call the tested function checkAndUpdateSnapshotClass via
27+
// controllerTest.testCall *once*.
28+
// 3. Compare resulting snapshotclass.
2929
func TestUpdateSnapshotClass(t *testing.T) {
3030
tests := []controllerTest{
3131
{

pkg/sidecar-controller/framework_test.go

+24-23
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ import (
7171
// function to call as the actual test. Available functions are:
7272
// - testSyncContent - calls syncContent on the first content in initialContents.
7373
// - any custom function for specialized tests.
74+
//
7475
// The test then contains list of contents that are expected at the end
7576
// of the test and list of generated events.
7677
type controllerTest struct {
@@ -110,20 +111,20 @@ var noerrors = []reactorError{}
110111

111112
// snapshotReactor is a core.Reactor that simulates etcd and API server. It
112113
// stores:
113-
// - Latest version of snapshots contents saved by the controller.
114-
// - Queue of all saves (to simulate "content updated" events). This queue
115-
// contains all intermediate state of an object. This queue will then contain both
116-
// updates as separate entries.
117-
// - Number of changes since the last call to snapshotReactor.syncAll().
118-
// - Optionally, content watcher which should be the same ones
119-
// used by the controller. Any time an event function like deleteContentEvent
120-
// is called to simulate an event, the reactor's stores are updated and the
121-
// controller is sent the event via the fake watcher.
122-
// - Optionally, list of error that should be returned by reactor, simulating
123-
// etcd / API server failures. These errors are evaluated in order and every
124-
// error is returned only once. I.e. when the reactor finds matching
125-
// reactorError, it return appropriate error and removes the reactorError from
126-
// the list.
114+
// - Latest version of snapshots contents saved by the controller.
115+
// - Queue of all saves (to simulate "content updated" events). This queue
116+
// contains all intermediate state of an object. This queue will then contain both
117+
// updates as separate entries.
118+
// - Number of changes since the last call to snapshotReactor.syncAll().
119+
// - Optionally, content watcher which should be the same ones
120+
// used by the controller. Any time an event function like deleteContentEvent
121+
// is called to simulate an event, the reactor's stores are updated and the
122+
// controller is sent the event via the fake watcher.
123+
// - Optionally, list of error that should be returned by reactor, simulating
124+
// etcd / API server failures. These errors are evaluated in order and every
125+
// error is returned only once. I.e. when the reactor finds matching
126+
// reactorError, it return appropriate error and removes the reactorError from
127+
// the list.
127128
type snapshotReactor struct {
128129
secrets map[string]*v1.Secret
129130
snapshotClasses map[string]*crdv1.VolumeSnapshotClass
@@ -706,11 +707,11 @@ var (
706707
)
707708

708709
// wrapTestWithInjectedOperation returns a testCall that:
709-
// - starts the controller and lets it run original testCall until
710-
// scheduleOperation() call. It blocks the controller there and calls the
711-
// injected function to simulate that something is happening when the
712-
// controller waits for the operation lock. Controller is then resumed and we
713-
// check how it behaves.
710+
// - starts the controller and lets it run original testCall until
711+
// scheduleOperation() call. It blocks the controller there and calls the
712+
// injected function to simulate that something is happening when the
713+
// controller waits for the operation lock. Controller is then resumed and we
714+
// check how it behaves.
714715
func wrapTestWithInjectedOperation(toWrap testCall, injectBeforeOperation func(ctrl *csiSnapshotSideCarController, reactor *snapshotReactor)) testCall {
715716

716717
return func(ctrl *csiSnapshotSideCarController, reactor *snapshotReactor, test controllerTest) error {
@@ -753,10 +754,10 @@ func evaluateTestResults(ctrl *csiSnapshotSideCarController, reactor *snapshotRe
753754

754755
// Test single call to syncContent methods.
755756
// For all tests:
756-
// 1. Fill in the controller with initial data
757-
// 2. Call the tested function (syncContent) via
758-
// controllerTest.testCall *once*.
759-
// 3. Compare resulting contents and snapshots with expected contents and snapshots.
757+
// 1. Fill in the controller with initial data
758+
// 2. Call the tested function (syncContent) via
759+
// controllerTest.testCall *once*.
760+
// 3. Compare resulting contents and snapshots with expected contents and snapshots.
760761
func runSyncContentTests(t *testing.T, tests []controllerTest, snapshotClasses []*crdv1.VolumeSnapshotClass) {
761762
snapshotscheme.AddToScheme(scheme.Scheme)
762763
for _, test := range tests {

pkg/sidecar-controller/snapshot_controller.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ func (ctrl *csiSnapshotSideCarController) checkandUpdateContentStatus(content *c
137137
// given event on the content. It saves the status and emits the event only when
138138
// the status has actually changed from the version saved in API server.
139139
// Parameters:
140-
// content - content to update
141-
// eventtype, reason, message - event to send, see EventRecorder.Event()
140+
//
141+
// content - content to update
142+
// eventtype, reason, message - event to send, see EventRecorder.Event()
142143
func (ctrl *csiSnapshotSideCarController) updateContentErrorStatusWithEvent(content *crdv1.VolumeSnapshotContent, eventtype, reason, message string) error {
143144
klog.V(5).Infof("updateContentStatusWithEvent[%s]", content.Name)
144145

pkg/utils/util.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ func verifyAndGetSecretNameAndNamespaceTemplate(secret secretParamsMap, snapshot
271271
}
272272

273273
// getSecretReference returns a reference to the secret specified in the given nameTemplate
274-
// and namespaceTemplate, or an error if the templates are not specified correctly.
274+
//
275+
// and namespaceTemplate, or an error if the templates are not specified correctly.
276+
//
275277
// No lookup of the referenced secret is performed, and the secret may or may not exist.
276278
//
277279
// supported tokens for name resolution:

release-tools/KUBERNETES_CSI_OWNERS_ALIASES

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ aliases:
2727
- jingxu97
2828
- jsafrane
2929
- pohly
30+
- RaunakShah
3031
- xing-yang
3132

3233
# This documents who previously contributed to Kubernetes-CSI

0 commit comments

Comments
 (0)