pulumi/pkg/engine/env.go
Pat Gavlin a23b10a9bf
Update the copyright end date to 2018. (#1068)
Just what it says on the tin.
2018-03-21 12:43:21 -07:00

30 lines
832 B
Go

// Copyright 2018, Pulumi Corporation. All rights reserved.
package engine
import (
opentracing "github.com/opentracing/opentracing-go"
"github.com/pulumi/pulumi/pkg/util/contract"
)
// Callers must call Close on the resulting planContext once they have completed the associated planning operation
func planContextFromUpdate(update Update) (*planContext, error) {
contract.Require(update != nil, "update")
// Create a root span for the operation
tracingSpan := opentracing.StartSpan("pulumi-plan")
return &planContext{
Update: update,
TracingSpan: tracingSpan,
}, nil
}
type planContext struct {
Update Update // The update being processed.
TracingSpan opentracing.Span // An OpenTracing span to parent plan operations within.
}
func (ctx *planContext) Close() {
ctx.TracingSpan.Finish()
}