mirror of
https://github.com/rancher/types.git
synced 2025-06-28 14:36:50 +00:00
catalog types changes
This commit is contained in:
parent
87897aa616
commit
02f805be04
@ -26,7 +26,8 @@ var (
|
||||
Init(clusterTypes).
|
||||
Init(catalogTypes).
|
||||
Init(authnTypes).
|
||||
Init(schemaTypes)
|
||||
Init(schemaTypes).
|
||||
Init(stackTypes)
|
||||
)
|
||||
|
||||
func schemaTypes(schemas *types.Schemas) *types.Schemas {
|
||||
@ -200,3 +201,17 @@ func authnTypes(schemas *types.Schemas) *types.Schemas {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func stackTypes(schema *types.Schemas) *types.Schemas {
|
||||
return schema.
|
||||
MustImportAndCustomize(&Version, v3.Stack{}, func(schema *types.Schema) {
|
||||
schema.ResourceActions = map[string]types.Action{
|
||||
"upgrade": {
|
||||
Input: "templateVersionId",
|
||||
},
|
||||
"rollback": {
|
||||
Input: "revision",
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
||||
|
40
apis/management.cattle.io/v3/stack_types.go
Normal file
40
apis/management.cattle.io/v3/stack_types.go
Normal file
@ -0,0 +1,40 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type Stack struct {
|
||||
types.Namespaced
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec StackSpec `json:"spec,omitempty"`
|
||||
Status StackStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
type StackSpec struct {
|
||||
ProjectName string `json:"projectName,omitempty" norman:"type=reference[project]"`
|
||||
Description string `json:"description,omitempty"`
|
||||
InstallNamespace string `json:"installNamespace,omitempty"`
|
||||
TemplateVersionID string `json:"templateVersionId,omitempty"`
|
||||
Templates map[string]string `json:"templates,omitempty"`
|
||||
Answers map[string]string `json:"answers,omitempty"`
|
||||
Prune bool `json:"prune,omitempty"`
|
||||
Tag map[string]string `json:"tag,omitempty"`
|
||||
User string `json:"user,omitempty"`
|
||||
Groups []string `json:"groups,omitempty"`
|
||||
}
|
||||
|
||||
type StackStatus struct {
|
||||
Releases []ReleaseInfo `json:"releases,omitempty"`
|
||||
}
|
||||
|
||||
type ReleaseInfo struct {
|
||||
Name string `json:"name"`
|
||||
Version string `json:"version"`
|
||||
CreateTimestamp string `json:"createTimestamp"`
|
||||
ModifiedAt string `json:"modifiedAt"`
|
||||
TemplateVersionID string `json:"templateVersionId"`
|
||||
}
|
@ -35,9 +35,18 @@ var (
|
||||
Init(replicaSet).
|
||||
Init(replicationController).
|
||||
Init(daemonSet).
|
||||
Init(workloadTypes)
|
||||
Init(workloadTypes).
|
||||
Init(configMapTypes)
|
||||
)
|
||||
|
||||
func configMapTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return ConfigMapTypes(&Version, schemas)
|
||||
}
|
||||
|
||||
func ConfigMapTypes(version *types.APIVersion, schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.MustImport(version, v1.ConfigMap{})
|
||||
}
|
||||
|
||||
func namespaceTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return NamespaceTypes(&Version, schemas)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user