Skip to content

Commit

Permalink
Merge pull request #118143 from humblec/cephfs
Browse files Browse the repository at this point in the history
deprecate CephFS plugin from available in-tree drivers.
  • Loading branch information
k8s-ci-robot committed Jun 7, 2023
2 parents f17e275 + c009667 commit 6b700c3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/api/persistentvolume/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
20 changes: 20 additions & 0 deletions pkg/api/persistentvolume/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/pod/warnings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions pkg/api/pod/warnings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 6b700c3

Please sign in to comment.