From da7b866f23b68dc0a6053aa80da53ab778ea4524 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Sat, 28 Dec 2024 21:39:44 +0100 Subject: [PATCH] feat(manager.registry): Add external registry management --- changelog.md | 7 +++++ ts/00_commitinfo_data.ts | 2 +- .../classes.externalregistry.ts | 30 +++++++++++++++++++ ts_interfaces/data/externalregistry.ts | 12 ++++++++ ts_interfaces/data/image.ts | 4 +++ ts_interfaces/data/index.ts | 1 + ts_web/00_commitinfo_data.ts | 2 +- 7 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 ts/manager.regsitry/classes.externalregistry.ts create mode 100644 ts_interfaces/data/externalregistry.ts diff --git a/changelog.md b/changelog.md index 3fb7c54..1671be2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2024-12-28 - 4.8.0 - feat(manager.registry) +Add external registry management + +- Introduced ExternalRegistry class for handling external registry configurations. +- Updated IExternalRegistry interface to include registry details. +- Enhanced IImage interface to support linking with external registries. + ## 2024-12-28 - 4.7.1 - fix(secretmanagement) Refactor secret bundle actions and improve authorization handling diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index d4fc889..8b32ca0 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/cloudly', - version: '4.7.1', + version: '4.8.0', description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.' } diff --git a/ts/manager.regsitry/classes.externalregistry.ts b/ts/manager.regsitry/classes.externalregistry.ts new file mode 100644 index 0000000..0bae5c5 --- /dev/null +++ b/ts/manager.regsitry/classes.externalregistry.ts @@ -0,0 +1,30 @@ +import * as plugins from '../plugins.js'; +import * as paths from '../paths.js'; +import type { Cloudly } from 'ts/classes.cloudly.js'; + +export class ExternalRegistry extends plugins.smartdata.SmartDataDbDoc { + // STATIC + public async getRegistryById(registryNameArg: string) { + this + } + + // INSTANCE + public cloudlyRef: Cloudly; + public smartdataDb: plugins.smartdata.SmartdataDb; + + @plugins.smartdata.svDb() + public id: string; + + @plugins.smartdata.svDb() + public data: plugins.servezoneInterfaces.data.IExternalRegistry['data']; + + get db() { + return this.cloudlyRef.mongodbConnector.smartdataDb; + } + + constructor(cloudlyRef: Cloudly) { + super(); + this.cloudlyRef = cloudlyRef; + } + +} diff --git a/ts_interfaces/data/externalregistry.ts b/ts_interfaces/data/externalregistry.ts new file mode 100644 index 0000000..c7d0542 --- /dev/null +++ b/ts_interfaces/data/externalregistry.ts @@ -0,0 +1,12 @@ +import * as plugins from '../plugins.js'; + +export interface IExternalRegistry { + id: string; + data: { + type: 'docker' | 'npm'; + name: string; + url: string; + username: string; + password: string; + }; +} \ No newline at end of file diff --git a/ts_interfaces/data/image.ts b/ts_interfaces/data/image.ts index 5f0ab8d..cc114b9 100644 --- a/ts_interfaces/data/image.ts +++ b/ts_interfaces/data/image.ts @@ -4,6 +4,10 @@ export interface IImage { id: string; data: { name: string; + external?: { + externalRegistryId: string; + imageName: string; + } description: string; versions: Array<{ versionString: string; diff --git a/ts_interfaces/data/index.ts b/ts_interfaces/data/index.ts index cbd4fb6..0f94f10 100644 --- a/ts_interfaces/data/index.ts +++ b/ts_interfaces/data/index.ts @@ -4,6 +4,7 @@ export * from './config.js'; export * from './deployment.js'; export * from './docker.js'; export * from './event.js'; +export * from './externalregistry.js'; export * from './image.js'; export * from './secretbundle.js'; export * from './secretgroup.js' diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index d4fc889..8b32ca0 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/cloudly', - version: '4.7.1', + version: '4.8.0', description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.' }