Skip to content

Commit

Permalink
feat: [PL-48389]: Custom Resource Manager terraform update (#517)
Browse files Browse the repository at this point in the history
* feat: [PL-48389]: Custom Resource Manager terraform update

* Add connector files
  • Loading branch information
Sarthak S authored Apr 15, 2024
1 parent e4966b9 commit 7305ea2
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 86 deletions.
175 changes: 89 additions & 86 deletions harness/nextgen/enum_connector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,93 +3,95 @@ package nextgen
type ConnectorType string

var ConnectorTypes = struct {
K8sCluster ConnectorType
Git ConnectorType
Splunk ConnectorType
AppDynamics ConnectorType
Azure ConnectorType
Prometheus ConnectorType
Dynatrace ConnectorType
Vault ConnectorType
AzureKeyVault ConnectorType
DockerRegistry ConnectorType
Local ConnectorType
AwsKms ConnectorType
GcpKms ConnectorType
AwsSecretManager ConnectorType
Gcp ConnectorType
Aws ConnectorType
Artifactory ConnectorType
Jira ConnectorType
Jenkins ConnectorType
Nexus ConnectorType
Github ConnectorType
Gitlab ConnectorType
Bitbucket ConnectorType
Codecommit ConnectorType
CEAws ConnectorType
CEAzure ConnectorType
GcpCloudCost ConnectorType
CEK8sCluster ConnectorType
HttpHelmRepo ConnectorType
OciHelmRepo ConnectorType
NewRelic ConnectorType
Datadog ConnectorType
SumoLogic ConnectorType
PagerDuty ConnectorType
GcpSecretManager ConnectorType
Spot ConnectorType
ServiceNow ConnectorType
Tas ConnectorType
TerraformCloud ConnectorType
ElasticSearch ConnectorType
Rancher ConnectorType
CustomHealth ConnectorType
Pdc ConnectorType
K8sCluster ConnectorType
Git ConnectorType
Splunk ConnectorType
AppDynamics ConnectorType
Azure ConnectorType
Prometheus ConnectorType
Dynatrace ConnectorType
Vault ConnectorType
AzureKeyVault ConnectorType
DockerRegistry ConnectorType
Local ConnectorType
AwsKms ConnectorType
GcpKms ConnectorType
AwsSecretManager ConnectorType
Gcp ConnectorType
Aws ConnectorType
Artifactory ConnectorType
Jira ConnectorType
Jenkins ConnectorType
Nexus ConnectorType
Github ConnectorType
Gitlab ConnectorType
Bitbucket ConnectorType
Codecommit ConnectorType
CEAws ConnectorType
CEAzure ConnectorType
GcpCloudCost ConnectorType
CEK8sCluster ConnectorType
HttpHelmRepo ConnectorType
OciHelmRepo ConnectorType
NewRelic ConnectorType
Datadog ConnectorType
SumoLogic ConnectorType
PagerDuty ConnectorType
GcpSecretManager ConnectorType
Spot ConnectorType
ServiceNow ConnectorType
Tas ConnectorType
TerraformCloud ConnectorType
ElasticSearch ConnectorType
Rancher ConnectorType
CustomHealth ConnectorType
Pdc ConnectorType
CustomSecretManager ConnectorType
}{
K8sCluster: "K8sCluster",
Git: "Git",
Splunk: "Splunk",
AppDynamics: "AppDynamics",
Prometheus: "Prometheus",
Dynatrace: "Dynatrace",
Vault: "Vault",
AzureKeyVault: "AzureKeyVault",
DockerRegistry: "DockerRegistry",
Local: "Local",
AwsKms: "AwsKms",
GcpKms: "GcpKms",
AwsSecretManager: "AwsSecretManager",
Gcp: "Gcp",
Aws: "Aws",
Artifactory: "Artifactory",
Jira: "Jira",
Jenkins: "Jenkins",
Nexus: "Nexus",
Github: "Github",
Gitlab: "Gitlab",
Bitbucket: "Bitbucket",
Codecommit: "Codecommit",
CEAws: "CEAws",
CEAzure: "CEAzure",
GcpCloudCost: "GcpCloudCost",
CEK8sCluster: "CEK8sCluster",
HttpHelmRepo: "HttpHelmRepo",
OciHelmRepo: "OciHelmRepo",
NewRelic: "NewRelic",
Datadog: "Datadog",
SumoLogic: "SumoLogic",
PagerDuty: "PagerDuty",
GcpSecretManager: "GcpSecretManager",
Azure: "Azure",
Spot: "Spot",
ServiceNow: "ServiceNow",
Tas: "Tas",
TerraformCloud: "TerraformCloud",
ElasticSearch: "ElasticSearch",
Rancher: "Rancher",
CustomHealth: "CustomHealth",
Pdc: "Pdc",
K8sCluster: "K8sCluster",
Git: "Git",
Splunk: "Splunk",
AppDynamics: "AppDynamics",
Prometheus: "Prometheus",
Dynatrace: "Dynatrace",
Vault: "Vault",
AzureKeyVault: "AzureKeyVault",
DockerRegistry: "DockerRegistry",
Local: "Local",
AwsKms: "AwsKms",
GcpKms: "GcpKms",
AwsSecretManager: "AwsSecretManager",
Gcp: "Gcp",
Aws: "Aws",
Artifactory: "Artifactory",
Jira: "Jira",
Jenkins: "Jenkins",
Nexus: "Nexus",
Github: "Github",
Gitlab: "Gitlab",
Bitbucket: "Bitbucket",
Codecommit: "Codecommit",
CEAws: "CEAws",
CEAzure: "CEAzure",
GcpCloudCost: "GcpCloudCost",
CEK8sCluster: "CEK8sCluster",
HttpHelmRepo: "HttpHelmRepo",
OciHelmRepo: "OciHelmRepo",
NewRelic: "NewRelic",
Datadog: "Datadog",
SumoLogic: "SumoLogic",
PagerDuty: "PagerDuty",
GcpSecretManager: "GcpSecretManager",
Azure: "Azure",
Spot: "Spot",
ServiceNow: "ServiceNow",
Tas: "Tas",
TerraformCloud: "TerraformCloud",
ElasticSearch: "ElasticSearch",
Rancher: "Rancher",
CustomHealth: "CustomHealth",
Pdc: "Pdc",
CustomSecretManager: "CustomSecretManager",
}

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

func (c ConnectorType) String() string {
Expand Down
1 change: 1 addition & 0 deletions harness/nextgen/model_connector_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type ConnectorInfo struct {
Azure *AzureConnector `json:"-"`
AzureKeyVault *AzureKeyVaultConnector `json:"-"`
BitBucket *BitbucketConnector `json:"-"`
CustomSecretManager *CustomSecretManager `json:"_"`
Datadog *DatadogConnectorDto `json:"-"`
DockerRegistry *DockerConnector `json:"-"`
Dynatrace *DynatraceConnectorDto `json:"-"`
Expand Down
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 @@ -101,6 +101,8 @@ func (a *ConnectorInfo) UnmarshalJSON(data []byte) error {
err = json.Unmarshal(aux.Spec, &a.CustomHealth)
case ConnectorTypes.Pdc:
err = json.Unmarshal(aux.Spec, &a.Pdc)
case ConnectorTypes.CustomSecretManager:
err = json.Unmarshal(aux.Spec, &a.CustomSecretManager)
default:
panic(fmt.Sprintf("unknown connector type %s", a.Type_))
}
Expand Down Expand Up @@ -195,6 +197,8 @@ func (a *ConnectorInfo) MarshalJSON() ([]byte, error) {
spec, err = json.Marshal(a.CustomHealth)
case ConnectorTypes.Pdc:
spec, err = json.Marshal(a.Pdc)
case ConnectorTypes.CustomSecretManager:
spec, err = json.Marshal(a.CustomSecretManager)
default:
panic(fmt.Sprintf("unknown connector type %s", a.Type_))
}
Expand Down
21 changes: 21 additions & 0 deletions harness/nextgen/model_custom_secret_manager.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* CD NextGen API Reference
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: 2.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
// package swagger
package nextgen

type CustomSecretManager struct {
DelegateSelectors []string `json:"delegateSelectors,omitempty"`
OnDelegate bool `json:"onDelegate,omitempty"`
ConnectorRef string `json:"connectorRef,omitempty"`
Host string `json:"host,omitempty"`
WorkingDirectory string `json:"workingDirectory,omitempty"`
Template *TemplateLinkConfigForCustomSecretManager `json:"template"`
Timeout int64 `json:"timeout,omitempty"`
Default_ bool `json:"default,omitempty"`
}
17 changes: 17 additions & 0 deletions harness/nextgen/model_name_value_pair_with_default.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* CD NextGen API Reference
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: 2.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
// package swagger
package nextgen

type NameValuePairWithDefault struct {
Name string `json:"name,omitempty"`
Value string `json:"value"`
Type_ string `json:"type"`
UseAsDefault bool `json:"useAsDefault,omitempty"`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* CD NextGen API Reference
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: 2.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
// package swagger
package nextgen

type TemplateLinkConfigForCustomSecretManager struct {
TemplateRef string `json:"templateRef"`
VersionLabel string `json:"versionLabel"`
TemplateInputs map[string][]NameValuePairWithDefault `json:"templateInputs,omitempty"`
}

0 comments on commit 7305ea2

Please sign in to comment.