Container registries
Manage project container registry credentials with @tektona/sdk.
tek.registry manages a project's container registry credentials. Every method
is project-scoped: it uses the client's default org/project, which any call
can override per-invocation. list, get, create, and update return a
RegistryResponse; secret fields (password, token) are never returned.
RegistryResponse fields: id, name, display_name, endpoint, namespace,
auth_type, has_credentials, owner, created_at, updated_at.
List
list returns one Page; listAll auto-pages:
const page = await tek.registry.list({ limit: 50 });
for await (const reg of tek.registry.listAll()) console.log(reg.name);Get
const reg = await tek.registry.get('ghcr'); // by URL-safe nameCreate
auth_type is one of 'basic', 'personal_access_token', or 'bearer'. Provide
username/password for basic, username/token for a personal access token,
or token for bearer. Pass { dryRun: true } as the trailing options to test the
connection without saving.
const reg = await tek.registry.create({
name: 'ghcr',
display_name: 'GitHub Container Registry',
endpoint: 'ghcr.io',
auth_type: 'personal_access_token',
namespace: 'my-org',
username: 'bot',
token: process.env.GHCR_TOKEN,
});Update
Identify the registry by its URL-safe name. Secret fields omitted keep their existing value:
await tek.registry.update('ghcr', {
display_name: 'GHCR',
endpoint: 'ghcr.io',
auth_type: 'bearer',
token: process.env.GHCR_TOKEN, // omit to keep the stored token
});Delete
await tek.registry.delete('ghcr'); // idempotent: a missing registry resolves cleanly