From 04c6046d70a65d4644a893d7701dfe4747355b81 Mon Sep 17 00:00:00 2001 From: Deepak Bhatt Date: Fri, 29 Nov 2024 11:16:42 +0000 Subject: [PATCH] feat: [CDE-502]: add nexus connector support (#3080) * address feedback * add nexus connector support --- types/platform_connector.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/types/platform_connector.go b/types/platform_connector.go index e993484de..3061688a8 100644 --- a/types/platform_connector.go +++ b/types/platform_connector.go @@ -15,9 +15,10 @@ package types const ( - UnknownPlatformConnectorType PlatformConnectorType = "unknown" + UnknownPlatformConnectorType PlatformConnectorType = "Unknown" ArtifactoryPlatformConnectorType PlatformConnectorType = "Artifactory" DockerRegistryPlatformConnectorType PlatformConnectorType = "DockerRegistry" + NexusPlatformConnectorType PlatformConnectorType = "Nexus" UnknownPlatformConnectorAuthType PlatformConnectorAuthType = "unknown" UserNamePasswordPlatformConnectorAuthType PlatformConnectorAuthType = "UsernamePassword" @@ -28,6 +29,7 @@ var ( platformConnectorTypeMapping = map[string]PlatformConnectorType{ ArtifactoryPlatformConnectorType.String(): ArtifactoryPlatformConnectorType, DockerRegistryPlatformConnectorType.String(): DockerRegistryPlatformConnectorType, + NexusPlatformConnectorType.String(): NexusPlatformConnectorType, } platformConnectorAuthTypeMapping = map[string]PlatformConnectorAuthType{ @@ -72,8 +74,10 @@ type PlatformConnectorSpec struct { ArtifactoryURL string // DockerRegistryURL is for DockerRegistryPlatformConnectorType DockerRegistryURL string - AuthSpec PlatformConnectorAuthSpec - EnabledProxy bool + // NexusRegistryURL is for NexusPlatformConnectorType + NexusRegistryURL string + AuthSpec PlatformConnectorAuthSpec + EnabledProxy bool } // PlatformConnectorAuthSpec provide auth details. @@ -94,6 +98,8 @@ func (c PlatformConnectorSpec) ExtractRegistryURL() string { return c.DockerRegistryURL case ArtifactoryPlatformConnectorType: return c.ArtifactoryURL + case NexusPlatformConnectorType: + return c.NexusRegistryURL case UnknownPlatformConnectorType: return "" default: