Skip to content

Commit

Permalink
Merge pull request kubernetes#71217 from jsafrane/status-update-unit-…
Browse files Browse the repository at this point in the history
…test

CSI v1 leftovers
  • Loading branch information
k8s-ci-robot authored Nov 29, 2018
2 parents 4372d62 + 0c4b89f commit 81eb9ce
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 14 deletions.
4 changes: 2 additions & 2 deletions api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/swagger-spec/storage.k8s.io_v1.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/swagger-spec/storage.k8s.io_v1beta1.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/api-reference/storage.k8s.io/v1/definitions.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/api-reference/storage.k8s.io/v1beta1/definitions.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/apis/storage/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ type VolumeError struct {
Time metav1.Time

// String detailing the error encountered during Attach or Detach operation.
// This string maybe logged, so it should not contain sensitive
// This string may be logged, so it should not contain sensitive
// information.
// +optional
Message string
Expand Down
2 changes: 2 additions & 0 deletions pkg/registry/storage/volumeattachment/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ type StatusREST struct {
store *genericregistry.Store
}

var _ = rest.Patcher(&StatusREST{})

// New creates a new VolumeAttachment resource
func (r *StatusREST) New() runtime.Object {
return &storageapi.VolumeAttachment{}
Expand Down
11 changes: 10 additions & 1 deletion pkg/registry/storage/volumeattachment/strategy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,18 @@ func TestVolumeAttachmentStatusStrategy(t *testing.T) {
t.Errorf("unexpected objects differerence after modifying status: %v", diff.ObjectDiff(statusVolumeAttachment, expectedVolumeAttachment))
}

// modifying spec should be dropped
// spec and metadata modifications should be dropped
newVolumeAttachment := volumeAttachment.DeepCopy()
newVolumeAttachment.Spec.NodeName = "valid-node-2"
newVolumeAttachment.Labels = map[string]string{"foo": "bar"}
newVolumeAttachment.Annotations = map[string]string{"foo": "baz"}
newVolumeAttachment.OwnerReferences = []metav1.OwnerReference{
{
APIVersion: "v1",
Kind: "Pod",
Name: "Foo",
},
}

StatusStrategy.PrepareForUpdate(ctx, newVolumeAttachment, volumeAttachment)
if !apiequality.Semantic.DeepEqual(newVolumeAttachment, volumeAttachment) {
Expand Down
2 changes: 1 addition & 1 deletion staging/src/k8s.io/api/storage/v1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/api/storage/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ type VolumeError struct {
Time metav1.Time `json:"time,omitempty" protobuf:"bytes,1,opt,name=time"`

// String detailing the error encountered during Attach or Detach operation.
// This string maybe logged, so it should not contain sensitive
// This string may be logged, so it should not contain sensitive
// information.
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"`
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/api/storage/v1beta1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion staging/src/k8s.io/api/storage/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ type VolumeError struct {
Time metav1.Time `json:"time,omitempty" protobuf:"bytes,1,opt,name=time"`

// String detailing the error encountered during Attach or Detach operation.
// This string maybe logged, so it should not contain sensitive
// This string may be logged, so it should not contain sensitive
// information.
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"`
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 81eb9ce

Please sign in to comment.