mirror of
https://github.com/rancher/types.git
synced 2025-08-01 04:57:05 +00:00
add catalog condition
This commit is contained in:
parent
a78c745baa
commit
73aa2d76dc
@ -1,6 +1,8 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/condition"
|
||||
"k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
@ -27,6 +29,26 @@ type CatalogStatus struct {
|
||||
Commit string `json:"commit,omitempty"`
|
||||
// helmVersionCommits records hash of each helm template version
|
||||
HelmVersionCommits map[string]VersionCommits `json:"helmVersionCommits,omitempty"`
|
||||
Conditions []CatalogCondition `json:"conditions,omitempty"`
|
||||
}
|
||||
|
||||
var (
|
||||
CatalogConditionRefreshed condition.Cond = "Refreshed"
|
||||
)
|
||||
|
||||
type CatalogCondition struct {
|
||||
// Type of cluster condition.
|
||||
Type ClusterConditionType `json:"type"`
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
Status v1.ConditionStatus `json:"status"`
|
||||
// The last time this condition was updated.
|
||||
LastUpdateTime string `json:"lastUpdateTime,omitempty"`
|
||||
// Last time the condition transitioned from one status to another.
|
||||
LastTransitionTime string `json:"lastTransitionTime,omitempty"`
|
||||
// The reason for the condition's last transition.
|
||||
Reason string `json:"reason,omitempty"`
|
||||
// Human-readable message indicating details about last transition
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
type VersionCommits struct {
|
||||
|
@ -53,8 +53,17 @@ func catalogTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
AddMapperForType(&Version, v3.Catalog{},
|
||||
&m.Move{From: "catalogKind", To: "kind"},
|
||||
&m.Embed{Field: "status"},
|
||||
&m.Drop{Field: "helmVersionCommits"},
|
||||
).
|
||||
MustImport(&Version, v3.Catalog{}).
|
||||
MustImportAndCustomize(&Version, v3.Catalog{}, func(schema *types.Schema) {
|
||||
schema.ResourceActions = map[string]types.Action{
|
||||
"refresh": {},
|
||||
}
|
||||
schema.CollectionActions = map[string]types.Action{
|
||||
"refresh": {},
|
||||
}
|
||||
}).
|
||||
MustImport(&Version, v3.Template{}).
|
||||
MustImport(&Version, v3.TemplateVersion{})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user