mirror of
https://github.com/rancher/types.git
synced 2025-09-23 10:57:13 +00:00
Add multi cluster app crd
This commit is contained in:
committed by
Alena Prokharchyk
parent
6ee2ac1678
commit
cd3f68581c
41
apis/management.cattle.io/v3/multi_cluster_app.go
Normal file
41
apis/management.cattle.io/v3/multi_cluster_app.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type MultiClusterApp struct {
|
||||
types.Namespaced
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// Standard object’s metadata. More info:
|
||||
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
// Specification of the desired behavior of the the cluster. More info:
|
||||
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status
|
||||
|
||||
Spec MultiClusterAppSpec `json:"spec"`
|
||||
Status MultiClusterAppStatus `json:"status"`
|
||||
}
|
||||
|
||||
type MultiClusterAppSpec struct {
|
||||
TemplateVersionName string `json:"templateVersionName,omitempty" norman:"type=reference[templateVersion],required"`
|
||||
Answers []Answer `json:"answers,omitempty"`
|
||||
Targets []Target `json:"targets,omitempty" norman:"required"`
|
||||
}
|
||||
|
||||
type MultiClusterAppStatus struct {
|
||||
Healthstate string `json:"healthState,omitempty"`
|
||||
}
|
||||
|
||||
type Target struct {
|
||||
ProjectName string `json:"projectName,omitempty" norman:"type=reference[project],required"`
|
||||
AppName string `json:"appName,omitempty" norman:"type=reference[v3/projects/schemas/app]"`
|
||||
Healthstate string `json:"healthState,omitempty"`
|
||||
}
|
||||
|
||||
type Answer struct {
|
||||
ProjectName string `json:"projectName,omitempty" norman:"type=reference[project]"`
|
||||
ClusterName string `json:"clusterName,omitempty" norman:"type=reference[cluster]"`
|
||||
Values map[string]string `json:"values,omitempty" norman:"required"`
|
||||
}
|
@@ -36,7 +36,8 @@ var (
|
||||
Init(alertTypes).
|
||||
Init(composeType).
|
||||
Init(projectCatalogTypes).
|
||||
Init(clusterCatalogTypes)
|
||||
Init(clusterCatalogTypes).
|
||||
Init(multiClusterAppTypes)
|
||||
|
||||
TokenSchemas = factory.Schemas(&Version).
|
||||
Init(tokens)
|
||||
@@ -578,3 +579,10 @@ func clusterCatalogTypes(schemas *types.Schemas) *types.Schemas {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func multiClusterAppTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
AddMapperForType(&Version, v3.MultiClusterApp{}, m.Drop{Field: "namespaceId"}).
|
||||
MustImport(&Version, v3.MultiClusterApp{}).
|
||||
MustImport(&Version, v3.Target{})
|
||||
}
|
||||
|
@@ -17,14 +17,15 @@ type App struct {
|
||||
}
|
||||
|
||||
type AppSpec struct {
|
||||
ProjectName string `json:"projectName,omitempty" norman:"type=reference[/v3/schemas/project]"`
|
||||
Description string `json:"description,omitempty"`
|
||||
TargetNamespace string `json:"targetNamespace,omitempty"`
|
||||
ExternalID string `json:"externalId,omitempty"`
|
||||
Files map[string]string `json:"files,omitempty"`
|
||||
Answers map[string]string `json:"answers,omitempty"`
|
||||
AppRevisionName string `json:"appRevisionName,omitempty" norman:"type=reference[/v3/project/schemas/apprevision]"`
|
||||
Prune bool `json:"prune,omitempty"`
|
||||
ProjectName string `json:"projectName,omitempty" norman:"type=reference[/v3/schemas/project]"`
|
||||
Description string `json:"description,omitempty"`
|
||||
TargetNamespace string `json:"targetNamespace,omitempty"`
|
||||
ExternalID string `json:"externalId,omitempty"`
|
||||
Files map[string]string `json:"files,omitempty"`
|
||||
Answers map[string]string `json:"answers,omitempty"`
|
||||
AppRevisionName string `json:"appRevisionName,omitempty" norman:"type=reference[/v3/project/schemas/apprevision]"`
|
||||
Prune bool `json:"prune,omitempty"`
|
||||
MultiClusterAppName string `json:"multiClusterAppName,omitempty" norman:"type=reference[/v3/schemas/multiclusterapp]"`
|
||||
}
|
||||
|
||||
var (
|
||||
|
Reference in New Issue
Block a user