Closed shenkonghui closed 1 year ago
建议不要使用map, 而是使用RawExtension,如下
type Provider struct {
Type string `json:"type" protobuf:"bytes,1,opt,name=type"`
ControlPlaneConfig *runtime.RawExtension `json:"controlPlaneConfig,omitempty" protobuf:"bytes,2,opt,name=controlPlaneConfig"`
InfrastructureConfig *runtime.RawExtension `json:"infrastructureConfig,omitempty" protobuf:"bytes,3,opt,name=infrastructureConfig"`
}
如果一定要使用, 加上以下注释,自动设置UnknownFields, 忽略掉这个错误就行 // +kubebuilder:validation:XPreserveUnknownFields