Skip to content

Commit

Permalink
Remove Google Cloud FF and add documentation (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddarth-Baldwa authored Jan 3, 2025
1 parent e4ad8f8 commit 5aaca3e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 52 deletions.
9 changes: 1 addition & 8 deletions cmd/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,8 @@ func init() {
createIntegrationCmd.Flags().StringToString("victoriametrics-spec", nil, `Configuration for victoriametrics.
Please provide key value pairs as follows:
endpoint=<victoriametrics-otlp-endpoint-url>`)

if util.IsFeatureFlagEnabled(util.GOOGLECLOUD_INTEGRATION) {
createIntegrationCmd.Flags().String("googlecloud-cred-filepath", "", `Filepath for Google Cloud service account credentials.
createIntegrationCmd.Flags().String("googlecloud-cred-filepath", "", `Filepath for Google Cloud service account credentials.
Please provide absolute file path`)
}

IntegrationCmd.AddCommand(listIntegrationCmd)

Expand Down Expand Up @@ -277,10 +274,6 @@ func setIntegrationConfiguration(cmd *cobra.Command, IntegrationName string, sin
sumoLogicSpec := ybmclient.NewSumologicTelemetryProviderSpec(installationToken, accessId, accessKey)
IntegrationSpec.SetSumologicSpec(*sumoLogicSpec)
case ybmclient.TELEMETRYPROVIDERTYPEENUM_GOOGLECLOUD:
if !util.IsFeatureFlagEnabled(util.GOOGLECLOUD_INTEGRATION) {
return nil, fmt.Errorf("Integration of type GOOGLECLOUD is currently not supported")
}

if !cmd.Flags().Changed("googlecloud-cred-filepath") {
return nil, fmt.Errorf("googlecloud-cred-filepath is required for googlecloud sink")
}
Expand Down
21 changes: 0 additions & 21 deletions cmd/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ var _ = Describe("Integration", func() {
Expect(err).ToNot(HaveOccurred())
os.Setenv("YBM_HOST", fmt.Sprintf("http://%s", server.Addr()))
os.Setenv("YBM_APIKEY", "test-token")
os.Setenv("YBM_FF_GOOGLECLOUD_INTEGRATION", "true")
})

Context("When type is Datadog", func() {
Expand Down Expand Up @@ -265,26 +264,6 @@ ddd GOOGLECLOUD`))
session.Kill()
})
})
Context("When type is googlecloud and ff is false", func() {
It("should return unknown flag error", func() {
os.Setenv("YBM_FF_GOOGLECLOUD_INTEGRATION", "false")
cmd := exec.Command(compiledCLIPath, "integration", "create", "--config-name", "testgcp", "--type", "googlecloud", "--googlecloud-cred-filepath", "./test/fixtures/googlecloud-test-creds.json")
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
Expect(err).NotTo(HaveOccurred())
session.Wait(2)
Expect(session.Err).Should(gbytes.Say("unknown flag: --googlecloud-cred-filepath"))
session.Kill()
})
It("should return 'unsupported integration' error", func() {
os.Setenv("YBM_FF_GOOGLECLOUD_INTEGRATION", "false")
cmd := exec.Command(compiledCLIPath, "integration", "create", "--config-name", "testgcp", "--type", "googlecloud", "--datadog-spec", "site=test,api-key=c4XXXXXXXXXXXXXXXXXXXXXXXXXXXX3d")
session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
Expect(err).NotTo(HaveOccurred())
session.Wait(2)
Expect(session.Err).Should(gbytes.Say("Integration of type GOOGLECLOUD is currently not supported"))
session.Kill()
})
})
Context("When listing telememtry providers", func() {
It("should return the list of config", func() {
statusCode = 200
Expand Down
21 changes: 10 additions & 11 deletions cmd/util/feature_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,16 @@ import (
type FeatureFlag string

const (
CDC FeatureFlag = "CDC"
CONFIGURE_URL FeatureFlag = "CONFIGURE_URL"
NODE_OP FeatureFlag = "NODE_OPS"
TOOLS FeatureFlag = "TOOLS"
AZURE_CIDR_ALLOWED FeatureFlag = "AZURE_CIDR_ALLOWED"
ENTERPRISE_SECURITY FeatureFlag = "ENTERPRISE_SECURITY"
PITR_CONFIG FeatureFlag = "PITR_CONFIG"
PITR_RESTORE FeatureFlag = "PITR_RESTORE"
CONNECTION_POOLING FeatureFlag = "CONNECTION_POOLING"
GOOGLECLOUD_INTEGRATION FeatureFlag = "GOOGLECLOUD_INTEGRATION"
DR FeatureFlag = "DR"
CDC FeatureFlag = "CDC"
CONFIGURE_URL FeatureFlag = "CONFIGURE_URL"
NODE_OP FeatureFlag = "NODE_OPS"
TOOLS FeatureFlag = "TOOLS"
AZURE_CIDR_ALLOWED FeatureFlag = "AZURE_CIDR_ALLOWED"
ENTERPRISE_SECURITY FeatureFlag = "ENTERPRISE_SECURITY"
PITR_CONFIG FeatureFlag = "PITR_CONFIG"
PITR_RESTORE FeatureFlag = "PITR_RESTORE"
CONNECTION_POOLING FeatureFlag = "CONNECTION_POOLING"
DR FeatureFlag = "DR"
)

func (f FeatureFlag) String() string {
Expand Down
32 changes: 20 additions & 12 deletions docs/ybm_integration_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,26 @@ ybm integration create [flags]
### Options

```
--config-name string [REQUIRED] The name of the Integration
--type string [REQUIRED] The type of third party Integration sink
--datadog-spec stringToString Configuration for Datadog.
Please provide key value pairs as follows:
api-key=<your-datadog-api-key>,site=<your-datadog-site-parameters> (default [])
--grafana-spec stringToString Configuration for Grafana.
Please provide key value pairs as follows:
access-policy-token=<your-grafana-token>,zone=<your-grafana-zone-parameter>,instance-id=<your-grafana-instance-id>,org-slug=<your-grafana-org-slug> (default [])
--sumologic-spec stringToString Configuration for sumologic.
Please provide key value pairs as follows:
access-key=<your-sumologic-access-key>,access-id=<your-sumologic-access-id>,installation-token=<your-sumologic-installation-token> (default [])
-h, --help help for create
--config-name string [REQUIRED] The name of the Integration
--type string [REQUIRED] The type of third party Integration sink
--datadog-spec stringToString Configuration for Datadog.
Please provide key value pairs as follows:
api-key=<your-datadog-api-key>,site=<your-datadog-site-parameters> (default [])
--grafana-spec stringToString Configuration for Grafana.
Please provide key value pairs as follows:
access-policy-token=<your-grafana-token>,zone=<your-grafana-zone-parameter>,instance-id=<your-grafana-instance-id>,org-slug=<your-grafana-org-slug> (default [])
--sumologic-spec stringToString Configuration for sumologic.
Please provide key value pairs as follows:
access-key=<your-sumologic-access-key>,access-id=<your-sumologic-access-id>,installation-token=<your-sumologic-installation-token> (default [])
--prometheus-spec stringToString Configuration for prometheus.
Please provide key value pairs as follows:
endpoint=<prometheus-otlp-endpoint-url> (default [])
--victoriametrics-spec stringToString Configuration for victoriametrics.
Please provide key value pairs as follows:
endpoint=<victoriametrics-otlp-endpoint-url> (default [])
--googlecloud-cred-filepath string Filepath for Google Cloud service account credentials.
Please provide absolute file path
-h, --help help for create
```

### Options inherited from parent commands
Expand Down

0 comments on commit 5aaca3e

Please sign in to comment.