1
0
mirror of https://github.com/rancher/types.git synced 2025-07-03 16:56:16 +00:00

Cleanup references

This commit is contained in:
Darren Shepherd 2018-02-13 16:46:50 -07:00
parent 9e096de9f5
commit cbabeef819
9 changed files with 13 additions and 15 deletions

View File

@ -74,7 +74,7 @@ type TargetNode struct {
}
type TargetPod struct {
PodName string `json:"podName,omitempty" norman:"required,type=reference[pod]"`
PodName string `json:"podName,omitempty" norman:"required,type=reference[/v3/projects/schemas/pod]"`
Condition string `json:"condition,omitempty" norman:"required,options=notrunning|notscheduled|restarts,default=notrunning"`
RestartTimes int `json:"restartTimes,omitempty" norman:"min=1"`
RestartIntervalSeconds int `json:"restartIntervalSeconds,omitempty" norman:"min=1"`

View File

@ -9,10 +9,10 @@ type Token struct {
metav1.ObjectMeta `json:"metadata,omitempty"`
Token string `json:"token" norman:"writeOnly,noupdate"`
UserPrincipal Principal `json:"userPrincipal" norman:"type=reference[Principal]"`
GroupPrincipals []Principal `json:"groupPrincipals" norman:"type=array[reference[Principal]]"`
UserPrincipal Principal `json:"userPrincipal" norman:"type=reference[principal]"`
GroupPrincipals []Principal `json:"groupPrincipals" norman:"type=array[reference[principal]]"`
ProviderInfo map[string]string `json:"providerInfo,omitempty"`
UserID string `json:"userId" norman:"type=reference[User]"`
UserID string `json:"userId" norman:"type=reference[user]"`
AuthProvider string `json:"authProvider"`
TTLMillis int `json:"ttl"`
LastUpdateTime string `json:"lastUpdateTime"`
@ -29,7 +29,7 @@ type User struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty" norman:"writeOnly,noupdate"`
MustChangePassword bool `json:"mustChangePassword,omitempty"`
PrincipalIDs []string `json:"principalIds,omitempty" norman:"type=array[reference[Principal]]"`
PrincipalIDs []string `json:"principalIds,omitempty" norman:"type=array[reference[principal]]"`
Me bool `json:"me,omitempty"`
}
@ -45,7 +45,7 @@ type GroupMember struct {
metav1.ObjectMeta `json:"metadata,omitempty"`
GroupName string `json:"groupName,omitempty" norman:"type=reference[group]"`
PrincipalID string `json:"principalId,omitempty" norman:"type=reference[Principal]"`
PrincipalID string `json:"principalId,omitempty" norman:"type=reference[principal]"`
}
type Principal struct {
@ -85,7 +85,7 @@ type AuthConfig struct {
Type string `json:"type"`
Enabled bool `json:"enabled,omitempty"`
AccessMode string `json:"accessMode,omitempty" norman:"required,notnullable,type=enum,options=required|restricted|unrestricted"`
AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" norman:"type=array[reference[Principal]]"`
AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" norman:"type=array[reference[principal]]"`
}
//GithubConfig structure contains the github config definition

View File

@ -115,8 +115,6 @@ type CustomConfig struct {
DockerSocket string `yaml:"docker_socket" json:"dockerSocket,omitempty"`
// SSH Private Key
SSHKey string `yaml:"ssh_key" json:"sshKey,omitempty"`
// Roles
Roles []string `yaml:"roles" json:"roles,omitempty"`
}
type CommonNodeSpec struct {

View File

@ -439,7 +439,7 @@ func podTypes(schemas *types.Schemas) *types.Schemas {
}{}).
MustImport(&Version, v1.PodSpec{}, struct {
Scheduling *Scheduling
NodeName string `norman:"type=reference[node]"`
NodeName string `norman:"type=reference[/v3/schemas/node]"`
}{}).
MustImport(&Version, v1.Pod{}, projectOverride{}, struct {
Description string `json:"description"`

View File

@ -66,7 +66,7 @@ type Scheduling struct {
}
type NodeScheduling struct {
NodeName string `json:"nodeName" norman:"type=reference[node]"`
NodeName string `json:"nodeName" norman:"type=reference[/v3/schemas/node]"`
RequireAll []string
RequireAny []string
Preferred []string

View File

@ -15,7 +15,7 @@ type App struct {
}
type AppSpec struct {
ProjectName string `json:"projectName,omitempty" norman:"type=reference[project]"`
ProjectName string `json:"projectName,omitempty" norman:"type=reference[/v3/schemas/project]"`
Description string `json:"description,omitempty"`
InstallNamespace string `json:"installNamespace,omitempty"`
ExternalID string `json:"externalId,omitempty"`

View File

@ -85,7 +85,7 @@ type SSHAuth struct {
type NamespacedSSHAuth SSHAuth
type PublicEndpoint struct {
NodeName string `json:"nodeName,omitempty" norman:"type=reference[node],nocreate,noupdate"`
NodeName string `json:"nodeName,omitempty" norman:"type=reference[/v3/schemas/node],nocreate,noupdate"`
Address string `json:"address,omitempty" norman:"nocreate,noupdate"`
Port int32 `json:"port,omitempty" norman:"nocreate,noupdate"`
Protocol string `json:"protocol,omitempty" norman:"nocreate,noupdate"`

View File

@ -24,7 +24,7 @@ func (c *Creator) ToInternal(data map[string]interface{}) {
func (c *Creator) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
if schema.CanList(nil) && schema.CanCreate(nil) {
schema.ResourceFields["creatorId"] = types.Field{
Type: "reference[user]",
Type: "reference[/v3/schemas/user]",
CodeName: "CreatorID",
}
c.m = &mapper.AnnotationField{Field: "creatorId"}

View File

@ -27,7 +27,7 @@ func (n *NamespaceIDMapper) ModifySchema(schema *types.Schema, schemas *types.Sc
return nil
}
field.Type = "reference[namespace]"
field.Type = "reference[/v3/clusters/schemas/namespace]"
field.Required = true
field.Update = false
schema.ResourceFields["namespace"] = field