Skip to content

Commit

Permalink
[CDF-23157] No more complains (#1169)
Browse files Browse the repository at this point in the history
* fix; keyvault complains

* build: changelog

* Update cognite_toolkit/_cdf_tk/loaders/_resource_loaders/extraction_pipeline_loaders.py
  • Loading branch information
doctrino authored Nov 6, 2024
1 parent 4d03b50 commit 4b226f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.cdf-tk.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Changes are grouped as follows:

- Deploying RAW Tables/Databases no longer raises a `ToolkitRequiredValueError`.
- Deploying Asset given as `.csv`/`.parquet` is now supported again.
- Running `cdf deploy` no longer complains about `!keyvault` syntax in `ExtractionPipelineConfig` resources.

## [0.3.6] - 2024-11-04

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
from __future__ import annotations

import re
from collections.abc import Hashable, Iterable, Sequence
from functools import lru_cache
from pathlib import Path
Expand Down Expand Up @@ -289,6 +290,10 @@ def load_resource(
for resource in resources:
config_raw = resource.get("config")
if isinstance(config_raw, str):
# There might be keyvauls secrets in the config that would lead to parsing errors. The syntax
# for this is `connection-string: !keyvault secret`. This is not valid YAML, so we need to
# replace it with `connection-string: keyvault secret` to make it valid.
config_raw = re.sub(r": !(\w+)", r": \1", config_raw)
try:
yaml.safe_load(config_raw)
except yaml.YAMLError as e:
Expand Down

0 comments on commit 4b226f7

Please sign in to comment.