mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-25 17:12:50 +00:00
Signed-off-by: joyceliu <joyceliu@yunify.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
25 lines
609 B
Go
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)
|
|
},
|
|
)
|
|
}
|