Repository: zenml-io/zenml

Issue:
[BUG]: Creation of a new GCP connector fails when using GCP secrets


### System Information

ZENML_LOCAL_VERSION: 0.41.0
ZENML_SERVER_VERSION: 0.41.0
ZENML_SERVER_DATABASE: mysql
ZENML_SERVER_DEPLOYMENT_TYPE: kubernetes
ZENML_CONFIG_DIR: /home/png/.config/zenml
ZENML_LOCAL_STORE_DIR: /home/png/.config/zenml/local_stores
ZENML_SERVER_URL: http://35.195.23.201
PYTHON_VERSION: 3.8.16
ENVIRONMENT: wsl
SYSTEM_INFO: {'os': 'linux', 'linux_distro': 'ubuntu', 'linux_distro_like': 'debian', 'linux_distro_version': '22.04'}
ACTIVE_WORKSPACE: default
ACTIVE_STACK: test
ACTIVE_USER: default
TELEMETRY_STATUS: enabled
ANALYTICS_CLIENT_ID: 878ffcae-9e85-4583-a042-f7b617914e98
ANALYTICS_USER_ID: efe9f6ca-037c-472e-8677-65b616beedb2
ANALYTICS_SERVER_ID: 93017bbc-8365-42f2-8848-78a370cbb8d7
INTEGRATIONS: ['gcp', 'kaniko', 'kubeflow', 'kubernetes', 'seldon']
PACKAGES: {'deprecated': '1.2.14', 'gitpython': '3.1.31', 'jinja2': '3.1.2', 'mako': '1.2.4', 'markupsafe': '2.1.2', 'pymysql': '1.0.3', 'pyyaml': '5.4.1', 'pygments': 
'2.15.1', 'sqlalchemy': '1.4.41', 'sqlalchemy-utils': '0.38.3', 'send2trash': '1.8.2', 'shapely': '1.8.5.post1', 'absl-py': '1.4.0', 'aiohttp': '3.8.4', 'aiosignal': '1.3.1', 
'alembic': '1.8.1', 'analytics-python': '1.4.post1', 'anyio': '3.6.2', 'argon2-cffi': '21.3.0', 'argon2-cffi-bindings': '21.2.0', 'arrow': '1.2.3', 'asttokens': '2.2.1', 
'async-timeout': '4.0.2', 'attrs': '23.1.0', 'azure-common': '1.1.28', 'azure-core': '1.28.0', 'azure-mgmt-core': '1.4.0', 'azure-mgmt-resource': '23.0.1', 'backcall': 
'0.2.0', 'backoff': '1.10.0', 'bcrypt': '4.0.1', 'beautifulsoup4': '4.12.2', 'bleach': '6.0.0', 'cachetools': '5.3.1', 'certifi': '2022.12.7', 'cffi': '1.15.1', 
'charset-normalizer': '3.1.0', 'click': '8.1.3', 'click-params': '0.3.0', 'cloudpickle': '2.2.1', 'comm': '0.1.3', 'commonmark': '0.9.1', 'debugpy': '1.6.7', 'decorator': 
'5.1.1', 'defusedxml': '0.7.1', 'distro': '1.8.0', 'docker': '6.1.3', 'docstring-parser': '0.15', 'executing': '1.2.0', 'fastjsonschema': '2.16.3', 'fire': '0.5.0', 'fqdn': 
'1.5.1', 'frozenlist': '1.4.0', 'fsspec': '2023.6.0', 'gcsfs': '2023.6.0', 'gitdb': '4.0.10', 'google-api-core': '2.11.1', 'google-api-python-client': '1.12.11', 
'google-auth': '2.22.0', 'google-auth-httplib2': '0.1.0', 'google-auth-oauthlib': '1.0.0', 'google-cloud-aiplatform': '1.28.0', 'google-cloud-bigquery': '3.11.3', 
'google-cloud-build': '3.18.0', 'google-cloud-container': '2.26.0', 'google-cloud-core': '2.3.3', 'google-cloud-functions': '1.13.1', 'google-cloud-resource-manager': 
'1.10.2', 'google-cloud-scheduler': '2.11.1', 'google-cloud-secret-manager': '2.16.2', 'google-cloud-storage': '2.10.0', 'google-crc32c': '1.5.0', 'google-resumable-media': 
'2.5.0', 'googleapis-common-protos': '1.59.1', 'greenlet': '2.0.2', 'grpc-google-iam-v1': '0.12.6', 'grpcio': '1.56.0', 'grpcio-status': '1.48.2', 'httplib2': '0.19.1', 
'idna': '3.4', 'importlib-metadata': '6.6.0', 'importlib-resources': '5.12.0', 'ipykernel': '6.22.0', 'ipython': '8.12.1', 'ipython-genutils': '0.2.0', 'ipywidgets': '7.7.5', 
'isodate': '0.6.1', 'isoduration': '20.11.0', 'jedi': '0.18.2', 'jsonpointer': '2.3', 'jsonschema': '3.2.0', 'jupyter-client': '8.2.0', 'jupyter-core': '5.3.0', 
'jupyter-events': '0.6.3', 'jupyter-server': '2.5.0', 'jupyter-server-terminals': '0.4.4', 'jupyterlab-pygments': '0.2.2', 'jupyterlab-widgets': '1.1.4', 'kfp': '1.8.16', 
'kfp-pipeline-spec': '0.1.16', 'kfp-server-api': '1.8.5', 'kubernetes': '18.20.0', 'matplotlib-inline': '0.1.6', 'mistune': '2.0.5', 'monotonic': '1.6', 'multidict': '6.0.4', 
'nbclassic': '0.5.6', 'nbclient': '0.7.4', 'nbconvert': '7.3.1', 'nbformat': '5.8.0', 'nest-asyncio': '1.5.6', 'notebook': '6.5.4', 'notebook-shim': '0.2.3', 'numpy': 
'1.24.3', 'oauthlib': '3.2.2', 'packaging': '23.1', 'pandas': '2.0.1', 'pandocfilters': '1.5.0', 'parso': '0.8.3', 'passlib': '1.7.4', 'pexpect': '4.8.0', 'pickleshare': 
'0.7.5', 'pip': '23.0', 'pkgutil-resolve-name': '1.3.10', 'platformdirs': '3.5.0', 'prometheus-client': '0.16.0', 'prompt-toolkit': '3.0.38', 'proto-plus': '1.22.3', 
'protobuf': '3.20.3', 'psutil': '5.9.5', 'ptyprocess': '0.7.0', 'pure-eval': '0.2.2', 'pyasn1': '0.5.0', 'pyasn1-modules': '0.3.0', 'pycparser': '2.21', 'pydantic': '1.10.7', 
'pyparsing': '2.4.7', 'pyrsistent': '0.19.3', 'python-dateutil': '2.8.2', 'python-json-logger': '2.0.7', 'python-terraform': '0.10.1', 'pytz': '2023.3', 'pyzmq': '25.0.2', 
'requests': '2.29.0', 'requests-oauthlib': '1.3.1', 'requests-toolbelt': '0.10.1', 'rfc3339-validator': '0.1.4', 'rfc3986-validator': '0.1.1', 'rich': '12.6.0', 'rsa': '4.9', 
'setuptools': '67.1.0', 'six': '1.16.0', 'smmap': '5.0.0', 'sniffio': '1.3.0', 'soupsieve': '2.4.1', 'sqlalchemy2-stubs': '0.0.2a34', 'sqlmodel': '0.0.8', 'stack-data': 
'0.6.2', 'strip-hints': '0.1.10', 'tabulate': '0.9.0', 'termcolor': '2.3.0', 'terminado': '0.17.1', 'tinycss2': '1.2.1', 'tornado': '6.3.1', 'traitlets': '5.9.0', 'typer': 
'0.9.0', 'typing-extensions': '4.5.0', 'tzdata': '2023.3', 'uri-template': '1.2.0', 'uritemplate': '3.0.1', 'urllib3': '1.26.15', 'validators': '0.18.2', 'wcwidth': '0.2.6', 
'webcolors': '1.13', 'webencodings': '0.5.1', 'websocket-client': '1.5.1', 'wheel': '0.38.4', 'widgetsnbextension': '3.6.4', 'wrapt': '1.15.0', 'yarl': '1.9.2', 'zenml': 
'0.41.0', 'zipp': '3.15.0'}


### What happened?

Creation of a new GCP connector fails when using GCP secrets, because the generated secret has uppercase letters.

### Reproduction steps

1. Install zeml with GCP Secrets as the secret backend
2. Create new connector for GCP
3. connector creation is failed due to error


### Relevant log output

```shell
"Invalid secret name 'connector-gcp-connector-2-LXRj'. Must contain only lowercase alphanumeric characters and the hyphen (-) and underscore (_) characters."
```


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct


Discussion:

Resolving patch:
diff --git a/src/zenml/zen_stores/sql_zen_store.py b/src/zenml/zen_stores/sql_zen_store.py
--- a/src/zenml/zen_stores/sql_zen_store.py
+++ b/src/zenml/zen_stores/sql_zen_store.py
@@ -4343,7 +4343,7 @@ def _create_connector_secret(
         # Generate unique names using a random suffix until we find a name
         # that is not already in use
         while True:
-            secret_name = f"connector-{connector_name}-{random_str(4)}"
+            secret_name = f"connector-{connector_name}-{random_str(4)}".lower()
             existing_secrets = self.secrets_store.list_secrets(
                 SecretFilterModel(
                     name=secret_name,


Test patch: