From 4255504a1bdec448a37a17ca68cd63dd2fc613c9 Mon Sep 17 00:00:00 2001 From: schristoff <28318173+schristoff@users.noreply.github.com> Date: Mon, 9 Oct 2023 14:54:22 -0600 Subject: [PATCH] basic logic done? Signed-off-by: schristoff <28318173+schristoff@users.noreply.github.com> --- pkg/porter/dependencies.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/porter/dependencies.go b/pkg/porter/dependencies.go index 6e8194dfd..0c1278789 100644 --- a/pkg/porter/dependencies.go +++ b/pkg/porter/dependencies.go @@ -156,12 +156,6 @@ func (e *dependencyExecutioner) identifyDependencies(ctx context.Context) error // If we hit here, there is a bug somewhere return span.Error(errors.New("identifyDependencies failed to load the bundle because no bundle was specified. Please report this bug to https://github.com/getporter/porter/issues/new/choose")) } - - //NOTE: (schristoff) if v2, time to jump - if bun.HasDependenciesV2() { - e.resolveSharedDeps_v2(ctx, bun) - } - locks, err := bun.ResolveDependencies(bun) if err != nil { return span.Error(err) @@ -289,6 +283,11 @@ func (e *dependencyExecutioner) executeDependency(ctx context.Context, dep *queu if errors.Is(err, storage.ErrNotFound{}) { depInstallation = storage.NewInstallation(e.parentOpts.Namespace, depName) depInstallation.SetLabel("sh.porter.parentInstallation", e.parentArgs.Installation.String()) + + //if using v2, set label for sharing group so we can find it later + if dep.SharingMode { + depInstallation.SetLabel("sh.porter.SharingGroup", dep.SharingGroup) + } // For now, assume it's okay to give the dependency the same credentials as the parent depInstallation.CredentialSets = e.parentInstallation.CredentialSets if err = e.Installations.InsertInstallation(ctx, depInstallation); err != nil { @@ -307,11 +306,12 @@ func (e *dependencyExecutioner) executeDependency(ctx context.Context, dep *queu } // If it exists and they're in the same group, it'll be either installed or uninstalled // If installed, wire things up, if uninstalled, error - if dep.SharingGroup == depInstallation.Labels["SharingGroup"] { + if dep.SharingGroup == depInstallation.Labels["sh.porter.SharingGroup"] { if depInstallation.Uninstalled { return fmt.Errorf("error executing dependency, in uninstalled status %s", depInstallation.Name) } - //Wire up outputs & params + //note (schristoff):I think below we wire up params so the only thing needs to be tied is + // credentials maybe? } //If we get here, we need to call someone for help return fmt.Errorf("how are you here?")