Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "pack/k8s/sync/repo"

Index

Variables

Const defaultDefaultBranch

defaultDefaultBranch: "master" = "master"

Functions

isRemoteRepo

  • isRemoteRepo(repo: SyncRepoRef | RemoteRepoRef): repo is RemoteRepoRef

queryForScmProvider

  • queryForScmProvider(configuration: Configuration): Promise<boolean>
  • If called and no sync repo is provided in the SDM configuration, a warning is emitted and undefined is returned.

    If the SDM configuration contains a RemoteRepoRef as the value of the sdm.configuration.sdm.k8s.options.sync.repo option and truthy credentials, those are returned.

    Otherwise, the code cycles through all workspaces, querying cortex for the information it needs. If the value of the sync.repo option is a SyncRepoRef, each workspace is queried for a repo matching the provided sync repo. If none is found, it cycles through all the workspaces again querying for all SCM providers and try to clone the repo with the provided credentials or, if no credentials are provided, the SCM provider credentials from cortex. Once a repo is found using either method, an object is returned with its remote repo ref and the credentials able to clone it. In addition, the sdm passed in will have its sdm.configuration.sdm.k8s.options.sync.repo andsdm.configuration.sdm.k8s.options.sync.credentials updated with the objects appropriate objects.

    Parameters

    • configuration: Configuration

    Returns Promise<boolean>

    true if sync options set and repo found or false and sync options deleted

queryRepo

queryScm

  • For each SDM provider in cortex in each workspace, try to clone the sync repo. Return the information for the first successful clone.

    Parameters

    • configuration: Configuration

    Returns Promise<RepoCredentials | undefined>

repoCredentials

  • Create RemoteRepoRef and Credentials object from SDM and repo from cortex. If the provided repo does not contain an org with a provider, it returns undefined. Otherwise it uses the SCM provider to call scmCredentials and return its value.

    Parameters

    • configuration: Configuration
    • repo: Repo
    • workspaceId: string

    Returns Promise<RepoCredentials | undefined>

repoSlug

scmCredentials

  • Given the SDM and an SCM, use the configured repo ref resolver to create a RemoteRepoRef. Use the SDM Kubernetes option sync credentials or SCM credential.secret to create the credentials, giving the SDM sync credentials preference. Return undefined if there is not enough information to created the repo credential object.

    Parameters

    • configuration: Configuration
    • scm: ScmProvider
    • workspaceId: string

    Returns Promise<RepoCredentials | undefined>

syncRepoRef

  • syncRepoRef(configuration: Configuration): SyncRepoRef | RemoteRepoRef
  • Extract the Kubernetes option sync repo from the SDM configuration. This function should only be called if the sync repo object is defined.

    Parameters

    • configuration: Configuration

    Returns SyncRepoRef | RemoteRepoRef

Generated using TypeDoc