Skip to content

7.6.2节 多版本部署,v2版本创建yaml报错, v1创建正常 #6

@tanlay

Description

@tanlay

报错如下:

$ kubectl apply -f config/samples/apps_v2_application.yaml 
Error from server: error when retrieving current configuration of:
Resource: "apps.tanlay.com/v2, Resource=applications", GroupVersionKind: "apps.tanlay.com/v2, Kind=Application"
Name: "nginx-sample", Namespace: "default"
from server for: "config/samples/apps_v2_application.yaml": conversion webhook for apps.tanlay.com/v1, Kind=Application failed: the server could not find the requested resource

api/v2/application_types.go文件

// 只修改了ApplicationSpec结构体的Deployment字段为Workflow,其他和v1版本一致,
// 只在v1版本增加了持久化 //+kubebuilder:storageversion
type ApplicationSpec struct {
	// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
	// Important: Run "make" to regenerate code after modifying this file

	Workflow v1.DeploymentTemplate `json:"workflow,omitempty"`
	Service  v1.ServiceTemplate    `json:"service,omitempty"`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions