kubekey/api/core/v1/conversion.go
liujian e40c57fb9f
fix: change pipeline to playbook (#2512)
Signed-off-by: joyceliu <joyceliu@yunify.com>
Co-authored-by: joyceliu <joyceliu@yunify.com>
2025-03-24 09:51:03 +08:00

24 lines
637 B
Go

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