func (a *Annotator) GetOriginalConfiguration(obj runtime.Object) ([]byte, error) {
	annots, err := a.metadataAccessor.Annotations(obj)
	if err != nil {
		return nil, err
	}
	if annots == nil {
		return nil, nil
	}
	original, ok := annots[a.key]
	if !ok {
		return nil, nil
	}
	if decoded, err := base64.StdEncoding.DecodeString(original); err == nil {
		if http.DetectContentType(decoded) == "application/zip" {
			return unZipAnnotation(decoded)
		}
		return decoded, nil
	}
	return []byte(original), nil
}
GetOriginalConfiguration retrieves the original configuration of the object
from the annotation, or nil if no annotation was found.
package patch
import (
	"archive/zip"
	"bytes"
	"encoding/base64"
	"io/ioutil"
	"net/http"
	json "github.com/json-iterator/go"
	"k8s.io/apimachinery/pkg/api/meta"
	"k8s.io/apimachinery/pkg/runtime"
)
const LastAppliedConfig = "banzaicloud.com/last-applied"
var DefaultAnnotator = NewAnnotator(LastAppliedConfig)
type Annotator struct {
	metadataAccessor meta.MetadataAccessor
	key              string
}
func NewAnnotator(key string) *Annotator {
	return &Annotator{
		key:              key,
		metadataAccessor: meta.NewAccessor(),
	}
}