79714811

Date: 2025-07-25 13:39:54
Score: 7
Natty:
Report link

Can you give details as to why you say the field selector `spec.type` on a service object stopped working?

Because the last version of the API, current master branch, indicates that you should still be able to use that field.

Ref: k8s Core v1 conversion.go

func AddFieldLabelConversionsForService(scheme *runtime.Scheme) error {
    return scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("Service"),
        func(label, value string) (string, string, error) {
            switch label {
            case "metadata.namespace",
                "metadata.name",
                "spec.clusterIP",
                "spec.type":
                return label, value, nil
            default:
                return "", "", fmt.Errorf("field label not supported: %s", label)
            }
        })
}

Answer inspired by the accepted answer to this other related issue: How can I find the list of field selectors supported by kubectl for a given resource?

Reasons:
  • Blacklisted phrase (0.5): How can I
  • RegEx Blacklisted phrase (2.5): Can you give
  • RegEx Blacklisted phrase (2): working?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): Can you give
  • Low reputation (0.5):
Posted by: Thomas Delrue