@@ -357,7 +357,7 @@ def migrate_to_cdk_v7(self) -> bool:
357
357
1. If the connector uses source-declarative-manifest, updates the metadata.yaml
358
358
to use baseImage: docker.io/airbyte/source-declarative-manifest:7.0.0@sha256:<TBD>
359
359
2. If the connector is Python, sets the version in pyproject.toml to ^7
360
-
360
+
361
361
For both cases, it also increments the dockerImageTag in metadata.yaml.
362
362
363
363
Returns:
@@ -412,9 +412,7 @@ def _migrate_declarative_manifest_to_v7(self) -> bool:
412
412
metadata_content = f .read ()
413
413
414
414
# Update the baseImage to version 7
415
- new_base_image = (
416
- f"docker.io/airbyte/source-declarative-manifest:7.0.1@sha256:ff1e701c8f913cf24a0220f62c8e64cc1c3011ba0a636985f4db47fdab1391b6"
417
- )
415
+ new_base_image = f"docker.io/airbyte/source-declarative-manifest:7.0.1@sha256:ff1e701c8f913cf24a0220f62c8e64cc1c3011ba0a636985f4db47fdab1391b6"
418
416
419
417
# Replace the base image using regex to preserve formatting
420
418
base_image_pattern = r"(baseImage:\s*)[^\n\r]+"
@@ -525,21 +523,17 @@ def _update_docker_image_tag(self) -> bool:
525
523
# Update the dockerImageTag field by incrementing the version
526
524
docker_tag_pattern = r"(dockerImageTag:\s*)([^\n\r]+)"
527
525
docker_tag_match = re .search (docker_tag_pattern , metadata_content )
528
-
526
+
529
527
if docker_tag_match :
530
528
current_tag = docker_tag_match .group (2 ).strip ()
531
529
new_tag = self ._increment_version (current_tag )
532
-
533
- updated_content = re .sub (
534
- docker_tag_pattern ,
535
- rf"\g<1>{ new_tag } " ,
536
- metadata_content
537
- )
538
-
530
+
531
+ updated_content = re .sub (docker_tag_pattern , rf"\g<1>{ new_tag } " , metadata_content )
532
+
539
533
# Write back the updated metadata
540
534
with open (metadata_file , "w" ) as f :
541
535
f .write (updated_content )
542
-
536
+
543
537
print (f"Updated dockerImageTag from { current_tag } to { new_tag } for { self .name } " )
544
538
return True
545
539
else :
0 commit comments