Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pkger): extend pkgs with source identifiers #18515

Merged
merged 3 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Features

1. [18387](https://github.com/influxdata/influxdb/pull/18387): Integrate query cancellation after queries have been submitted
1. [18515](https://github.com/influxdata/influxdb/pull/18515): Extend templates with the source file|url|reader.

## v2.0.0-beta.12 [2020-06-12]

Expand Down
5 changes: 3 additions & 2 deletions cmd/influx/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,12 @@ func (b *cmdPkgBuilder) pkgApplyRunEFn(cmd *cobra.Command, args []string) error
}

opts := []pkger.ApplyOptFn{
pkger.ApplyWithPkg(pkg),
pkger.ApplyWithEnvRefs(providedEnvRefs),
pkger.ApplyWithStackID(stackID),
}

dryRunImpact, err := svc.DryRun(context.Background(), influxOrgID, 0, pkg, opts...)
dryRunImpact, err := svc.DryRun(context.Background(), influxOrgID, 0, opts...)
if err != nil {
return err
}
Expand Down Expand Up @@ -254,7 +255,7 @@ func (b *cmdPkgBuilder) pkgApplyRunEFn(cmd *cobra.Command, args []string) error

opts = append(opts, pkger.ApplyWithSecrets(providedSecrets))

impact, err := svc.Apply(context.Background(), influxOrgID, 0, pkg, opts...)
impact, err := svc.Apply(context.Background(), influxOrgID, 0, opts...)
if err != nil {
return err
}
Expand Down
12 changes: 6 additions & 6 deletions cmd/influx/pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ func testPkgWritesToBuffer(newCmdFn func(w io.Writer) *cobra.Command, args pkgFi
type fakePkgSVC struct {
initStackFn func(ctx context.Context, userID influxdb.ID, stack pkger.Stack) (pkger.Stack, error)
createFn func(ctx context.Context, setters ...pkger.CreatePkgSetFn) (*pkger.Pkg, error)
dryRunFn func(ctx context.Context, orgID, userID influxdb.ID, pkg *pkger.Pkg) (pkger.PkgImpactSummary, error)
applyFn func(ctx context.Context, orgID, userID influxdb.ID, pkg *pkger.Pkg, opts ...pkger.ApplyOptFn) (pkger.PkgImpactSummary, error)
dryRunFn func(ctx context.Context, orgID, userID influxdb.ID, opts ...pkger.ApplyOptFn) (pkger.PkgImpactSummary, error)
applyFn func(ctx context.Context, orgID, userID influxdb.ID, opts ...pkger.ApplyOptFn) (pkger.PkgImpactSummary, error)
}

var _ pkger.SVC = (*fakePkgSVC)(nil)
Expand Down Expand Up @@ -740,16 +740,16 @@ func (f *fakePkgSVC) CreatePkg(ctx context.Context, setters ...pkger.CreatePkgSe
panic("not implemented")
}

func (f *fakePkgSVC) DryRun(ctx context.Context, orgID, userID influxdb.ID, pkg *pkger.Pkg, opts ...pkger.ApplyOptFn) (pkger.PkgImpactSummary, error) {
func (f *fakePkgSVC) DryRun(ctx context.Context, orgID, userID influxdb.ID, opts ...pkger.ApplyOptFn) (pkger.PkgImpactSummary, error) {
if f.dryRunFn != nil {
return f.dryRunFn(ctx, orgID, userID, pkg)
return f.dryRunFn(ctx, orgID, userID, opts...)
}
panic("not implemented")
}

func (f *fakePkgSVC) Apply(ctx context.Context, orgID, userID influxdb.ID, pkg *pkger.Pkg, opts ...pkger.ApplyOptFn) (pkger.PkgImpactSummary, error) {
func (f *fakePkgSVC) Apply(ctx context.Context, orgID, userID influxdb.ID, opts ...pkger.ApplyOptFn) (pkger.PkgImpactSummary, error) {
if f.applyFn != nil {
return f.applyFn(ctx, orgID, userID, pkg, opts...)
return f.applyFn(ctx, orgID, userID, opts...)
}
panic("not implemented")
}
Expand Down
Loading