Skip to content

Commit

Permalink
feat: [CDS-86002]: added support for PDC connector (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitsafronovici authored Dec 18, 2023
1 parent 2738850 commit 9401410
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 41 deletions.
3 changes: 3 additions & 0 deletions harness/nextgen/enum_connector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var ConnectorTypes = struct {
ElasticSearch ConnectorType
Rancher ConnectorType
CustomHealth ConnectorType
Pdc ConnectorType
}{
K8sCluster: "K8sCluster",
Git: "Git",
Expand Down Expand Up @@ -88,6 +89,7 @@ var ConnectorTypes = struct {
ElasticSearch: "ElasticSearch",
Rancher: "Rancher",
CustomHealth: "CustomHealth",
Pdc: "Pdc",
}

var ConnectorTypesSlice = []string{
Expand Down Expand Up @@ -133,6 +135,7 @@ var ConnectorTypesSlice = []string{
ConnectorTypes.ElasticSearch.String(),
ConnectorTypes.Rancher.String(),
ConnectorTypes.CustomHealth.String(),
ConnectorTypes.Pdc.String(),
}

func (c ConnectorType) String() string {
Expand Down
83 changes: 42 additions & 41 deletions harness/nextgen/model_connector_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,45 +29,46 @@ type ConnectorInfo struct {
// Tags
Tags map[string]string `json:"tags,omitempty"`
// Type of the Connector.
Type_ ConnectorType `json:"type"`
AppDynamics *AppDynamicsConnectorDto `json:"-"`
Artifactory *ArtifactoryConnector `json:"-"`
Aws *AwsConnector `json:"-"`
AwsCC *CeAwsConnector `json:"-"`
AwsKms *AwsKmsConnector `json:"-"`
AwsSecretManager *AwsSecretManager `json:"-"`
AzureCloudCost *CeAzureConnector `json:"-"`
Azure *AzureConnector `json:"-"`
AzureKeyVault *AzureKeyVaultConnector `json:"-"`
BitBucket *BitbucketConnector `json:"-"`
Datadog *DatadogConnectorDto `json:"-"`
DockerRegistry *DockerConnector `json:"-"`
Dynatrace *DynatraceConnectorDto `json:"-"`
Gcp *GcpConnector `json:"-"`
GcpCloudCost *GcpCloudCostConnectorDto `json:"-"`
Git *GitConfig `json:"-"`
Github *GithubConnector `json:"-"`
Gitlab *GitlabConnector `json:"-"`
HttpHelm *HttpHelmConnector `json:"-"`
OciHelm *OciHelmConnector `json:"-"`
Jira *JiraConnector `json:"-"`
Jenkins *JenkinsConnector `json:"-"`
K8sCluster *KubernetesClusterConfig `json:"-"`
K8sClusterCloudCost *CeKubernetesClusterConfigDto `json:"-"`
NewRelic *NewRelicConnectorDto `json:"-"`
Nexus *NexusConnector `json:"-"`
PagerDuty *PagerDutyConnectorDto `json:"-"`
Prometheus *PrometheusConnectorDto `json:"-"`
Splunk *SplunkConnector `json:"-"`
SumoLogic *SumoLogicConnectorDto `json:"-"`
Spot *SpotConnector `json:"-"`
Tas *TasConnector `json:"-"`
TerraformCloud *TerraformCloudConnector `json:"-"`
Vault *VaultConnector `json:"-"`
GcpSecretManager *GcpSecretManager `json:"-"`
ServiceNow *ServiceNowConnector `json:"-"`
Spec json.RawMessage `json:"spec"`
ElasticSearch *ElkConnectorDto `json:"-"`
Rancher *RancherConnector `json:"-"`
CustomHealth *CustomHealthConnectorDto `json:"-"`
Type_ ConnectorType `json:"type"`
AppDynamics *AppDynamicsConnectorDto `json:"-"`
Artifactory *ArtifactoryConnector `json:"-"`
Aws *AwsConnector `json:"-"`
AwsCC *CeAwsConnector `json:"-"`
AwsKms *AwsKmsConnector `json:"-"`
AwsSecretManager *AwsSecretManager `json:"-"`
AzureCloudCost *CeAzureConnector `json:"-"`
Azure *AzureConnector `json:"-"`
AzureKeyVault *AzureKeyVaultConnector `json:"-"`
BitBucket *BitbucketConnector `json:"-"`
Datadog *DatadogConnectorDto `json:"-"`
DockerRegistry *DockerConnector `json:"-"`
Dynatrace *DynatraceConnectorDto `json:"-"`
Gcp *GcpConnector `json:"-"`
GcpCloudCost *GcpCloudCostConnectorDto `json:"-"`
Git *GitConfig `json:"-"`
Github *GithubConnector `json:"-"`
Gitlab *GitlabConnector `json:"-"`
HttpHelm *HttpHelmConnector `json:"-"`
OciHelm *OciHelmConnector `json:"-"`
Jira *JiraConnector `json:"-"`
Jenkins *JenkinsConnector `json:"-"`
K8sCluster *KubernetesClusterConfig `json:"-"`
K8sClusterCloudCost *CeKubernetesClusterConfigDto `json:"-"`
NewRelic *NewRelicConnectorDto `json:"-"`
Nexus *NexusConnector `json:"-"`
PagerDuty *PagerDutyConnectorDto `json:"-"`
Prometheus *PrometheusConnectorDto `json:"-"`
Splunk *SplunkConnector `json:"-"`
SumoLogic *SumoLogicConnectorDto `json:"-"`
Spot *SpotConnector `json:"-"`
Tas *TasConnector `json:"-"`
TerraformCloud *TerraformCloudConnector `json:"-"`
Vault *VaultConnector `json:"-"`
GcpSecretManager *GcpSecretManager `json:"-"`
ServiceNow *ServiceNowConnector `json:"-"`
Spec json.RawMessage `json:"spec"`
ElasticSearch *ElkConnectorDto `json:"-"`
Rancher *RancherConnector `json:"-"`
CustomHealth *CustomHealthConnectorDto `json:"-"`
Pdc *PhysicalDataCenterConnectorDto `json:"-"`
}
4 changes: 4 additions & 0 deletions harness/nextgen/model_connector_info_serializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ func (a *ConnectorInfo) UnmarshalJSON(data []byte) error {
err = json.Unmarshal(aux.Spec, &a.Rancher)
case ConnectorTypes.CustomHealth:
err = json.Unmarshal(aux.Spec, &a.CustomHealth)
case ConnectorTypes.Pdc:
err = json.Unmarshal(aux.Spec, &a.Pdc)
default:
panic(fmt.Sprintf("unknown connector type %s", a.Type_))
}
Expand Down Expand Up @@ -191,6 +193,8 @@ func (a *ConnectorInfo) MarshalJSON() ([]byte, error) {
spec, err = json.Marshal(a.Rancher)
case ConnectorTypes.CustomHealth:
spec, err = json.Marshal(a.CustomHealth)
case ConnectorTypes.Pdc:
spec, err = json.Marshal(a.Pdc)
default:
panic(fmt.Sprintf("unknown connector type %s", a.Type_))
}
Expand Down

0 comments on commit 9401410

Please sign in to comment.