func (sia *statefulsetInitAwaiter) Await() error {
	stopper := make(chan struct{})
	defer close(stopper)
	informerFactory := informers.NewInformerFactory(sia.config.clientSet,
		informers.WithNamespaceOrDefault(sia.config.currentInputs.GetNamespace()))
	informerFactory.Start(stopper)
	statefulSetEvents := make(chan watch.Event)
	statefulSetInformer, err := informers.New(informerFactory, informers.ForGVR(schema.GroupVersionResource{
		Group:    "apps",
		Version:  "v1",
		Resource: "statefulsets",
	}), informers.WithEventChannel(statefulSetEvents))
	if err != nil {
		return err
	}
	go statefulSetInformer.Informer().Run(stopper)
	podEvents := make(chan watch.Event)
	podInformer, err := informers.New(informerFactory, informers.ForPods(), informers.WithEventChannel(podEvents))
	if err != nil {
		return err
	}
	go podInformer.Informer().Run(stopper)
	aggregateErrorTicker := time.NewTicker(10 * time.Second)
	defer aggregateErrorTicker.Stop()
	timeout := metadata.TimeoutDuration(sia.config.timeout, sia.config.currentInputs, DefaultStatefulSetTimeoutMins*60)
	return sia.await(statefulSetEvents, podEvents, time.After(timeout), aggregateErrorTicker.C)
}
Await blocks until a StatefulSet is "active" or encounters an error.

We succeed when only when all of the following are true:

1. The value of `spec.replicas` matches `.status.replicas`, `.status.currentReplicas`,
and `.status.readyReplicas`.
2. The value of `.status.updateRevision` matches `.status.currentRevision`.
package await
import (
	"context"
	"fmt"
	"reflect"
	"time"
	"github.com/pulumi/pulumi/sdk/v3/go/common/util/cmdutil"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"github.com/pkg/errors"
	"github.com/pulumi/pulumi-kubernetes/provider/v3/pkg/await/informers"
	"github.com/pulumi/pulumi-kubernetes/provider/v3/pkg/await/states"
	"github.com/pulumi/pulumi-kubernetes/provider/v3/pkg/clients"
	"github.com/pulumi/pulumi-kubernetes/provider/v3/pkg/kinds"
	"github.com/pulumi/pulumi-kubernetes/provider/v3/pkg/logging"
	"github.com/pulumi/pulumi-kubernetes/provider/v3/pkg/metadata"
	"github.com/pulumi/pulumi-kubernetes/provider/v3/pkg/openapi"
	"github.com/pulumi/pulumi/sdk/v3/go/common/diag"
	logger "github.com/pulumi/pulumi/sdk/v3/go/common/util/logging"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/watch"
	"k8s.io/client-go/dynamic"
)
const (
	DefaultStatefulSetTimeoutMins = 10
)
type statefulsetInitAwaiter struct {
	config            updateAwaitConfig
	revisionReady     bool
	replicasReady     bool
	currentGeneration int64
	statefulset     *unstructured.Unstructured
	pods            map[string]*unstructured.Unstructured
	currentReplicas int64
	targetReplicas  int64
	currentRevision string
	targetRevision  string
}
func makeStatefulSetInitAwaiter(c updateAwaitConfig) *statefulsetInitAwaiter {
	return &statefulsetInitAwaiter{
		config:        c,
		revisionReady: false,
		replicasReady: false,
		currentGeneration: 0,
		statefulset: c.currentOutputs,
		pods:        map[string]*unstructured.Unstructured{},
	}
}