Documentation ¶
Index ¶
- Constants
- Variables
- func DecideRevisionName(sm ServiceManifest, commit string) (string, error)
- func FindArtifactVersions(sm ServiceManifest) ([]*model.ArtifactVersion, error)
- func FindImageTag(sm ServiceManifest) (string, error)
- func MakeManagedByPipedSelector() string
- func MakeResourceStates(svc *Service, revs []*Revision, updatedAt time.Time) []*model.CloudRunResourceState
- func MakeRevisionNamesSelector(names []string) string
- type Client
- type DiffRenderOptions
- type DiffResult
- type Kind
- type ListOptions
- type ListRevisionsOptions
- type Registry
- type Revision
- type RevisionManifest
- type RevisionTraffic
- type Service
- type ServiceManifest
- func (m ServiceManifest) AddLabels(labels map[string]string)
- func (m ServiceManifest) AddRevisionLabels(labels map[string]string) error
- func (m ServiceManifest) AppID() (string, bool)
- func (m ServiceManifest) Labels() map[string]string
- func (m ServiceManifest) RevisionLabels() map[string]string
- func (m ServiceManifest) RunService() (*run.Service, error)
- func (m ServiceManifest) SetRevision(name string) error
- func (m ServiceManifest) UpdateAllTraffic(revision string) error
- func (m ServiceManifest) UpdateTraffic(revisions []RevisionTraffic) error
- func (m ServiceManifest) YamlBytes() ([]byte, error)
- type ServiceManifestCache
- type StatusConditions
Constants ¶
View Source
const ( LabelManagedBy = "pipecd-dev-managed-by" // Always be piped. LabelPiped = "pipecd-dev-piped" // The id of piped handling this application. LabelApplication = "pipecd-dev-application" // The application this resource belongs to. LabelCommitHash = "pipecd-dev-commit-hash" // Hash value of the deployed commit. LabelRevisionName = "pipecd-dev-revision-name" // The name of revision. ManagedByPiped = "piped" )
View Source
const (
DefaultServiceManifestFilename = "service.yaml"
)
Variables ¶
View Source
var ( ErrServiceNotFound = errors.New("not found") ErrRevisionNotFound = errors.New("not found") )
View Source
var ( TypeConditions = map[string]struct{}{ "Active": struct{}{}, "Ready": struct{}{}, "ConfigurationsReady": struct{}{}, "RoutesReady": struct{}{}, "ContainerHealthy": struct{}{}, "ResourcesAvailable": struct{}{}, } TypeHealthyServiceConditions = map[string]struct{}{ "Ready": struct{}{}, "ConfigurationsReady": struct{}{}, "RoutesReady": struct{}{}, } TypeHealthyRevisionConditions = map[string]struct{}{ "Ready": struct{}{}, "Active": struct{}{}, "ContainerHealthy": struct{}{}, "ResourcesAvailable": struct{}{}, } )
Functions ¶
func DecideRevisionName ¶
func DecideRevisionName(sm ServiceManifest, commit string) (string, error)
func FindArtifactVersions ¶
func FindArtifactVersions(sm ServiceManifest) ([]*model.ArtifactVersion, error)
func FindImageTag ¶
func FindImageTag(sm ServiceManifest) (string, error)
func MakeManagedByPipedSelector ¶
func MakeManagedByPipedSelector() string
func MakeResourceStates ¶
Types ¶
type Client ¶
type Client interface { Create(ctx context.Context, sm ServiceManifest) (*Service, error) Update(ctx context.Context, sm ServiceManifest) (*Service, error) List(ctx context.Context, options *ListOptions) ([]*Service, string, error) GetRevision(ctx context.Context, name string) (*Revision, error) ListRevisions(ctx context.Context, options *ListRevisionsOptions) ([]*Revision, string, error) }
type DiffRenderOptions ¶
type DiffRenderOptions struct { // If true, use "diff" command to render. UseDiffCommand bool }
type DiffResult ¶
type DiffResult struct { Diff *diff.Result Old ServiceManifest New ServiceManifest }
func Diff ¶
func Diff(old, new ServiceManifest, opts ...diff.Option) (*DiffResult, error)
func (*DiffResult) NoChange ¶
func (d *DiffResult) NoChange() bool
func (*DiffResult) Render ¶
func (d *DiffResult) Render(opt DiffRenderOptions) string
type ListOptions ¶
type ListRevisionsOptions ¶
type Registry ¶
type Registry interface {
Client(ctx context.Context, name string, cfg *config.PlatformProviderCloudRunConfig, logger *zap.Logger) (Client, error)
}
func DefaultRegistry ¶
func DefaultRegistry() Registry
type Revision ¶
type Revision run.Revision
func (*Revision) RevisionManifest ¶
func (r *Revision) RevisionManifest() (RevisionManifest, error)
func (*Revision) StatusConditions ¶
func (r *Revision) StatusConditions() *StatusConditions
type RevisionManifest ¶
type RevisionManifest struct { Name string // contains filtered or unexported fields }
func ParseRevisionManifest ¶
func ParseRevisionManifest(data []byte) (RevisionManifest, error)
func (RevisionManifest) RunRevision ¶
func (r RevisionManifest) RunRevision() (*run.Revision, error)
func (RevisionManifest) YamlBytes ¶
func (r RevisionManifest) YamlBytes() ([]byte, error)
type RevisionTraffic ¶
type Service ¶
type Service run.Service
func (*Service) ActiveRevisionNames ¶
ActiveRevisionNames returns all its active revisions which may handle the traffic.
func (*Service) ServiceManifest ¶
func (s *Service) ServiceManifest() (ServiceManifest, error)
func (*Service) StatusConditions ¶
func (s *Service) StatusConditions() *StatusConditions
type ServiceManifest ¶
type ServiceManifest struct { Name string // contains filtered or unexported fields }
func LoadServiceManifest ¶
func LoadServiceManifest(appDir, serviceFilename string) (ServiceManifest, error)
func ParseServiceManifest ¶
func ParseServiceManifest(data []byte) (ServiceManifest, error)
func (ServiceManifest) AddLabels ¶
func (m ServiceManifest) AddLabels(labels map[string]string)
func (ServiceManifest) AddRevisionLabels ¶
func (m ServiceManifest) AddRevisionLabels(labels map[string]string) error
func (ServiceManifest) AppID ¶
func (m ServiceManifest) AppID() (string, bool)
func (ServiceManifest) Labels ¶
func (m ServiceManifest) Labels() map[string]string
func (ServiceManifest) RevisionLabels ¶
func (m ServiceManifest) RevisionLabels() map[string]string
func (ServiceManifest) RunService ¶
func (m ServiceManifest) RunService() (*run.Service, error)
func (ServiceManifest) SetRevision ¶
func (m ServiceManifest) SetRevision(name string) error
func (ServiceManifest) UpdateAllTraffic ¶
func (m ServiceManifest) UpdateAllTraffic(revision string) error
func (ServiceManifest) UpdateTraffic ¶
func (m ServiceManifest) UpdateTraffic(revisions []RevisionTraffic) error
func (ServiceManifest) YamlBytes ¶
func (m ServiceManifest) YamlBytes() ([]byte, error)
type ServiceManifestCache ¶
func (ServiceManifestCache) Get ¶
func (c ServiceManifestCache) Get(commit string) (ServiceManifest, bool)
func (ServiceManifestCache) Put ¶
func (c ServiceManifestCache) Put(commit string, sm ServiceManifest)
type StatusConditions ¶
type StatusConditions struct { Kind Kind TrueTypes map[string]struct{} // Eliminate duplicated messages with the same reason. FalseMessages []string UnknownMessages []string }
func (*StatusConditions) HealthStatus ¶
func (s *StatusConditions) HealthStatus() (model.CloudRunResourceState_HealthStatus, string)
Click to show internal directories.
Click to hide internal directories.