1
0
mirror of https://github.com/rancher/types.git synced 2025-06-26 13:41:33 +00:00

Cleanup schema

This commit is contained in:
Darren Shepherd 2017-12-13 08:49:14 -07:00
parent 84196a0f47
commit 50ff898c3e
4 changed files with 13 additions and 12 deletions

View File

@ -37,7 +37,7 @@ type GroupMember struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
GroupName string `json:"groupName,omitempty" norman:"type=reference[/v3/schemas/group]"`
GroupName string `json:"groupName,omitempty" norman:"type=reference[group]"`
ExternalID string `json:"externalId,omitempty"`
}
@ -57,9 +57,6 @@ type Identity struct {
//LoginInput structure defines all properties that can be sent by client to create a token
type LoginInput struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
TTLMillis string `json:"ttl,omitempty"`
IdentityRefreshTTLMillis string `json:"identityRefreshTTL,omitempty"`
Description string `json:"description,omitempty"`
@ -70,17 +67,11 @@ type LoginInput struct {
//LocalCredential stores the local auth creds
type LocalCredential struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Username string `json:"username"`
Password string `json:"password"`
}
//GithubCredential stores the github auth creds
type GithubCredential struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Code string `json:"code"`
}

View File

@ -130,7 +130,7 @@ type AzureKubernetesServiceConfig struct {
type ClusterEvent struct {
v1.Event
ClusterName string
ClusterName string `json:"clusterName" norman:"type=reference[cluster]"`
}
type ClusterRegistrationToken struct {

View File

@ -14,6 +14,9 @@ var (
Version: "v3",
Group: "management.cattle.io",
Path: "/v3",
SubContexts: map[string]bool{
"clusters": true,
},
}
Schemas = factory.Schemas(&Version).
@ -71,7 +74,13 @@ func clusterTypes(schemas *types.Schemas) *types.Schemas {
AddMapperForType(&Version, v3.ClusterStatus{},
m.Drop{"appliedSpec"},
).
MustImport(&Version, v3.Cluster{}).
AddMapperForType(&Version, v3.ClusterEvent{}, &m.Move{
From: "type",
To: "eventType",
}).
MustImportAndCustomize(&Version, v3.Cluster{}, func(schema *types.Schema) {
schema.SubContext = "clusters"
}).
MustImport(&Version, v3.ClusterEvent{}).
MustImport(&Version, v3.ClusterRegistrationToken{})
}

View File

@ -233,6 +233,7 @@ func podTypes(schemas *types.Schemas) *types.Schemas {
).
AddMapperForType(&Version, v1.ContainerPort{},
m.Drop{Field: "name"},
m.Move{From: "hostIP", To: "hostIp"},
).
AddMapperForType(&Version, v1.VolumeMount{},
m.Enum{