mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
manual fixes
This commit is contained in:
parent
1dcd1fb3b7
commit
bfc75d9a5c
@ -2759,7 +2759,7 @@ func TestApplyNoExecuteTaints(t *testing.T) {
|
|||||||
|
|
||||||
// Make node3 healthy again.
|
// Make node3 healthy again.
|
||||||
node2.Status = healthyNodeNewStatus
|
node2.Status = healthyNodeNewStatus
|
||||||
_, err = fakeNodeHandler.UpdateStatus(context.TODO(), node2)
|
_, err = fakeNodeHandler.UpdateStatus(context.TODO(), node2, metav1.UpdateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf(err.Error())
|
t.Errorf(err.Error())
|
||||||
return
|
return
|
||||||
@ -2905,12 +2905,12 @@ func TestSwapUnreachableNotReadyTaints(t *testing.T) {
|
|||||||
|
|
||||||
node0.Status = newNodeStatus
|
node0.Status = newNodeStatus
|
||||||
node1.Status = healthyNodeNewStatus
|
node1.Status = healthyNodeNewStatus
|
||||||
_, err = fakeNodeHandler.UpdateStatus(context.TODO(), node0)
|
_, err = fakeNodeHandler.UpdateStatus(context.TODO(), node0, metav1.UpdateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf(err.Error())
|
t.Errorf(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = fakeNodeHandler.UpdateStatus(context.TODO(), node1)
|
_, err = fakeNodeHandler.UpdateStatus(context.TODO(), node1, metav1.UpdateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf(err.Error())
|
t.Errorf(err.Error())
|
||||||
return
|
return
|
||||||
@ -3120,7 +3120,7 @@ func TestTaintsNodeByCondition(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
fakeNodeHandler.Update(context.TODO(), test.Node)
|
fakeNodeHandler.Update(context.TODO(), test.Node, metav1.UpdateOptions{})
|
||||||
if err := nodeController.syncNodeStore(fakeNodeHandler); err != nil {
|
if err := nodeController.syncNodeStore(fakeNodeHandler); err != nil {
|
||||||
t.Errorf("unexpected error: %v", err)
|
t.Errorf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
@ -3331,7 +3331,7 @@ func TestReconcileNodeLabels(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
fakeNodeHandler.Update(context.TODO(), test.Node)
|
fakeNodeHandler.Update(context.TODO(), test.Node, metav1.UpdateOptions{})
|
||||||
if err := nodeController.syncNodeStore(fakeNodeHandler); err != nil {
|
if err := nodeController.syncNodeStore(fakeNodeHandler); err != nil {
|
||||||
t.Fatalf("unexpected error: %v", err)
|
t.Fatalf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
@ -3355,7 +3355,6 @@ func TestReconcileNodeLabels(t *testing.T) {
|
|||||||
if actualValue != expectedValue {
|
if actualValue != expectedValue {
|
||||||
t.Errorf("%s: label %q: expected value %q, got value %q", test.Name, key, expectedValue, actualValue)
|
t.Errorf("%s: label %q: expected value %q, got value %q", test.Name, key, expectedValue, actualValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -203,16 +203,22 @@ type conversionClient struct {
|
|||||||
v1client.ReplicationControllerInterface
|
v1client.ReplicationControllerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c conversionClient) Create(ctx context.Context, rs *apps.ReplicaSet) (*apps.ReplicaSet, error) {
|
func (c conversionClient) Create(ctx context.Context, rs *apps.ReplicaSet, opts metav1.CreateOptions) (*apps.ReplicaSet, error) {
|
||||||
return convertCall(ctx, c.ReplicationControllerInterface.Create, rs)
|
return convertCall(func(rc *v1.ReplicationController) (*v1.ReplicationController, error) {
|
||||||
|
return c.ReplicationControllerInterface.Create(ctx, rc, opts)
|
||||||
|
}, rs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c conversionClient) Update(ctx context.Context, rs *apps.ReplicaSet) (*apps.ReplicaSet, error) {
|
func (c conversionClient) Update(ctx context.Context, rs *apps.ReplicaSet, opts metav1.UpdateOptions) (*apps.ReplicaSet, error) {
|
||||||
return convertCall(ctx, c.ReplicationControllerInterface.Update, rs)
|
return convertCall(func(rc *v1.ReplicationController) (*v1.ReplicationController, error) {
|
||||||
|
return c.ReplicationControllerInterface.Update(ctx, rc, opts)
|
||||||
|
}, rs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c conversionClient) UpdateStatus(ctx context.Context, rs *apps.ReplicaSet) (*apps.ReplicaSet, error) {
|
func (c conversionClient) UpdateStatus(ctx context.Context, rs *apps.ReplicaSet, opts metav1.UpdateOptions) (*apps.ReplicaSet, error) {
|
||||||
return convertCall(ctx, c.ReplicationControllerInterface.UpdateStatus, rs)
|
return convertCall(func(rc *v1.ReplicationController) (*v1.ReplicationController, error) {
|
||||||
|
return c.ReplicationControllerInterface.UpdateStatus(ctx, rc, opts)
|
||||||
|
}, rs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c conversionClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*apps.ReplicaSet, error) {
|
func (c conversionClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*apps.ReplicaSet, error) {
|
||||||
@ -236,7 +242,7 @@ func (c conversionClient) Watch(ctx context.Context, opts metav1.ListOptions) (w
|
|||||||
return nil, errors.New("Watch() is not implemented for conversionClient")
|
return nil, errors.New("Watch() is not implemented for conversionClient")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c conversionClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.ReplicaSet, err error) {
|
func (c conversionClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *apps.ReplicaSet, err error) {
|
||||||
// This is not used by RSC.
|
// This is not used by RSC.
|
||||||
return nil, errors.New("Patch() is not implemented for conversionClient")
|
return nil, errors.New("Patch() is not implemented for conversionClient")
|
||||||
}
|
}
|
||||||
@ -246,7 +252,7 @@ func (c conversionClient) GetScale(ctx context.Context, name string, options met
|
|||||||
return nil, errors.New("GetScale() is not implemented for conversionClient")
|
return nil, errors.New("GetScale() is not implemented for conversionClient")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c conversionClient) UpdateScale(ctx context.Context, name string, scale *autoscalingv1.Scale) (result *autoscalingv1.Scale, err error) {
|
func (c conversionClient) UpdateScale(ctx context.Context, name string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
|
||||||
// This is not used by RSC.
|
// This is not used by RSC.
|
||||||
return nil, errors.New("UpdateScale() is not implemented for conversionClient")
|
return nil, errors.New("UpdateScale() is not implemented for conversionClient")
|
||||||
}
|
}
|
||||||
@ -275,12 +281,12 @@ func convertList(rcList *v1.ReplicationControllerList) (*apps.ReplicaSetList, er
|
|||||||
return rsList, nil
|
return rsList, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertCall(ctx context.Context, fn func(context.Context, *v1.ReplicationController) (*v1.ReplicationController, error), rs *apps.ReplicaSet) (*apps.ReplicaSet, error) {
|
func convertCall(fn func(*v1.ReplicationController) (*v1.ReplicationController, error), rs *apps.ReplicaSet) (*apps.ReplicaSet, error) {
|
||||||
rc, err := convertRStoRC(rs)
|
rc, err := convertRStoRC(rs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
result, err := fn(ctx, rc)
|
result, err := fn(rc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ func (m *FakeLegacyHandler) Nodes() v1core.NodeInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create adds a new Node to the fake store.
|
// Create adds a new Node to the fake store.
|
||||||
func (m *FakeNodeHandler) Create(_ context.Context, node *v1.Node) (*v1.Node, error) {
|
func (m *FakeNodeHandler) Create(_ context.Context, node *v1.Node, _ metav1.CreateOptions) (*v1.Node, error) {
|
||||||
m.lock.Lock()
|
m.lock.Lock()
|
||||||
defer func() {
|
defer func() {
|
||||||
m.RequestCount++
|
m.RequestCount++
|
||||||
@ -202,7 +202,7 @@ func (m *FakeNodeHandler) DeleteCollection(_ context.Context, opt *metav1.Delete
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update updates a Node in the fake store.
|
// Update updates a Node in the fake store.
|
||||||
func (m *FakeNodeHandler) Update(_ context.Context, node *v1.Node) (*v1.Node, error) {
|
func (m *FakeNodeHandler) Update(_ context.Context, node *v1.Node, _ metav1.UpdateOptions) (*v1.Node, error) {
|
||||||
m.lock.Lock()
|
m.lock.Lock()
|
||||||
defer func() {
|
defer func() {
|
||||||
m.RequestCount++
|
m.RequestCount++
|
||||||
@ -221,7 +221,7 @@ func (m *FakeNodeHandler) Update(_ context.Context, node *v1.Node) (*v1.Node, er
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UpdateStatus updates a status of a Node in the fake store.
|
// UpdateStatus updates a status of a Node in the fake store.
|
||||||
func (m *FakeNodeHandler) UpdateStatus(_ context.Context, node *v1.Node) (*v1.Node, error) {
|
func (m *FakeNodeHandler) UpdateStatus(_ context.Context, node *v1.Node, _ metav1.UpdateOptions) (*v1.Node, error) {
|
||||||
m.lock.Lock()
|
m.lock.Lock()
|
||||||
defer func() {
|
defer func() {
|
||||||
m.RequestCount++
|
m.RequestCount++
|
||||||
@ -266,7 +266,7 @@ func (m *FakeNodeHandler) UpdateStatus(_ context.Context, node *v1.Node) (*v1.No
|
|||||||
// PatchStatus patches a status of a Node in the fake store.
|
// PatchStatus patches a status of a Node in the fake store.
|
||||||
func (m *FakeNodeHandler) PatchStatus(ctx context.Context, nodeName string, data []byte) (*v1.Node, error) {
|
func (m *FakeNodeHandler) PatchStatus(ctx context.Context, nodeName string, data []byte) (*v1.Node, error) {
|
||||||
m.RequestCount++
|
m.RequestCount++
|
||||||
return m.Patch(ctx, nodeName, types.StrategicMergePatchType, data, "status")
|
return m.Patch(ctx, nodeName, types.StrategicMergePatchType, data, metav1.PatchOptions{}, "status")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Watch watches Nodes in a fake store.
|
// Watch watches Nodes in a fake store.
|
||||||
@ -275,7 +275,7 @@ func (m *FakeNodeHandler) Watch(_ context.Context, opts metav1.ListOptions) (wat
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Patch patches a Node in the fake store.
|
// Patch patches a Node in the fake store.
|
||||||
func (m *FakeNodeHandler) Patch(_ context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (*v1.Node, error) {
|
func (m *FakeNodeHandler) Patch(_ context.Context, name string, pt types.PatchType, data []byte, _ metav1.PatchOptions, subresources ...string) (*v1.Node, error) {
|
||||||
m.lock.Lock()
|
m.lock.Lock()
|
||||||
defer func() {
|
defer func() {
|
||||||
m.RequestCount++
|
m.RequestCount++
|
||||||
|
@ -148,7 +148,7 @@ type fakeClient struct {
|
|||||||
failureType failureType
|
failureType failureType
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *fakeClient) Create(context.Context, *certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) {
|
func (c *fakeClient) Create(context.Context, *certificates.CertificateSigningRequest, metav1.CreateOptions) (*certificates.CertificateSigningRequest, error) {
|
||||||
if c.failureType == createError {
|
if c.failureType == createError {
|
||||||
return nil, fmt.Errorf("fakeClient failed creating request")
|
return nil, fmt.Errorf("fakeClient failed creating request")
|
||||||
}
|
}
|
||||||
|
@ -1012,7 +1012,7 @@ func (c fakeClient) List(_ context.Context, opts v1.ListOptions) (*certificates.
|
|||||||
return &csrReply, nil
|
return &csrReply, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c fakeClient) Create(context.Context, *certificates.CertificateSigningRequest) (*certificates.CertificateSigningRequest, error) {
|
func (c fakeClient) Create(context.Context, *certificates.CertificateSigningRequest, v1.CreateOptions) (*certificates.CertificateSigningRequest, error) {
|
||||||
if c.failureType == createError {
|
if c.failureType == createError {
|
||||||
if c.err != nil {
|
if c.err != nil {
|
||||||
return nil, c.err
|
return nil, c.err
|
||||||
|
Loading…
Reference in New Issue
Block a user