func (f *Framework) GetImagePolicy(name, namespace string) (*policyv1.ImagePolicy, error) {
	return f.ImagePolicyClient.PortierisV1().ImagePolicies(namespace).Get(context.TODO(), name, metav1.GetOptions{})
}
GetImagePolicy retrieves the image policy (ImagePolicy).
package framework
import (
	"context"
	"fmt"
	"time"
	apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/util/wait"
	"k8s.io/apimachinery/pkg/util/yaml"
	policyv1 "github.com/IBM/portieris/pkg/apis/portieris.cloud.ibm.com/v1"
)
func (f *Framework) LoadImagePolicyManifest(pathToManifest string) (*policyv1.ImagePolicy, error) {
	manifest, err := openFile(pathToManifest)
	if err != nil {
		return nil, fmt.Errorf("Unable to open file %q: %v", pathToManifest, err)
	}
	ip := policyv1.ImagePolicy{}
	if err := yaml.NewYAMLOrJSONDecoder(manifest, 100).Decode(&ip); err != nil {
		return nil, fmt.Errorf("Unable to decode file %q: %v", pathToManifest, err)
	}
	return &ip, nil
}
func (f *Framework) CreateImagePolicy(namespace string, imagePolicy *policyv1.ImagePolicy) error {
	if _, err := f.ImagePolicyClient.PortierisV1().ImagePolicies(namespace).Create(context.TODO(), imagePolicy, metav1.CreateOptions{}); err != nil {
		return fmt.Errorf("Error creating ImagePolicy %q: %v", imagePolicy.Name, err)
	}
	return f.WaitForImagePolicy(imagePolicy.Name, namespace, time.Minute)
}