Documentation
¶
Index ¶
- Constants
- Variables
- func DebugPulumiCD(ctx context.Context, env []string, cmd ...string) error
- func DebugPulumiGolang(ctx context.Context, env []string, cmd ...string) error
- func DebugPulumiNodeJS(ctx context.Context, env []string, cmd ...string) error
- func GetPulumiBackend(stateUrl string) (string, string, error)
- func ParseTTL(value string, now time.Time) (string, error)
- type ByocBaseClient
- func (b *ByocBaseClient) GetEndpoint(serviceName string, projectName, delegateDomain string, ...) string
- func (b *ByocBaseClient) GetPrivateFqdn(projectName string, serviceName string) string
- func (b *ByocBaseClient) GetProjectLabel(projectName string) string
- func (b *ByocBaseClient) GetProjectUpdatePath(projectName string) string
- func (b *ByocBaseClient) GetPublicFqdn(projectName, delegateDomain, serviceName string) string
- func (b *ByocBaseClient) GetServiceInfos(ctx context.Context, projectName, delegateDomain, etag string, ...) ([]*defangv1.ServiceInfo, error)
- func (b *ByocBaseClient) GetStackName() string
- func (b *ByocBaseClient) GetStackNameForDomain() string
- func (b *ByocBaseClient) HasDelegatedSubdomain() bool
- func (b *ByocBaseClient) RemoteProjectName(ctx context.Context) (string, error)
- func (b *ByocBaseClient) ServicePrivateDNS(serviceName string) string
- func (b *ByocBaseClient) ServicePublicDNS(serviceName string, projectName string) string
- func (b *ByocBaseClient) SetCanIUseConfig(quotas *defangv1.CanIUseResponse)
- func (b *ByocBaseClient) StackDir(projectName, name string) string
- func (*ByocBaseClient) UpdateShardDomain(ctx context.Context) error
- type CanIUseConfig
- type ErrMultipleProjects
- type ErrNoPermission
- type Node
- type ProjectBackend
- type ServiceInfoUpdater
Constants ¶
const ( CdTaskPrefix = "defang-cd" // WARNING: renaming this practically deletes the Pulumi state UploadPrefix = "uploads/" )
Variables ¶
var ( DefangPulumiBackend = os.Getenv("DEFANG_PULUMI_BACKEND") // FIXME: allow override in .defang file ErrLocalPulumiStopped = errors.New("local pulumi command succeeded; stopping") PulumiConfigPassphrase = pkg.Getenv("PULUMI_CONFIG_PASSPHRASE", "asdf") // FIXME: allow override in .defang file )
Functions ¶
func DebugPulumiCD ¶
DebugPulumiCD runs the multi-cloud cd binary (pulumi-defang/cd) locally instead of starting it as a cloud task. Gated on DEFANG_PULUMI_DIR pointing at the pulumi-defang repo root. Used to iterate on cd code without rebuilding/pushing the cd container image.
func DebugPulumiGolang ¶
func DebugPulumiNodeJS ¶
func ParseTTL ¶
ParseTTL normalizes a deployment time-to-live for the CD program, which reads it from the DEFANG_TTL env var of the CD run into its defang:ttl stack config (see parseTTL in pulumi-defang's cd/program/ttl.go) to schedule the stack's self-destruct. Accepted inputs:
- "", "0" and "never": no self-destruct
- a Go duration with an optional whole-days prefix ("12h", "7d", "7d12h"): passed through unchanged, the CD parses the same syntax
- a timestamp, in the same formats as `logs --since/--until` (RFC3339, unix seconds/millis): translated to the duration from now until that moment, because the CD only accepts durations
The minTTL floor is enforced here; the CD's maxTTL remains the sole, authoritative guard against typo'd far-future dates, so that rule cannot drift between the two sides.
Types ¶
type ByocBaseClient ¶
type ByocBaseClient struct {
client.RetryDelayer
Prefix string
PulumiStack string
SetupDone bool
TenantLabel types.TenantLabel
CanIUseConfig
// contains filtered or unexported fields
}
func NewByocBaseClient ¶
func NewByocBaseClient(tenantLabel types.TenantLabel, backend ProjectBackend, stack string) *ByocBaseClient
func (*ByocBaseClient) GetEndpoint ¶
func (b *ByocBaseClient) GetEndpoint(serviceName string, projectName, delegateDomain string, port *composeTypes.ServicePortConfig) string
This function was copied from Fabric controller and slightly modified to work with BYOC
func (*ByocBaseClient) GetPrivateFqdn ¶
func (b *ByocBaseClient) GetPrivateFqdn(projectName string, serviceName string) string
This function was copied from Fabric controller and slightly modified to work with BYOC
func (*ByocBaseClient) GetProjectLabel ¶
func (b *ByocBaseClient) GetProjectLabel(projectName string) string
GetProjectLabel returns the DNS-safe project label, including stack (if applicable)
func (*ByocBaseClient) GetProjectUpdatePath ¶
func (b *ByocBaseClient) GetProjectUpdatePath(projectName string) string
func (*ByocBaseClient) GetPublicFqdn ¶
func (b *ByocBaseClient) GetPublicFqdn(projectName, delegateDomain, serviceName string) string
This function was copied from Fabric controller and slightly modified to work with BYOC
func (*ByocBaseClient) GetServiceInfos ¶
func (b *ByocBaseClient) GetServiceInfos(ctx context.Context, projectName, delegateDomain, etag string, services map[string]composeTypes.ServiceConfig) ([]*defangv1.ServiceInfo, error)
func (*ByocBaseClient) GetStackName ¶
func (b *ByocBaseClient) GetStackName() string
func (*ByocBaseClient) GetStackNameForDomain ¶
func (b *ByocBaseClient) GetStackNameForDomain() string
func (*ByocBaseClient) HasDelegatedSubdomain ¶
func (b *ByocBaseClient) HasDelegatedSubdomain() bool
HasDelegatedSubdomain returns true by default; providers that do not yet implement domain delegation (DO) override this to return false.
func (*ByocBaseClient) RemoteProjectName ¶
func (b *ByocBaseClient) RemoteProjectName(ctx context.Context) (string, error)
func (*ByocBaseClient) ServicePrivateDNS ¶
func (b *ByocBaseClient) ServicePrivateDNS(serviceName string) string
func (*ByocBaseClient) ServicePublicDNS ¶
func (b *ByocBaseClient) ServicePublicDNS(serviceName string, projectName string) string
func (*ByocBaseClient) SetCanIUseConfig ¶
func (b *ByocBaseClient) SetCanIUseConfig(quotas *defangv1.CanIUseResponse)
func (*ByocBaseClient) StackDir ¶
func (b *ByocBaseClient) StackDir(projectName, name string) string
stackDir returns a stack-qualified path, like the Pulumi TS function `stackDir`
func (*ByocBaseClient) UpdateShardDomain ¶
func (*ByocBaseClient) UpdateShardDomain(ctx context.Context) error
type CanIUseConfig ¶
type ErrMultipleProjects ¶
type ErrMultipleProjects struct {
ProjectNames []string
}
func (ErrMultipleProjects) Error ¶
func (mp ErrMultipleProjects) Error() string
type ErrNoPermission ¶
type ErrNoPermission string
func (ErrNoPermission) Error ¶
func (e ErrNoPermission) Error() string
type Node ¶
type Node struct {
Name string
Deps []string
ServiceInfo *defangv1.ServiceInfo
Visited bool
}
Simple DFS topological sort to make sure the dependencies are created first
type ProjectBackend ¶
type ServiceInfoUpdater ¶
type ServiceInfoUpdater interface {
UpdateServiceInfo(ctx context.Context, serviceInfo *defangv1.ServiceInfo, projectName, delegateDomain string, service composeTypes.ServiceConfig) error
}