kubekey/api/core/v1/conversion.go
liujian 86ff6371b6
Uninstall docker interface (#2478)
Signed-off-by: joyceliu <joyceliu@yunify.com>
Co-authored-by: joyceliu <joyceliu@yunify.com>
2025-03-05 18:55:12 +08:00

25 lines
609 B
Go

package v1
import (
"fmt"
"k8s.io/apimachinery/pkg/runtime"
)
const PipelineFieldPlaybook = "spec.playbook"
// AddConversionFuncs adds the conversion functions to the given scheme.
// NOTE: ownerReferences:pipeline is valid in proxy client.
func AddConversionFuncs(scheme *runtime.Scheme) error {
return scheme.AddFieldLabelConversionFunc(
SchemeGroupVersion.WithKind("Pipeline"),
func(label, value string) (string, string, error) {
if label == PipelineFieldPlaybook {
return label, value, nil
}
return "", "", fmt.Errorf("field label %q not supported for Pipeline", label)
},
)
}