diff --git a/pkg/kubeserver/api/container_registry.go b/pkg/kubeserver/api/container_registry.go index 606e1b18..729ad3d0 100644 --- a/pkg/kubeserver/api/container_registry.go +++ b/pkg/kubeserver/api/container_registry.go @@ -28,6 +28,7 @@ type ContainerRegistryConfigHarbor struct { } type ContainerRegistryConfig struct { + Type ContainerRegistryType `json:"type"` Common *ContainerRegistryConfigCommon `json:"common` Harbor *ContainerRegistryConfigHarbor `json:"harbor"` } diff --git a/pkg/kubeserver/models/container_registries.go b/pkg/kubeserver/models/container_registries.go index abc6ec3f..8e50d861 100644 --- a/pkg/kubeserver/models/container_registries.go +++ b/pkg/kubeserver/models/container_registries.go @@ -125,6 +125,7 @@ func (r *SContainerRegistry) GetConfig() (*api.ContainerRegistryConfig, error) { if err := r.Config.Unmarshal(conf); err != nil { return nil, err } + conf.Type = api.ContainerRegistryType(r.Type) return conf, nil } @@ -185,6 +186,10 @@ func (r *SContainerRegistry) GetDetailsImageTags(ctx context.Context, userCred m return rgCli.ListImageTags(ctx, query.Repository) } +func (r *SContainerRegistry) GetDetailsConfig(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (*api.ContainerRegistryConfig, error) { + return r.GetConfig() +} + func (m *SContainerRegistryManager) CustomizeHandlerInfo(info *appsrv.SHandlerInfo) { m.SSharableVirtualResourceBaseManager.CustomizeHandlerInfo(info)