mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 18:02:01 +00:00
Merge pull request #114817 from TommyStarK/plugin-pkg-admission/replace-deprecated-pointer-function
plugin/pkg/admission: Replace deprecated pointer function
This commit is contained in:
commit
76e881d4d5
@ -134,30 +134,30 @@ func TestAdmission(t *testing.T) {
|
||||
classes: []*networkingv1.IngressClass{defaultClass1, classWithFalseDefault, classWithNoDefault, classWithEmptyDefault},
|
||||
classField: nil,
|
||||
classAnnotation: nil,
|
||||
expectedClass: utilpointer.StringPtr(defaultClass1.Name),
|
||||
expectedClass: utilpointer.String(defaultClass1.Name),
|
||||
expectedError: nil,
|
||||
},
|
||||
{
|
||||
name: "one default, no modification of Ingress with class field=''",
|
||||
classes: []*networkingv1.IngressClass{defaultClass1, classWithFalseDefault, classWithNoDefault, classWithEmptyDefault},
|
||||
classField: utilpointer.StringPtr(""),
|
||||
classField: utilpointer.String(""),
|
||||
classAnnotation: nil,
|
||||
expectedClass: utilpointer.StringPtr(""),
|
||||
expectedClass: utilpointer.String(""),
|
||||
expectedError: nil,
|
||||
},
|
||||
{
|
||||
name: "one default, no modification of Ingress with class field='foo'",
|
||||
classes: []*networkingv1.IngressClass{defaultClass1, classWithFalseDefault, classWithNoDefault, classWithEmptyDefault},
|
||||
classField: utilpointer.StringPtr("foo"),
|
||||
classField: utilpointer.String("foo"),
|
||||
classAnnotation: nil,
|
||||
expectedClass: utilpointer.StringPtr("foo"),
|
||||
expectedClass: utilpointer.String("foo"),
|
||||
expectedError: nil,
|
||||
},
|
||||
{
|
||||
name: "one default, no modification of Ingress with class annotation='foo'",
|
||||
classes: []*networkingv1.IngressClass{defaultClass1, classWithFalseDefault, classWithNoDefault, classWithEmptyDefault},
|
||||
classField: nil,
|
||||
classAnnotation: utilpointer.StringPtr("foo"),
|
||||
classAnnotation: utilpointer.String("foo"),
|
||||
expectedClass: nil,
|
||||
expectedError: nil,
|
||||
},
|
||||
@ -166,15 +166,15 @@ func TestAdmission(t *testing.T) {
|
||||
classes: []*networkingv1.IngressClass{defaultClass1, defaultClass2, classWithFalseDefault, classWithNoDefault, classWithEmptyDefault},
|
||||
classField: nil,
|
||||
classAnnotation: nil,
|
||||
expectedClass: utilpointer.StringPtr(defaultClass1.Name),
|
||||
expectedClass: utilpointer.String(defaultClass1.Name),
|
||||
expectedError: nil,
|
||||
},
|
||||
{
|
||||
name: "two defaults, no modification with Ingress with class field=''",
|
||||
classes: []*networkingv1.IngressClass{defaultClass1, defaultClass2, classWithFalseDefault, classWithNoDefault, classWithEmptyDefault},
|
||||
classField: utilpointer.StringPtr(""),
|
||||
classField: utilpointer.String(""),
|
||||
classAnnotation: nil,
|
||||
expectedClass: utilpointer.StringPtr(""),
|
||||
expectedClass: utilpointer.String(""),
|
||||
expectedError: nil,
|
||||
},
|
||||
{
|
||||
@ -182,7 +182,7 @@ func TestAdmission(t *testing.T) {
|
||||
classes: []*networkingv1.IngressClass{defaultClassWithCreateTime1, defaultClassWithCreateTime2, classWithFalseDefault, classWithNoDefault, classWithEmptyDefault},
|
||||
classField: nil,
|
||||
classAnnotation: nil,
|
||||
expectedClass: utilpointer.StringPtr(defaultClassWithCreateTime1.Name),
|
||||
expectedClass: utilpointer.String(defaultClassWithCreateTime1.Name),
|
||||
expectedError: nil,
|
||||
},
|
||||
}
|
||||
|
@ -297,8 +297,8 @@ func Test_nodePlugin_Admit(t *testing.T) {
|
||||
Namespace: api.NamespaceNodeLease,
|
||||
},
|
||||
Spec: coordination.LeaseSpec{
|
||||
HolderIdentity: pointer.StringPtr("mynode"),
|
||||
LeaseDurationSeconds: pointer.Int32Ptr(40),
|
||||
HolderIdentity: pointer.String("mynode"),
|
||||
LeaseDurationSeconds: pointer.Int32(40),
|
||||
RenewTime: &metav1.MicroTime{Time: time.Now()},
|
||||
},
|
||||
}
|
||||
@ -308,8 +308,8 @@ func Test_nodePlugin_Admit(t *testing.T) {
|
||||
Namespace: "foo",
|
||||
},
|
||||
Spec: coordination.LeaseSpec{
|
||||
HolderIdentity: pointer.StringPtr("mynode"),
|
||||
LeaseDurationSeconds: pointer.Int32Ptr(40),
|
||||
HolderIdentity: pointer.String("mynode"),
|
||||
LeaseDurationSeconds: pointer.Int32(40),
|
||||
RenewTime: &metav1.MicroTime{Time: time.Now()},
|
||||
},
|
||||
}
|
||||
@ -319,8 +319,8 @@ func Test_nodePlugin_Admit(t *testing.T) {
|
||||
Namespace: api.NamespaceNodeLease,
|
||||
},
|
||||
Spec: coordination.LeaseSpec{
|
||||
HolderIdentity: pointer.StringPtr("mynode"),
|
||||
LeaseDurationSeconds: pointer.Int32Ptr(40),
|
||||
HolderIdentity: pointer.String("mynode"),
|
||||
LeaseDurationSeconds: pointer.Int32(40),
|
||||
RenewTime: &metav1.MicroTime{Time: time.Now()},
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user