1
0
mirror of https://github.com/rancher/types.git synced 2025-09-22 10:27:53 +00:00

GenerateKubeconfig action on cluster

This commit is contained in:
Alena Prokharchyk
2018-03-20 14:11:58 -07:00
committed by Darren Shepherd
parent 3edfdf9ae3
commit 410af5d656
2 changed files with 8 additions and 0 deletions

View File

@@ -220,3 +220,7 @@ type ClusterRegistrationTokenStatus struct {
ManifestURL string `json:"manifestUrl"`
Token string `json:"token"`
}
type GenerateKubeConfigOutput struct {
Config string `json:"config"`
}

View File

@@ -133,6 +133,7 @@ func clusterTypes(schemas *types.Schemas) *types.Schemas {
MustImport(&Version, v3.Cluster{}).
MustImport(&Version, v3.ClusterEvent{}).
MustImport(&Version, v3.ClusterRegistrationToken{}).
MustImport(&Version, v3.GenerateKubeConfigOutput{}).
MustImportAndCustomize(&Version, v3.Cluster{}, func(schema *types.Schema) {
schema.MustCustomizeField("name", func(field types.Field) types.Field {
field.Type = "dnsLabel"
@@ -140,6 +141,9 @@ func clusterTypes(schemas *types.Schemas) *types.Schemas {
field.Required = false
return field
})
schema.ResourceActions["generateKubeconfig"] = types.Action{
Output: "generateKubeConfigOutput",
}
})
}