mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 13:57:38 +00:00
Update reset fields to match current field wiping behavior
This commit is contained in:
@@ -56,10 +56,14 @@ func (serviceCIDRStrategy) NamespaceScoped() bool {
|
||||
func (serviceCIDRStrategy) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set {
|
||||
fields := map[fieldpath.APIVersion]*fieldpath.Set{
|
||||
"networking.k8s.io/v1": fieldpath.NewSet(
|
||||
fieldpath.MakePathOrDie("status"),
|
||||
// Disabled to match PrepareForCreate/PrepareForUpdate, which do not wipe fields
|
||||
// https://github.com/kubernetes/kubernetes/issues/137680
|
||||
// fieldpath.MakePathOrDie("status"),
|
||||
),
|
||||
"networking.k8s.io/v1beta1": fieldpath.NewSet(
|
||||
fieldpath.MakePathOrDie("status"),
|
||||
// Disabled to match PrepareForCreate/PrepareForUpdate, which do not wipe fields
|
||||
// https://github.com/kubernetes/kubernetes/issues/137680
|
||||
// fieldpath.MakePathOrDie("status"),
|
||||
),
|
||||
}
|
||||
return fields
|
||||
@@ -130,9 +134,11 @@ var StatusStrategy = serviceCIDRStatusStrategy{Strategy}
|
||||
func (serviceCIDRStatusStrategy) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set {
|
||||
fields := map[fieldpath.APIVersion]*fieldpath.Set{
|
||||
"networking.k8s.io/v1": fieldpath.NewSet(
|
||||
fieldpath.MakePathOrDie("metadata"),
|
||||
fieldpath.MakePathOrDie("spec"),
|
||||
),
|
||||
"networking.k8s.io/v1beta1": fieldpath.NewSet(
|
||||
fieldpath.MakePathOrDie("metadata"),
|
||||
fieldpath.MakePathOrDie("spec"),
|
||||
),
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ func (a statusStrategy) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set
|
||||
// we might need a mechanism that is the inverse of resetFields where
|
||||
// you specify only the fields to be kept rather than the fields to be wiped
|
||||
// that way you could wipe everything but the status in this case.
|
||||
fieldpath.MakePathOrDie("metadata"),
|
||||
fieldpath.MakePathOrDie("spec"),
|
||||
),
|
||||
}
|
||||
|
||||
@@ -252,11 +252,17 @@ func (statusStrategy) NamespaceScoped() bool {
|
||||
func (statusStrategy) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set {
|
||||
fields := map[fieldpath.APIVersion]*fieldpath.Set{
|
||||
"apiextensions.k8s.io/v1": fieldpath.NewSet(
|
||||
fieldpath.MakePathOrDie("metadata"),
|
||||
// Disabled to match PrepareForUpdate, which do not wipe metadata
|
||||
// https://github.com/kubernetes/kubernetes/issues/137681
|
||||
// fieldpath.MakePathOrDie("metadata"),
|
||||
|
||||
fieldpath.MakePathOrDie("spec"),
|
||||
),
|
||||
"apiextensions.k8s.io/v1beta1": fieldpath.NewSet(
|
||||
fieldpath.MakePathOrDie("metadata"),
|
||||
// Disabled to match PrepareForUpdate, which do not wipe metadata
|
||||
// https://github.com/kubernetes/kubernetes/issues/137681
|
||||
// fieldpath.MakePathOrDie("metadata"),
|
||||
|
||||
fieldpath.MakePathOrDie("spec"),
|
||||
),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user