Merge pull request #118143 from humblec/cephfs

deprecate CephFS plugin from available in-tree drivers.
This commit is contained in:
Kubernetes Prow Robot 2023-06-07 16:54:12 -07:00 committed by GitHub
commit 6b700c398b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 0 deletions

View File

@ -79,6 +79,10 @@ func warningsForPersistentVolumeSpecAndMeta(fieldPath *field.Path, pvSpec *api.P
warnings = append(warnings, nodeapi.GetWarningsForNodeSelectorTerm(term, termFldPath.Index(i))...)
}
}
// If we are on deprecated volume plugin
if pvSpec.CephFS != nil {
warnings = append(warnings, fmt.Sprintf("%s: deprecated in v1.28, non-functional in v1.31+", fieldPath.Child("spec", "persistentVolumeSource").Child("cephfs")))
}
return warnings
}

View File

@ -176,6 +176,26 @@ func TestWarnings(t *testing.T) {
`spec.nodeAffinity.required.nodeSelectorTerms[0].matchExpressions[0].key: beta.kubernetes.io/os is deprecated since v1.14; use "kubernetes.io/os" instead`,
},
},
{
name: "PV CephFS deprecation warning",
template: &api.PersistentVolume{
Spec: api.PersistentVolumeSpec{
PersistentVolumeSource: api.PersistentVolumeSource{
CephFS: &api.CephFSPersistentVolumeSource{
Monitors: nil,
Path: "",
User: "",
SecretFile: "",
SecretRef: nil,
ReadOnly: false,
},
},
},
},
expected: []string{
`spec.persistentVolumeSource.cephfs: deprecated in v1.28, non-functional in v1.31+`,
},
},
}
for _, tc := range testcases {

View File

@ -160,6 +160,9 @@ func warningsForPodSpecAndMeta(fieldPath *field.Path, podSpec *api.PodSpec, meta
if v.Ephemeral != nil && v.Ephemeral.VolumeClaimTemplate != nil {
warnings = append(warnings, pvcutil.GetWarningsForPersistentVolumeClaimSpec(fieldPath.Child("spec", "volumes").Index(i).Child("ephemeral").Child("volumeClaimTemplate").Child("spec"), v.Ephemeral.VolumeClaimTemplate.Spec)...)
}
if v.CephFS != nil {
warnings = append(warnings, fmt.Sprintf("%s: deprecated in v1.28, non-functional in v1.31+", fieldPath.Child("spec", "volumes").Index(i).Child("cephfs")))
}
}
// duplicate hostAliases (#91670, #58477)

View File

@ -214,7 +214,16 @@ func TestWarnings(t *testing.T) {
}},
},
expected: []string{`spec.volumes[0].glusterfs: deprecated in v1.25, non-functional in v1.26+`},
}, {
name: "CephFS",
template: &api.PodTemplateSpec{Spec: api.PodSpec{
Volumes: []api.Volume{
{Name: "s", VolumeSource: api.VolumeSource{CephFS: &api.CephFSVolumeSource{}}},
}},
},
expected: []string{`spec.volumes[0].cephfs: deprecated in v1.28, non-functional in v1.31+`},
},
{
name: "duplicate hostAlias",
template: &api.PodTemplateSpec{Spec: api.PodSpec{