Skip to content

Conversation

bernielomax
Copy link
Contributor

  • This refactor moves the service manager client factory from the local package to the service package.
  • Removing the potential circular dependency (by moving FindImagesFromChart to the helm package) was a required precursor to this change, and also paves the way for implementing v1/v2 chart compatibility.
  • Centralizing the factory in the service package allows manifest commands, etc to share the factory definitions. Which is consistent with the local install command and improves testability.

Move FindImagesFromChart from the images package to the helm package to
avoid future circular dependency issues, since downstream packages like
service use this function. This function is Helm-related, so it makes
more sense for it to live in the helm package.

The manifest command tests previously covered cmd.findAirbyteImages;
these tests have now been moved to where the exported
FindImagesFromChart function resides.
Now that circular dependency issues have been resolved by moving
FindImagesFromChart to the helm package, the service manager client
factory can be shared more broadly. The manifest commands and other
consumers can now use a single factory for dependency injection.
Placing SvcMgrClientFactory in the service package centralizes
client initialization logic and avoids future dependency issues.
@bernielomax bernielomax requested a review from a team as a code owner July 17, 2025 01:00
return nil, err
}

rel, err := client.InstallChart(context.TODO(), &goHelm.ChartSpec{
Copy link
Contributor Author

@bernielomax bernielomax Jul 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only change from the original function (apart from Helm client dependency injection) is replacing local template rendering (TemplateChart) with InstallChart in dry-run mode.

  • TemplateChart uses local rendering, which does not talk to Kubernetes and can clear or ignore the client’s discovered capabilities, requiring a throwaway Helm client to avoid issues.
  • InstallChart (with DryRun: true) connects to the cluster, preserves discovered capabilities, and uses them when rendering. Something not possible with local rendering.

@bernielomax bernielomax requested a review from perangel July 17, 2025 16:09
Copy link
Collaborator

@perangel perangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me

@bernielomax bernielomax merged commit a4697da into main Jul 29, 2025
2 checks passed
@bernielomax bernielomax deleted the bernielomax/refactor/image-manifest-svc-mgr-factory branch July 29, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants