Repository: Azure/aad-pod-identity
Pull request #459 (2019-12-16 22:44:31)

Create internal api for aadpodidentity
**Reason for Change**:
Changes:
- Add internal API, change all project references to operate on internal API
- Add conversion functions and tests
  - I initially tried to use generated functions created by conversion-gen, but this project has dependencies on older versions of apimachinery and client-go. It's not possible to easily update those dependencies either, as it would require a refactor of LeaderElection to use contexts rather than channels.
- Refactored parts of V1 api and moved pieces to internal (channel types, util.go function)

Conversions:
- Conversions occur from V1 -> Internal inside of the List Binding/IDs/Exception functions, when we are grabbing the list of resources from the informer
- Conversion from Internal -> V1 only occurs when creating an AssignedIdentity, when the HTTP POST call is made.

**Issue Fixed**:
Part 1 for fixing #237
Will create another CR for the V2 API changes

**Notes for Reviewers**:
Unit tests pass, manually tested that it works, e2e passed

kkmsft: /azp run
azure-pipelines[bot]: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
aramase: /azp run
azure-pipelines[bot]: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>

Patch:
diff --git a/pkg/apis/aadpodidentity/aadpodidentity_deepcopy_generated.go b/pkg/apis/aadpodidentity/aadpodidentity_deepcopy_generated.go
new file mode 100644
index 00000000..6fe51121
--- /dev/null
+++ b/pkg/apis/aadpodidentity/aadpodidentity_deepcopy_generated.go
@@ -0,0 +1,433 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by deepcopy-gen. DO NOT EDIT.
+
+package aadpodidentity
+
+import (
+	runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzureAssignedIdentity) DeepCopyInto(out *AzureAssignedIdentity) {
+	*out = *in
+	out.TypeMeta = in.TypeMeta
+	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+	in.Spec.DeepCopyInto(&out.Spec)
+	in.Status.DeepCopyInto(&out.Status)
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureAssignedIdentity.
+func (in *AzureAssignedIdentity) DeepCopy() *AzureAssignedIdentity {
+	if in == nil {
+		return nil
+	}
+	out := new(AzureAssignedIdentity)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *AzureAssignedIdentity) DeepCopyObject() runtime.Object {
+	if c := in.DeepCopy(); c != nil {
+		return c
+	}
+	return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzureAssignedIdentityList) DeepCopyInto(out *AzureAssignedIdentityList) {
+	*out = *in
+	out.TypeMeta = in.TypeMeta
+	in.ListMeta.DeepCopyInto(&out.ListMeta)
+	if in.Items != nil {
+		in, out := &in.Items, &out.Items
+		*out = make([]AzureAssignedIdentity, len(*in))
+		for i := range *in {
+			(*in)[i].DeepCopyInto(&(*out)[i])
+		}
+	}
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureAssignedIdentityList.
+func (in *AzureAssignedIdentityList) DeepCopy() *AzureAssignedIdentityList {
+	if in == nil {
+		return nil
+	}
+	out := new(AzureAssignedIdentityList)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *AzureAssignedIdentityList) DeepCopyObject() runtime.Object {
+	if c := in.DeepCopy(); c != nil {
+		return c
+	}
+	return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzureAssignedIdentitySpec) DeepCopyInto(out *AzureAssignedIdentitySpec) {
+	*out = *in
+	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+	if in.AzureIdentityRef != nil {
+		in, out := &in.AzureIdentityRef, &out.AzureIdentityRef
+		*out = new(AzureIdentity)
+		(*in).DeepCopyInto(*out)
+	}
+	if in.AzureBindingRef != nil {
+		in, out := &in.AzureBindingRef, &out.AzureBindingRef
+		*out = new(AzureIdentityBinding)
+		(*in).DeepCopyInto(*out)
+	}
+	if in.Replicas != nil {
+		in, out := &in.Replicas, &out.Replicas
+		*out = new(int32)
+		**out = **in
+	}
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureAssignedIdentitySpec.
+func (in *AzureAssignedIdentitySpec) DeepCopy() *AzureAssignedIdentitySpec {
+	if in == nil {
+		return nil
+	}
+	out := new(AzureAssignedIdentitySpec)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzureAssignedIdentityStatus) DeepCopyInto(out *AzureAssignedIdentityStatus) {
+	*out = *in
+	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureAssignedIdentityStatus.
+func (in *AzureAssignedIdentityStatus) DeepCopy() *AzureAssignedIdentityStatus {
+	if in == nil {
+		return nil
+	}
+	out := new(AzureAssignedIdentityStatus)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzureIdentity) DeepCopyInto(out *AzureIdentity) {
+	*out = *in
+	out.TypeMeta = in.TypeMeta
+	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+	in.Spec.DeepCopyInto(&out.Spec)
+	in.Status.DeepCopyInto(&out.Status)
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureIdentity.
+func (in *AzureIdentity) DeepCopy() *AzureIdentity {
+	if in == nil {
+		return nil
+	}
+	out := new(AzureIdentity)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *AzureIdentity) DeepCopyObject() runtime.Object {
+	if c := in.DeepCopy(); c != nil {
+		return c
+	}
+	return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzureIdentityBinding) DeepCopyInto(out *AzureIdentityBinding) {
+	*out = *in
+	out.TypeMeta = in.TypeMeta
+	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+	in.Spec.DeepCopyInto(&out.Spec)
+	in.Status.DeepCopyInto(&out.Status)
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureIdentityBinding.
+func (in *AzureIdentityBinding) DeepCopy() *AzureIdentityBinding {
+	if in == nil {
+		return nil
+	}
+	out := new(AzureIdentityBinding)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *AzureIdentityBinding) DeepCopyObject() runtime.Object {
+	if c := in.DeepCopy(); c != nil {
+		return c
+	}
+	return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzureIdentityBindingList) DeepCopyInto(out *AzureIdentityBindingList) {
+	*out = *in
+	out.TypeMeta = in.TypeMeta
+	in.ListMeta.DeepCopyInto(&out.ListMeta)
+	if in.Items != nil {
+		in, out := &in.Items, &out.Items
+		*out = make([]AzureIdentityBinding, len(*in))
+		for i := range *in {
+			(*in)[i].DeepCopyInto(&(*out)[i])
+		}
+	}
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureIdentityBindingList.
+func (in *AzureIdentityBindingList) DeepCopy() *AzureIdentityBindingList {
+	if in == nil {
+		return nil
+	}
+	out := new(AzureIdentityBindingList)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *AzureIdentityBindingList) DeepCopyObject() runtime.Object {
+	if c := in.DeepCopy(); c != nil {
+		return c
+	}
+	return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzureIdentityBindingSpec) DeepCopyInto(out *AzureIdentityBindingSpec) {
+	*out = *in
+	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureIdentityBindingSpec.
+func (in *AzureIdentityBindingSpec) DeepCopy() *AzureIdentityBindingSpec {
+	if in == nil {
+		return nil
+	}
+	out := new(AzureIdentityBindingSpec)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzureIdentityBindingStatus) DeepCopyInto(out *AzureIdentityBindingStatus) {
+	*out = *in
+	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureIdentityBindingStatus.
+func (in *AzureIdentityBindingStatus) DeepCopy() *AzureIdentityBindingStatus {
+	if in == nil {
+		return nil
+	}
+	out := new(AzureIdentityBindingStatus)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzureIdentityList) DeepCopyInto(out *AzureIdentityList) {
+	*out = *in
+	out.TypeMeta = in.TypeMeta
+	in.ListMeta.DeepCopyInto(&out.ListMeta)
+	if in.Items != nil {
+		in, out := &in.Items, &out.Items
+		*out = make([]AzureIdentity, len(*in))
+		for i := range *in {
+			(*in)[i].DeepCopyInto(&(*out)[i])
+		}
+	}
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureIdentityList.
+func (in *AzureIdentityList) DeepCopy() *AzureIdentityList {
+	if in == nil {
+		return nil
+	}
+	out := new(AzureIdentityList)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *AzureIdentityList) DeepCopyObject() runtime.Object {
+	if c := in.DeepCopy(); c != nil {
+		return c
+	}
+	return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzureIdentitySpec) DeepCopyInto(out *AzureIdentitySpec) {
+	*out = *in
+	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+	out.ClientPassword = in.ClientPassword
+	if in.Replicas != nil {
+		in, out := &in.Replicas, &out.Replicas
+		*out = new(int32)
+		**out = **in
+	}
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureIdentitySpec.
+func (in *AzureIdentitySpec) DeepCopy() *AzureIdentitySpec {
+	if in == nil {
+		return nil
+	}
+	out := new(AzureIdentitySpec)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzureIdentityStatus) DeepCopyInto(out *AzureIdentityStatus) {
+	*out = *in
+	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureIdentityStatus.
+func (in *AzureIdentityStatus) DeepCopy() *AzureIdentityStatus {
+	if in == nil {
+		return nil
+	}
+	out := new(AzureIdentityStatus)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzurePodIdentityException) DeepCopyInto(out *AzurePodIdentityException) {
+	*out = *in
+	out.TypeMeta = in.TypeMeta
+	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+	in.Spec.DeepCopyInto(&out.Spec)
+	in.Status.DeepCopyInto(&out.Status)
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzurePodIdentityException.
+func (in *AzurePodIdentityException) DeepCopy() *AzurePodIdentityException {
+	if in == nil {
+		return nil
+	}
+	out := new(AzurePodIdentityException)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *AzurePodIdentityException) DeepCopyObject() runtime.Object {
+	if c := in.DeepCopy(); c != nil {
+		return c
+	}
+	return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzurePodIdentityExceptionList) DeepCopyInto(out *AzurePodIdentityExceptionList) {
+	*out = *in
+	out.TypeMeta = in.TypeMeta
+	in.ListMeta.DeepCopyInto(&out.ListMeta)
+	if in.Items != nil {
+		in, out := &in.Items, &out.Items
+		*out = make([]AzurePodIdentityException, len(*in))
+		for i := range *in {
+			(*in)[i].DeepCopyInto(&(*out)[i])
+		}
+	}
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzurePodIdentityExceptionList.
+func (in *AzurePodIdentityExceptionList) DeepCopy() *AzurePodIdentityExceptionList {
+	if in == nil {
+		return nil
+	}
+	out := new(AzurePodIdentityExceptionList)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *AzurePodIdentityExceptionList) DeepCopyObject() runtime.Object {
+	if c := in.DeepCopy(); c != nil {
+		return c
+	}
+	return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzurePodIdentityExceptionSpec) DeepCopyInto(out *AzurePodIdentityExceptionSpec) {
+	*out = *in
+	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+	if in.PodLabels != nil {
+		in, out := &in.PodLabels, &out.PodLabels
+		*out = make(map[string]string, len(*in))
+		for key, val := range *in {
+			(*out)[key] = val
+		}
+	}
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzurePodIdentityExceptionSpec.
+func (in *AzurePodIdentityExceptionSpec) DeepCopy() *AzurePodIdentityExceptionSpec {
+	if in == nil {
+		return nil
+	}
+	out := new(AzurePodIdentityExceptionSpec)
+	in.DeepCopyInto(out)
+	return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *AzurePodIdentityExceptionStatus) DeepCopyInto(out *AzurePodIdentityExceptionStatus) {
+	*out = *in
+	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+	return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzurePodIdentityExceptionStatus.
+func (in *AzurePodIdentityExceptionStatus) DeepCopy() *AzurePodIdentityExceptionStatus {
+	if in == nil {
+		return nil
+	}
+	out := new(AzurePodIdentityExceptionStatus)
+	in.DeepCopyInto(out)
+	return out
+}
diff --git a/pkg/apis/aadpodidentity/doc.go b/pkg/apis/aadpodidentity/doc.go
new file mode 100644
index 00000000..9c1772a1
--- /dev/null
+++ b/pkg/apis/aadpodidentity/doc.go
@@ -0,0 +1,4 @@
+// +k8s:deepcopy-gen=package,register
+
+// +groupName=aadpodidentity.k8s.io
+package aadpodidentity
diff --git a/pkg/apis/aadpodidentity/types.go b/pkg/apis/aadpodidentity/types.go
new file mode 100644
index 00000000..5be08a8e
--- /dev/null
+++ b/pkg/apis/aadpodidentity/types.go
@@ -0,0 +1,228 @@
+package aadpodidentity
+
+import (
+	api "k8s.io/api/core/v1"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+type EventType int
+
+const (
+	PodCreated      EventType = 0
+	PodDeleted      EventType = 1
+	PodUpdated      EventType = 2
+	IdentityCreated EventType = 3
+	IdentityDeleted EventType = 4
+	IdentityUpdated EventType = 5
+	BindingCreated  EventType = 6
+	BindingDeleted  EventType = 7
+	BindingUpdated  EventType = 8
+	Exit            EventType = 9
+)
+
+const (
+	CRDGroup    = "aadpodidentity.k8s.io"
+	CRDVersion  = "v1"
+	CRDLabelKey = "aadpodidbinding"
+
+	BehaviorKey = "aadpodidentity.k8s.io/Behavior"
+	// BehaviorNamespaced ...
+	BehaviorNamespaced = "namespaced"
+	// AssignedIDCreated status indicates azure assigned identity is created
+	AssignedIDCreated = "Created"
+	// AssignedIDAssigned status indicates identity has been assigned to the node
+	AssignedIDAssigned = "Assigned"
+	// AssignedIDUnAssigned status indicates identity has been unassigned from the node
+	AssignedIDUnAssigned = "Unassigned"
+)
+
+/*** Global data structures ***/
+
+// AzureIdentity is the specification of the identity data structure.
+//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+type AzureIdentity struct {
+	metav1.TypeMeta   `json:",inline"`
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+
+	Spec   AzureIdentitySpec   `json:"spec"`
+	Status AzureIdentityStatus `json:"status"`
+}
+
+// AzureIdentityBinding brings together the spec of matching pods and the identity which they can use.
+
+//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+type AzureIdentityBinding struct {
+	metav1.TypeMeta   `json:",inline"`
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+
+	Spec   AzureIdentityBindingSpec   `json:"spec"`
+	Status AzureIdentityBindingStatus `json:"status"`
+}
+
+//AzureAssignedIdentity contains the identity <-> pod mapping which is matched.
+
+//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+type AzureAssignedIdentity struct {
+	metav1.TypeMeta   `json:",inline"`
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+
+	Spec   AzureAssignedIdentitySpec   `json:"spec"`
+	Status AzureAssignedIdentityStatus `json:"Status"`
+}
+
+//AzurePodIdentityException contains the pod selectors for all pods that don't require
+// NMI to process and request token on their behalf.
+
+//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+type AzurePodIdentityException struct {
+	metav1.TypeMeta   `json:",inline"`
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+
+	Spec   AzurePodIdentityExceptionSpec   `json:"spec"`
+	Status AzurePodIdentityExceptionStatus `json:"Status"`
+}
+
+/*** Lists ***/
+//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+type AzureIdentityList struct {
+	metav1.TypeMeta `json:",inline"`
+	metav1.ListMeta `json:"metadata"`
+
+	Items []AzureIdentity `json:"items"`
+}
+
+//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+type AzureIdentityBindingList struct {
+	metav1.TypeMeta `json:",inline"`
+	metav1.ListMeta `json:"metadata"`
+
+	Items []AzureIdentityBinding `json:"items"`
+}
+
+//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+type AzureAssignedIdentityList struct {
+	metav1.TypeMeta `json:",inline"`
+	metav1.ListMeta `json:"metadata"`
+
+	Items []AzureAssignedIdentity `json:"items"`
+}
+
+//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+type AzurePodIdentityExceptionList struct {
+	metav1.TypeMeta `json:",inline"`
+	metav1.ListMeta `json:"metadata"`
+
+	Items []AzurePodIdentityException `json:"items"`
+}
+
+/*** AzureIdentity ***/
+//+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+type IdentityType int
+
+const (
+	UserAssignedMSI  IdentityType = 0
+	ServicePrincipal IdentityType = 1
+)
+
+type AzureIdentitySpec struct {
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+	// UserAssignedMSI or Service Principal
+	Type IdentityType `json:"type"`
+
+	// User assigned MSI resource id.
+	ResourceID string `json:"resourceid"`
+	//Both User Assigned MSI and SP can use this field.
+	ClientID string `json:"clientid"`
+
+	//Used for service principal
+	ClientPassword api.SecretReference `json:"clientpassword"`
+	// Service principal tenant id.
+	TenantID string `json:"tenantid"`
+	// For service principal. Option param for specifying the  AD details.
+	ADResourceID string `json:"adresourceid"`
+	ADEndpoint   string `json:"adendpoint"`
+
+	Replicas *int32 `json:"replicas"`
+}
+
+type AzureIdentityStatus struct {
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+	AvailableReplicas int32 `json:"availableReplicas"`
+}
+
+/*** AzureIdentityBinding ***/
+type MatchType int
+
+const (
+	Explicit MatchType = 0
+	Selector MatchType = 1
+)
+
+//AssignedIDState -  State indicator for the AssignedIdentity
+type AssignedIDState int
+
+const (
+	//Created - Default state of the assigned identity
+	Created AssignedIDState = 0
+	//Assigned - When the underlying platform assignment of EMSI is complete
+	//the state moves to assigned
+	Assigned AssignedIDState = 1
+)
+
+const (
+	AzureIDResource                = "azureidentities"
+	AzureIDBindingResource         = "azureidentitybindings"
+	AzureAssignedIDResource        = "azureassignedidentities"
+	AzureIdentityExceptionResource = "azurepodidentityexceptions"
+)
+
+// AzureIdentityBindingSpec matches the pod with the Identity.
+// Used to indicate the potential matches to look for between the pod/deployment
+// and the identities present..
+type AzureIdentityBindingSpec struct {
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+	AzureIdentity     string `json:"azureidentity"`
+	Selector          string `json:"selector"`
+	// Weight is used to figure out which of the matching identities would be selected.
+	Weight int `json:"weight"`
+}
+
+type AzureIdentityBindingStatus struct {
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+	AvailableReplicas int32 `json:"availableReplicas"`
+}
+
+/*** AzureAssignedIdentitySpec ***/
+
+//AzureAssignedIdentitySpec has the contents of Azure identity<->POD
+type AzureAssignedIdentitySpec struct {
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+	AzureIdentityRef  *AzureIdentity        `json:"azureidentityref"`
+	AzureBindingRef   *AzureIdentityBinding `json:"azurebindingref"`
+	Pod               string                `json:"pod"`
+	PodNamespace      string                `json:"podnamespace"`
+	NodeName          string                `json:"nodename"`
+
+	Replicas *int32 `json:"replicas"`
+}
+
+// AzureAssignedIdentityStatus has the replica status of the resouce.
+type AzureAssignedIdentityStatus struct {
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+	Status            string `json:"status"`
+	AvailableReplicas int32  `json:"availableReplicas"`
+}
+
+// AzurePodIdentityExceptionSpec matches pods with the selector defined.
+// If request originates from a pod that matches the selector, nmi will
+// proxy the request and send response back without any validation.
+type AzurePodIdentityExceptionSpec struct {
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+	PodLabels         map[string]string `json:"podLabels"`
+}
+
+// AzurePodIdentityExceptionStatus ...
+type AzurePodIdentityExceptionStatus struct {
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+	Status            string `json:"status"`
+}
diff --git a/pkg/apis/aadpodidentity/v1/utils.go b/pkg/apis/aadpodidentity/utils.go
similarity index 88%
rename from pkg/apis/aadpodidentity/v1/utils.go
rename to pkg/apis/aadpodidentity/utils.go
index a697916b..130a8ddc 100644
--- a/pkg/apis/aadpodidentity/v1/utils.go
+++ b/pkg/apis/aadpodidentity/utils.go
@@ -1,4 +1,4 @@
-package v1
+package aadpodidentity
 
 func IsNamespacedIdentity(azureID *AzureIdentity) bool {
 	if val, ok := azureID.Annotations[BehaviorKey]; ok {
diff --git a/pkg/apis/aadpodidentity/v1/conversion.go b/pkg/apis/aadpodidentity/v1/conversion.go
new file mode 100644
index 00000000..dbd65909
--- /dev/null
+++ b/pkg/apis/aadpodidentity/v1/conversion.go
@@ -0,0 +1,149 @@
+package v1
+
+import (
+	"reflect"
+
+	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity"
+	"k8s.io/apimachinery/pkg/runtime/schema"
+)
+
+func ConvertV1BindingToInternalBinding(identityBinding AzureIdentityBinding) (resIdentityBinding aadpodid.AzureIdentityBinding) {
+	return aadpodid.AzureIdentityBinding{
+		TypeMeta:   identityBinding.TypeMeta,
+		ObjectMeta: identityBinding.ObjectMeta,
+		Spec: aadpodid.AzureIdentityBindingSpec{
+			ObjectMeta:    identityBinding.Spec.ObjectMeta,
+			AzureIdentity: identityBinding.Spec.AzureIdentity,
+			Selector:      identityBinding.Spec.Selector,
+			Weight:        identityBinding.Spec.Weight,
+		},
+		Status: aadpodid.AzureIdentityBindingStatus(identityBinding.Status),
+	}
+}
+
+func ConvertV1IdentityToInternalIdentity(identity AzureIdentity) (resIdentity aadpodid.AzureIdentity) {
+	return aadpodid.AzureIdentity{
+		TypeMeta:   identity.TypeMeta,
+		ObjectMeta: identity.ObjectMeta,
+		Spec: aadpodid.AzureIdentitySpec{
+			ObjectMeta:     identity.Spec.ObjectMeta,
+			Type:           aadpodid.IdentityType(identity.Spec.Type),
+			ResourceID:     identity.Spec.ResourceID,
+			ClientID:       identity.Spec.ClientID,
+			ClientPassword: identity.Spec.ClientPassword,
+			TenantID:       identity.Spec.TenantID,
+			ADResourceID:   identity.Spec.ADResourceID,
+			ADEndpoint:     identity.Spec.ADEndpoint,
+			Replicas:       identity.Spec.Replicas,
+		},
+		Status: aadpodid.AzureIdentityStatus(identity.Status),
+	}
+}
+
+func ConvertV1AssignedIdentityToInternalAssignedIdentity(assignedIdentity AzureAssignedIdentity) (resAssignedIdentity aadpodid.AzureAssignedIdentity) {
+	retIdentity := ConvertV1IdentityToInternalIdentity(*assignedIdentity.Spec.AzureIdentityRef)
+	retBinding := ConvertV1BindingToInternalBinding(*assignedIdentity.Spec.AzureBindingRef)
+
+	return aadpodid.AzureAssignedIdentity{
+		TypeMeta:   assignedIdentity.TypeMeta,
+		ObjectMeta: assignedIdentity.ObjectMeta,
+		Spec: aadpodid.AzureAssignedIdentitySpec{
+			ObjectMeta:       assignedIdentity.Spec.ObjectMeta,
+			AzureIdentityRef: &retIdentity,
+			AzureBindingRef:  &retBinding,
+			Pod:              assignedIdentity.Spec.Pod,
+			PodNamespace:     assignedIdentity.Spec.PodNamespace,
+			NodeName:         assignedIdentity.Spec.NodeName,
+			Replicas:         assignedIdentity.Spec.Replicas,
+		},
+		Status: aadpodid.AzureAssignedIdentityStatus(assignedIdentity.Status),
+	}
+}
+
+func ConvertV1PodIdentityExceptionToInternalPodIdentityException(idException AzurePodIdentityException) (residException aadpodid.AzurePodIdentityException) {
+	return aadpodid.AzurePodIdentityException{
+		TypeMeta:   idException.TypeMeta,
+		ObjectMeta: idException.ObjectMeta,
+		Spec: aadpodid.AzurePodIdentityExceptionSpec{
+			ObjectMeta: idException.Spec.ObjectMeta,
+			PodLabels:  idException.Spec.PodLabels,
+		},
+		Status: aadpodid.AzurePodIdentityExceptionStatus(idException.Status),
+	}
+}
+
+func ConvertInternalBindingToV1Binding(identityBinding aadpodid.AzureIdentityBinding) (resIdentityBinding AzureIdentityBinding) {
+	out := AzureIdentityBinding{
+		TypeMeta:   identityBinding.TypeMeta,
+		ObjectMeta: identityBinding.ObjectMeta,
+		Spec: AzureIdentityBindingSpec{
+			ObjectMeta:    identityBinding.Spec.ObjectMeta,
+			AzureIdentity: identityBinding.Spec.AzureIdentity,
+			Selector:      identityBinding.Spec.Selector,
+			Weight:        identityBinding.Spec.Weight,
+		},
+		Status: AzureIdentityBindingStatus(identityBinding.Status),
+	}
+
+	out.TypeMeta.SetGroupVersionKind(schema.GroupVersionKind{
+		Group:   CRDGroup,
+		Version: CRDVersion,
+		Kind:    reflect.TypeOf(out).Name()})
+
+	return out
+}
+
+func ConvertInternalIdentityToV1Identity(identity aadpodid.AzureIdentity) (resIdentity AzureIdentity) {
+	out := AzureIdentity{
+		TypeMeta:   identity.TypeMeta,
+		ObjectMeta: identity.ObjectMeta,
+		Spec: AzureIdentitySpec{
+			ObjectMeta:     identity.Spec.ObjectMeta,
+			Type:           IdentityType(identity.Spec.Type),
+			ResourceID:     identity.Spec.ResourceID,
+			ClientID:       identity.Spec.ClientID,
+			ClientPassword: identity.Spec.ClientPassword,
+			TenantID:       identity.Spec.TenantID,
+			ADResourceID:   identity.Spec.ADResourceID,
+			ADEndpoint:     identity.Spec.ADEndpoint,
+			Replicas:       identity.Spec.Replicas,
+		},
+		Status: AzureIdentityStatus(identity.Status),
+	}
+
+	out.TypeMeta.SetGroupVersionKind(schema.GroupVersionKind{
+		Group:   CRDGroup,
+		Version: CRDVersion,
+		Kind:    reflect.TypeOf(out).Name()})
+
+	return out
+}
+
+func ConvertInternalAssignedIdentityToV1AssignedIdentity(assignedIdentity aadpodid.AzureAssignedIdentity) (resAssignedIdentity AzureAssignedIdentity) {
+	retIdentity := ConvertInternalIdentityToV1Identity(*assignedIdentity.Spec.AzureIdentityRef)
+	retBinding := ConvertInternalBindingToV1Binding(*assignedIdentity.Spec.AzureBindingRef)
+
+	out := AzureAssignedIdentity{
+		TypeMeta:   assignedIdentity.TypeMeta,
+		ObjectMeta: assignedIdentity.ObjectMeta,
+		Spec: AzureAssignedIdentitySpec{
+			ObjectMeta:       assignedIdentity.Spec.ObjectMeta,
+			AzureIdentityRef: &retIdentity,
+			AzureBindingRef:  &retBinding,
+			Pod:              assignedIdentity.Spec.Pod,
+			PodNamespace:     assignedIdentity.Spec.PodNamespace,
+			NodeName:         assignedIdentity.Spec.NodeName,
+			Replicas:         assignedIdentity.Spec.Replicas,
+		},
+		Status: AzureAssignedIdentityStatus(assignedIdentity.Status),
+	}
+
+	out.TypeMeta.SetGroupVersionKind(schema.GroupVersionKind{
+		Group:   CRDGroup,
+		Version: CRDVersion,
+		Kind:    reflect.TypeOf(out).Name()})
+
+	return out
+}
+
+// ConvertInternalPodIdentityExceptionToV1PodIdentityException is currently not needed, as AzurePodIdentityException are only listed and not created within the project
diff --git a/pkg/apis/aadpodidentity/v1/types.go b/pkg/apis/aadpodidentity/v1/types.go
index cee42b89..6ffd9ca0 100644
--- a/pkg/apis/aadpodidentity/v1/types.go
+++ b/pkg/apis/aadpodidentity/v1/types.go
@@ -5,21 +5,6 @@ import (
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
-type EventType int
-
-const (
-	PodCreated      EventType = 0
-	PodDeleted      EventType = 1
-	PodUpdated      EventType = 2
-	IdentityCreated EventType = 3
-	IdentityDeleted EventType = 4
-	IdentityUpdated EventType = 5
-	BindingCreated  EventType = 6
-	BindingDeleted  EventType = 7
-	BindingUpdated  EventType = 8
-	Exit            EventType = 9
-)
-
 const (
 	CRDGroup    = "aadpodidentity.k8s.io"
 	CRDVersion  = "v1"
diff --git a/pkg/crd/crd.go b/pkg/crd/crd.go
index 3dc6a79a..ad07ff63 100644
--- a/pkg/crd/crd.go
+++ b/pkg/crd/crd.go
@@ -6,7 +6,8 @@ import (
 	"reflect"
 	"time"
 
-	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1"
+	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity"
+	aadpodv1 "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1"
 	"github.com/Azure/aad-pod-identity/pkg/metrics"
 	"github.com/Azure/aad-pod-identity/pkg/stats"
 	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -135,19 +136,19 @@ func NewCRDClient(config *rest.Config, eventCh chan aadpodid.EventType) (crdClie
 
 func newRestClient(config *rest.Config) (r *rest.RESTClient, err error) {
 	crdconfig := *config
-	crdconfig.GroupVersion = &schema.GroupVersion{Group: aadpodid.CRDGroup, Version: aadpodid.CRDVersion}
+	crdconfig.GroupVersion = &schema.GroupVersion{Group: aadpodv1.CRDGroup, Version: aadpodv1.CRDVersion}
 	crdconfig.APIPath = "/apis"
 	crdconfig.ContentType = runtime.ContentTypeJSON
 	s := runtime.NewScheme()
 	s.AddKnownTypes(*crdconfig.GroupVersion,
-		&aadpodid.AzureIdentity{},
-		&aadpodid.AzureIdentityList{},
-		&aadpodid.AzureIdentityBinding{},
-		&aadpodid.AzureIdentityBindingList{},
-		&aadpodid.AzureAssignedIdentity{},
-		&aadpodid.AzureAssignedIdentityList{},
-		&aadpodid.AzurePodIdentityException{},
-		&aadpodid.AzurePodIdentityExceptionList{},
+		&aadpodv1.AzureIdentity{},
+		&aadpodv1.AzureIdentityList{},
+		&aadpodv1.AzureIdentityBinding{},
+		&aadpodv1.AzureIdentityBindingList{},
+		&aadpodv1.AzureAssignedIdentity{},
+		&aadpodv1.AzureAssignedIdentityList{},
+		&aadpodv1.AzurePodIdentityException{},
+		&aadpodv1.AzurePodIdentityExceptionList{},
 	)
 	crdconfig.NegotiatedSerializer = serializer.DirectCodecFactory{
 		CodecFactory: serializer.NewCodecFactory(s)}
@@ -161,16 +162,16 @@ func newRestClient(config *rest.Config) (r *rest.RESTClient, err error) {
 }
 
 func newBindingListWatch(r *rest.RESTClient) *cache.ListWatch {
-	return cache.NewListWatchFromClient(r, aadpodid.AzureIDBindingResource, v1.NamespaceAll, fields.Everything())
+	return cache.NewListWatchFromClient(r, aadpodv1.AzureIDBindingResource, v1.NamespaceAll, fields.Everything())
 }
 
 func newBindingInformer(r *rest.RESTClient, eventCh chan aadpodid.EventType, lw *cache.ListWatch) (cache.SharedInformer, error) {
 	azBindingInformer := cache.NewSharedInformer(
 		lw,
-		&aadpodid.AzureIdentityBinding{},
+		&aadpodv1.AzureIdentityBinding{},
 		time.Minute*10)
 	if azBindingInformer == nil {
-		return nil, fmt.Errorf("Could not create watcher for %s", aadpodid.AzureIDBindingResource)
+		return nil, fmt.Errorf("Could not create watcher for %s", aadpodv1.AzureIDBindingResource)
 	}
 	azBindingInformer.AddEventHandler(
 		cache.ResourceEventHandlerFuncs{
@@ -192,16 +193,16 @@ func newBindingInformer(r *rest.RESTClient, eventCh chan aadpodid.EventType, lw
 }
 
 func newIDListWatch(r *rest.RESTClient) *cache.ListWatch {
-	return cache.NewListWatchFromClient(r, aadpodid.AzureIDResource, v1.NamespaceAll, fields.Everything())
+	return cache.NewListWatchFromClient(r, aadpodv1.AzureIDResource, v1.NamespaceAll, fields.Everything())
 }
 
 func newIDInformer(r *rest.RESTClient, eventCh chan aadpodid.EventType, lw *cache.ListWatch) (cache.SharedInformer, error) {
 	azIDInformer := cache.NewSharedInformer(
 		lw,
-		&aadpodid.AzureIdentity{},
+		&aadpodv1.AzureIdentity{},
 		time.Minute*10)
 	if azIDInformer == nil {
-		return nil, fmt.Errorf("Could not create Identity watcher for %s", aadpodid.AzureIDResource)
+		return nil, fmt.Errorf("Could not create Identity watcher for %s", aadpodv1.AzureIDResource)
 	}
 	azIDInformer.AddEventHandler(
 		cache.ResourceEventHandlerFuncs{
@@ -236,17 +237,17 @@ func NodeNameFilter(nodeName string) internalinterfaces.TweakListOptionsFunc {
 }
 
 func newAssignedIDNodeListWatch(r *rest.RESTClient, nodeName string) *cache.ListWatch {
-	return cache.NewFilteredListWatchFromClient(r, aadpodid.AzureAssignedIDResource, v1.NamespaceAll, NodeNameFilter(nodeName))
+	return cache.NewFilteredListWatchFromClient(r, aadpodv1.AzureAssignedIDResource, v1.NamespaceAll, NodeNameFilter(nodeName))
 }
 
 func newAssignedIDListWatch(r *rest.RESTClient) *cache.ListWatch {
-	return cache.NewListWatchFromClient(r, aadpodid.AzureAssignedIDResource, v1.NamespaceAll, fields.Everything())
+	return cache.NewListWatchFromClient(r, aadpodv1.AzureAssignedIDResource, v1.NamespaceAll, fields.Everything())
 }
 
 func newAssignedIDInformer(lw *cache.ListWatch) (cache.SharedInformer, error) {
-	azAssignedIDInformer := cache.NewSharedInformer(lw, &aadpodid.AzureAssignedIdentity{}, time.Minute*10)
+	azAssignedIDInformer := cache.NewSharedInformer(lw, &aadpodv1.AzureAssignedIdentity{}, time.Minute*10)
 	if azAssignedIDInformer == nil {
-		return nil, fmt.Errorf("could not create %s informer", aadpodid.AzureAssignedIDResource)
+		return nil, fmt.Errorf("could not create %s informer", aadpodv1.AzureAssignedIDResource)
 	}
 
 	return azAssignedIDInformer, nil
@@ -256,16 +257,16 @@ func newPodIdentityExceptionListWatch(r *rest.RESTClient) *cache.ListWatch {
 	optionsModifier := func(options *v1.ListOptions) {}
 	return cache.NewFilteredListWatchFromClient(
 		r,
-		aadpodid.AzureIdentityExceptionResource,
+		aadpodv1.AzureIdentityExceptionResource,
 		v1.NamespaceAll,
 		optionsModifier,
 	)
 }
 
 func newPodIdentityExceptionInformer(lw *cache.ListWatch) (cache.SharedInformer, error) {
-	azPodIDExceptionInformer := cache.NewSharedInformer(lw, &aadpodid.AzurePodIdentityException{}, time.Minute*10)
+	azPodIDExceptionInformer := cache.NewSharedInformer(lw, &aadpodv1.AzurePodIdentityException{}, time.Minute*10)
 	if azPodIDExceptionInformer == nil {
-		return nil, fmt.Errorf("could not create %s informer", aadpodid.AzureIdentityExceptionResource)
+		return nil, fmt.Errorf("could not create %s informer", aadpodv1.AzureIdentityExceptionResource)
 	}
 	return azPodIDExceptionInformer, nil
 }
@@ -348,9 +349,10 @@ func (c *Client) CreateAssignedIdentity(assignedIdentity *aadpodid.AzureAssigned
 	}()
 
 	// Create a new AzureAssignedIdentity which maps the relationship between id and pod
-	var res aadpodid.AzureAssignedIdentity
+	var res aadpodv1.AzureAssignedIdentity
+	v1AssignedID := aadpodv1.ConvertInternalAssignedIdentityToV1AssignedIdentity(*assignedIdentity)
 	// TODO: Ensure that the status reflects the corresponding
-	err = c.rest.Post().Namespace(assignedIdentity.Namespace).Resource("azureassignedidentities").Body(assignedIdentity).Do().Into(&res)
+	err = c.rest.Post().Namespace(assignedIdentity.Namespace).Resource("azureassignedidentities").Body(&v1AssignedID).Do().Into(&res)
 	if err != nil {
 		klog.Error(err)
 		return err
@@ -369,19 +371,22 @@ func (c *Client) ListBindings() (res *[]aadpodid.AzureIdentityBinding, err error
 
 	list := c.BindingInformer.GetStore().List()
 	for _, binding := range list {
-		o, ok := binding.(*aadpodid.AzureIdentityBinding)
+		o, ok := binding.(*aadpodv1.AzureIdentityBinding)
 		if !ok {
-			err := fmt.Errorf("could not cast %T to %s", binding, aadpodid.AzureIDBindingResource)
+			err := fmt.Errorf("could not cast %T to %s", binding, aadpodv1.AzureIDBindingResource)
 			klog.Error(err)
 			return nil, err
 		}
 		// Note: List items returned from cache have empty Kind and API version..
 		// Work around this issue since we need that for event recording to work.
 		o.SetGroupVersionKind(schema.GroupVersionKind{
-			Group:   aadpodid.CRDGroup,
-			Version: aadpodid.CRDVersion,
+			Group:   aadpodv1.CRDGroup,
+			Version: aadpodv1.CRDVersion,
 			Kind:    reflect.TypeOf(*o).String()})
-		resList = append(resList, *o)
+
+		internalBinding := aadpodv1.ConvertV1BindingToInternalBinding(*o)
+
+		resList = append(resList, internalBinding)
 		klog.V(6).Infof("Appending binding: %s/%s to list.", o.Namespace, o.Name)
 	}
 
@@ -397,19 +402,20 @@ func (c *Client) ListAssignedIDs() (res *[]aadpodid.AzureAssignedIdentity, err e
 
 	list := c.AssignedIDInformer.GetStore().List()
 	for _, assignedID := range list {
-		o, ok := assignedID.(*aadpodid.AzureAssignedIdentity)
+		o, ok := assignedID.(*aadpodv1.AzureAssignedIdentity)
 		if !ok {
-			err := fmt.Errorf("could not cast %T to %s", assignedID, aadpodid.AzureAssignedIDResource)
+			err := fmt.Errorf("could not cast %T to %s", assignedID, aadpodv1.AzureAssignedIDResource)
 			klog.Error(err)
 			return nil, err
 		}
 		// Note: List items returned from cache have empty Kind and API version..
 		// Work around this issue since we need that for event recording to work.
 		o.SetGroupVersionKind(schema.GroupVersionKind{
-			Group:   aadpodid.CRDGroup,
-			Version: aadpodid.CRDVersion,
+			Group:   aadpodv1.CRDGroup,
+			Version: aadpodv1.CRDVersion,
 			Kind:    reflect.TypeOf(*o).String()})
-		resList = append(resList, *o)
+		out := aadpodv1.ConvertV1AssignedIdentityToInternalAssignedIdentity(*o)
+		resList = append(resList, out)
 		klog.V(6).Infof("Appending Assigned ID: %s/%s to list.", o.Namespace, o.Name)
 	}
 
@@ -427,21 +433,23 @@ func (c *Client) ListAssignedIDsInMap() (map[string]aadpodid.AzureAssignedIdenti
 
 	for _, assignedID := range list {
 
-		o, ok := assignedID.(*aadpodid.AzureAssignedIdentity)
+		o, ok := assignedID.(*aadpodv1.AzureAssignedIdentity)
 		if !ok {
-			err := fmt.Errorf("could not cast %T to %s", assignedID, aadpodid.AzureAssignedIDResource)
+			err := fmt.Errorf("could not cast %T to %s", assignedID, aadpodv1.AzureAssignedIDResource)
 			klog.Error(err)
 			return nil, err
 		}
 		// Note: List items returned from cache have empty Kind and API version..
 		// Work around this issue since we need that for event recording to work.
 		o.SetGroupVersionKind(schema.GroupVersionKind{
-			Group:   aadpodid.CRDGroup,
-			Version: aadpodid.CRDVersion,
+			Group:   aadpodv1.CRDGroup,
+			Version: aadpodv1.CRDVersion,
 			Kind:    reflect.TypeOf(*o).String()})
 
+		out := aadpodv1.ConvertV1AssignedIdentityToInternalAssignedIdentity(*o)
+
 		// assigned identities names are unique across namespaces as we use pod name-<id ns>-<id name>
-		result[o.Name] = *o
+		result[o.Name] = out
 	}
 
 	stats.Update(stats.AssignedIDList, time.Since(begin))
@@ -456,19 +464,22 @@ func (c *Client) ListIds() (res *[]aadpodid.AzureIdentity, err error) {
 
 	list := c.IDInformer.GetStore().List()
 	for _, id := range list {
-		o, ok := id.(*aadpodid.AzureIdentity)
+		o, ok := id.(*aadpodv1.AzureIdentity)
 		if !ok {
-			err := fmt.Errorf("could not cast %T to %s", id, aadpodid.AzureIDResource)
+			err := fmt.Errorf("could not cast %T to %s", id, aadpodv1.AzureIDResource)
 			klog.Error(err)
 			return nil, err
 		}
 		// Note: List items returned from cache have empty Kind and API version..
 		// Work around this issue since we need that for event recording to work.
 		o.SetGroupVersionKind(schema.GroupVersionKind{
-			Group:   aadpodid.CRDGroup,
-			Version: aadpodid.CRDVersion,
+			Group:   aadpodv1.CRDGroup,
+			Version: aadpodv1.CRDVersion,
 			Kind:    reflect.TypeOf(*o).String()})
-		resList = append(resList, *o)
+
+		out := aadpodv1.ConvertV1IdentityToInternalIdentity(*o)
+
+		resList = append(resList, out)
 		klog.V(6).Infof("Appending Identity: %s/%s to list.", o.Namespace, o.Name)
 	}
 
@@ -484,7 +495,7 @@ func (c *Client) ListPodIdentityExceptions(ns string) (res *[]aadpodid.AzurePodI
 
 	list := c.PodIdentityExceptionInformer.GetStore().List()
 	for _, binding := range list {
-		o, ok := binding.(*aadpodid.AzurePodIdentityException)
+		o, ok := binding.(*aadpodv1.AzurePodIdentityException)
 		if !ok {
 			err := fmt.Errorf("could not cast %T to %s", binding, aadpodid.AzureIdentityExceptionResource)
 			klog.Error(err)
@@ -494,10 +505,12 @@ func (c *Client) ListPodIdentityExceptions(ns string) (res *[]aadpodid.AzurePodI
 			// Note: List items returned from cache have empty Kind and API version..
 			// Work around this issue since we need that for event recording to work.
 			o.SetGroupVersionKind(schema.GroupVersionKind{
-				Group:   aadpodid.CRDGroup,
-				Version: aadpodid.CRDVersion,
+				Group:   aadpodv1.CRDGroup,
+				Version: aadpodv1.CRDVersion,
 				Kind:    reflect.TypeOf(*o).String()})
-			resList = append(resList, *o)
+			out := aadpodv1.ConvertV1PodIdentityExceptionToInternalPodIdentityException(*o)
+
+			resList = append(resList, out)
 			klog.V(6).Infof("Appending exception: %s/%s to list.", o.Namespace, o.Name)
 		}
 	}
diff --git a/pkg/k8s/client.go b/pkg/k8s/client.go
index c679f845..bda1981e 100644
--- a/pkg/k8s/client.go
+++ b/pkg/k8s/client.go
@@ -14,7 +14,7 @@ import (
 	"k8s.io/client-go/tools/clientcmd"
 	"k8s.io/klog"
 
-	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1"
+	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity"
 	crd "github.com/Azure/aad-pod-identity/pkg/crd"
 	"github.com/Azure/aad-pod-identity/pkg/metrics"
 	"github.com/Azure/aad-pod-identity/version"
diff --git a/pkg/k8s/fake.go b/pkg/k8s/fake.go
index 67cfcb70..a0021fd2 100644
--- a/pkg/k8s/fake.go
+++ b/pkg/k8s/fake.go
@@ -1,7 +1,7 @@
 package k8s
 
 import (
-	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1"
+	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity"
 	v1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
diff --git a/pkg/mic/mic.go b/pkg/mic/mic.go
index 9c29c3d5..b9365588 100644
--- a/pkg/mic/mic.go
+++ b/pkg/mic/mic.go
@@ -9,7 +9,7 @@ import (
 	"sync/atomic"
 	"time"
 
-	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1"
+	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity"
 	"github.com/Azure/aad-pod-identity/pkg/cloudprovider"
 	"github.com/Azure/aad-pod-identity/pkg/crd"
 	"github.com/Azure/aad-pod-identity/pkg/metrics"
diff --git a/pkg/nmi/server/server.go b/pkg/nmi/server/server.go
index 79574086..90a48980 100644
--- a/pkg/nmi/server/server.go
+++ b/pkg/nmi/server/server.go
@@ -18,7 +18,7 @@ import (
 	"syscall"
 	"time"
 
-	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1"
+	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity"
 	auth "github.com/Azure/aad-pod-identity/pkg/auth"
 	k8s "github.com/Azure/aad-pod-identity/pkg/k8s"
 	"github.com/Azure/aad-pod-identity/pkg/metrics"
diff --git a/pkg/pod/pod.go b/pkg/pod/pod.go
index 4ef84b01..9a3ee3ad 100644
--- a/pkg/pod/pod.go
+++ b/pkg/pod/pod.go
@@ -14,7 +14,7 @@ import (
 	"k8s.io/client-go/tools/cache"
 	"k8s.io/klog"
 
-	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1"
+	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity"
 )
 
 // Client represents new pod client


Test patch:
diff --git a/pkg/apis/aadpodidentity/v1/conversion_test.go b/pkg/apis/aadpodidentity/v1/conversion_test.go
new file mode 100644
index 00000000..8afe61c3
--- /dev/null
+++ b/pkg/apis/aadpodidentity/v1/conversion_test.go
@@ -0,0 +1,245 @@
+package v1
+
+import (
+	"testing"
+
+	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity"
+	"github.com/google/go-cmp/cmp"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+var objectMetaName string = "objectMetaName"
+var identityName string = "identityName"
+var selectorName string = "selectorName"
+var idTypeInternal aadpodid.IdentityType = aadpodid.UserAssignedMSI
+var idTypeV1 IdentityType = UserAssignedMSI
+var rID string = "resourceId"
+var assignedIDPod string = "assignedIDPod"
+var replicas int32 = 3
+var weight int = 1
+var podLabels = map[string]string{"testkey1": "testval1", "testkey2": "testval2"}
+
+func CreateV1Binding() (retV1Binding AzureIdentityBinding) {
+	return AzureIdentityBinding{
+		ObjectMeta: metav1.ObjectMeta{
+			Name: objectMetaName,
+		},
+		TypeMeta: metav1.TypeMeta{
+			Kind:       "AzureIdentityBinding",
+			APIVersion: "aadpodidentity.k8s.io/v1",
+		},
+		Spec: AzureIdentityBindingSpec{
+			AzureIdentity: identityName,
+			Selector:      selectorName,
+			Weight:        weight,
+		},
+		Status: AzureIdentityBindingStatus{
+			AvailableReplicas: replicas,
+		},
+	}
+}
+
+func CreateV1Identity() (retV1Identity AzureIdentity) {
+	return AzureIdentity{
+		ObjectMeta: metav1.ObjectMeta{
+			Name: objectMetaName,
+		},
+		TypeMeta: metav1.TypeMeta{
+			Kind:       "AzureIdentity",
+			APIVersion: "aadpodidentity.k8s.io/v1",
+		},
+		Spec: AzureIdentitySpec{
+			Type:       idTypeV1,
+			ResourceID: rID,
+			Replicas:   &replicas,
+		},
+		Status: AzureIdentityStatus{
+			AvailableReplicas: replicas,
+		},
+	}
+}
+
+func CreateV1AssignedIdentity() (retV1AssignedIdentity AzureAssignedIdentity) {
+	v1Identity := CreateV1Identity()
+	v1Binding := CreateV1Binding()
+
+	return AzureAssignedIdentity{
+		ObjectMeta: metav1.ObjectMeta{
+			Name: objectMetaName,
+		},
+		TypeMeta: metav1.TypeMeta{
+			Kind:       "AzureAssignedIdentity",
+			APIVersion: "aadpodidentity.k8s.io/v1",
+		},
+		Spec: AzureAssignedIdentitySpec{
+			AzureIdentityRef: &v1Identity,
+			AzureBindingRef:  &v1Binding,
+			Pod:              assignedIDPod,
+			Replicas:         &replicas,
+		},
+		Status: AzureAssignedIdentityStatus{
+			AvailableReplicas: replicas,
+		},
+	}
+}
+
+func CreateInternalBinding() (retV1Binding aadpodid.AzureIdentityBinding) {
+	return aadpodid.AzureIdentityBinding{
+		ObjectMeta: metav1.ObjectMeta{
+			Name: objectMetaName,
+		},
+		TypeMeta: metav1.TypeMeta{
+			Kind:       "AzureIdentityBinding",
+			APIVersion: "aadpodidentity.k8s.io/v1",
+		},
+		Spec: aadpodid.AzureIdentityBindingSpec{
+			AzureIdentity: identityName,
+			Selector:      selectorName,
+			Weight:        weight,
+		},
+		Status: aadpodid.AzureIdentityBindingStatus{
+			AvailableReplicas: replicas,
+		},
+	}
+}
+
+func CreateInternalIdentity() (retInternalIdentity aadpodid.AzureIdentity) {
+	return aadpodid.AzureIdentity{
+		ObjectMeta: metav1.ObjectMeta{
+			Name: objectMetaName,
+		},
+		TypeMeta: metav1.TypeMeta{
+			Kind:       "AzureIdentity",
+			APIVersion: "aadpodidentity.k8s.io/v1",
+		},
+		Spec: aadpodid.AzureIdentitySpec{
+			Type:       idTypeInternal,
+			ResourceID: rID,
+			Replicas:   &replicas,
+		},
+		Status: aadpodid.AzureIdentityStatus{
+			AvailableReplicas: replicas,
+		},
+	}
+}
+
+func CreateInternalAssignedIdentity() (retInternalAssignedIdentity aadpodid.AzureAssignedIdentity) {
+	internalIdentity := CreateInternalIdentity()
+	internalBinding := CreateInternalBinding()
+
+	return aadpodid.AzureAssignedIdentity{
+		ObjectMeta: metav1.ObjectMeta{
+			Name: objectMetaName,
+		},
+		TypeMeta: metav1.TypeMeta{
+			Kind:       "AzureAssignedIdentity",
+			APIVersion: "aadpodidentity.k8s.io/v1",
+		},
+		Spec: aadpodid.AzureAssignedIdentitySpec{
+			AzureIdentityRef: &internalIdentity,
+			AzureBindingRef:  &internalBinding,
+			Pod:              assignedIDPod,
+			Replicas:         &replicas,
+		},
+		Status: aadpodid.AzureAssignedIdentityStatus{
+			AvailableReplicas: replicas,
+		},
+	}
+}
+
+func CreateInternalPodIdentityException() (retPodIdentityException aadpodid.AzurePodIdentityException) {
+	return aadpodid.AzurePodIdentityException{
+		ObjectMeta: metav1.ObjectMeta{
+			Name: objectMetaName,
+		},
+		Spec: aadpodid.AzurePodIdentityExceptionSpec{
+			PodLabels: podLabels,
+		},
+		Status: aadpodid.AzurePodIdentityExceptionStatus{},
+	}
+}
+
+func CreateV1PodIdentityException() (retPodIdentityException AzurePodIdentityException) {
+	return AzurePodIdentityException{
+		ObjectMeta: metav1.ObjectMeta{
+			Name: objectMetaName,
+		},
+		Spec: AzurePodIdentityExceptionSpec{
+			PodLabels: podLabels,
+		},
+		Status: AzurePodIdentityExceptionStatus{},
+	}
+}
+
+func TestConvertV1BindingToInternalBinding(t *testing.T) {
+	bindingV1 := CreateV1Binding()
+	convertedBindingInternal := ConvertV1BindingToInternalBinding(bindingV1)
+	bindingInternal := CreateInternalBinding()
+
+	if !cmp.Equal(bindingInternal, convertedBindingInternal) {
+		t.Errorf("Failed to convert from v1 to internal AzureIdentityBinding")
+	}
+}
+
+func TestConvertV1IdentityToInternalIdentity(t *testing.T) {
+	idV1 := CreateV1Identity()
+	convertedIDInternal := ConvertV1IdentityToInternalIdentity(idV1)
+	idInternal := CreateInternalIdentity()
+
+	if !cmp.Equal(idInternal, convertedIDInternal) {
+		t.Errorf("Failed to convert from v1 to internal AzureIdentity")
+	}
+}
+
+func TestConvertV1AssignedIdentityToInternalAssignedIdentity(t *testing.T) {
+	assignedIDV1 := CreateV1AssignedIdentity()
+
+	convertedAssignedIDInternal := ConvertV1AssignedIdentityToInternalAssignedIdentity(assignedIDV1)
+	assignedIDInternal := CreateInternalAssignedIdentity()
+
+	if !cmp.Equal(assignedIDInternal, convertedAssignedIDInternal) {
+		t.Errorf("Failed to convert from v1 to internal AzureAssignedIdentity")
+	}
+}
+
+func TestConvertInternalBindingToV1Binding(t *testing.T) {
+	bindingInternal := CreateInternalBinding()
+	convertedBindingV1 := ConvertInternalBindingToV1Binding(bindingInternal)
+	bindingV1 := CreateV1Binding()
+
+	if !cmp.Equal(bindingV1, convertedBindingV1) {
+		t.Errorf("Failed to convert from internal to v1 AzureIdentityBinding")
+	}
+}
+
+func TestConvertInternalIdentityToV1Identity(t *testing.T) {
+	idInternal := CreateInternalIdentity()
+	convertedIDV1 := ConvertInternalIdentityToV1Identity(idInternal)
+	idV1 := CreateV1Identity()
+
+	if !cmp.Equal(idV1, convertedIDV1) {
+		t.Errorf("Failed to convert from internal to v1 AzureIdentity")
+	}
+}
+
+func TestConvertInternalAssignedIdentityToV1AssignedIdentity(t *testing.T) {
+	assignedIDInternal := CreateInternalAssignedIdentity()
+
+	convertedAssignedIDV1 := ConvertInternalAssignedIdentityToV1AssignedIdentity(assignedIDInternal)
+	assignedIDV1 := CreateV1AssignedIdentity()
+
+	if !cmp.Equal(assignedIDV1, convertedAssignedIDV1) {
+		t.Errorf("Failed to convert from v1 to internal AzureAssignedIdentity")
+	}
+}
+
+func TestConvertV1PodIdentityExceptionToInternalPodIdentityException(t *testing.T) {
+	podExceptionV1 := CreateV1PodIdentityException()
+
+	convertedPodExceptionInternal := ConvertV1PodIdentityExceptionToInternalPodIdentityException(podExceptionV1)
+	podExceptionInternal := CreateInternalPodIdentityException()
+
+	if !cmp.Equal(convertedPodExceptionInternal, podExceptionInternal) {
+		t.Errorf("Failed to convert from v1 to internal AzureAssignedIdentity")
+	}
+}
diff --git a/pkg/crd/crd_test.go b/pkg/crd/crd_test.go
index 74dc569c..1d2c9c0d 100644
--- a/pkg/crd/crd_test.go
+++ b/pkg/crd/crd_test.go
@@ -4,6 +4,7 @@ import (
 	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/client-go/rest"
 
+	internalaadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity"
 	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1"
 	api "k8s.io/api/core/v1"
 )
@@ -30,7 +31,7 @@ func (c *TestCrdClient) SyncCache(exit <-chan struct{}) {
 
 }
 
-func (c *TestCrdClient) CreateCrdWatchers(eventCh chan aadpodid.EventType) (err error) {
+func (c *TestCrdClient) CreateCrdWatchers(eventCh chan internalaadpodid.EventType) (err error) {
 	return nil
 }
 
@@ -85,10 +86,11 @@ func (c *TestCrdClient) ListIds() (res *[]aadpodid.AzureIdentity, err error) {
 	return &idList, nil
 }
 
-func (c *TestCrdClient) ListBindings() (res *[]aadpodid.AzureIdentityBinding, err error) {
-	bindingList := make([]aadpodid.AzureIdentityBinding, 0)
+func (c *TestCrdClient) ListBindings() (res *[]internalaadpodid.AzureIdentityBinding, err error) {
+	bindingList := make([]internalaadpodid.AzureIdentityBinding, 0)
 	for _, v := range c.bindingMap {
-		bindingList = append(bindingList, *v)
+		newBinding := aadpodid.ConvertV1BindingToInternalBinding(*v)
+		bindingList = append(bindingList, newBinding)
 	}
 	return &bindingList, nil
 }
diff --git a/pkg/mic/mic_test.go b/pkg/mic/mic_test.go
index b38b93fa..176f2b92 100644
--- a/pkg/mic/mic_test.go
+++ b/pkg/mic/mic_test.go
@@ -8,6 +8,7 @@ import (
 	"testing"
 	"time"
 
+	internalaadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity"
 	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1"
 	"github.com/Azure/aad-pod-identity/pkg/config"
 	"github.com/Azure/aad-pod-identity/pkg/metrics"
@@ -328,7 +329,7 @@ func (c *TestPodClient) DeletePod(podName string, podNs string) {
 type TestCrdClient struct {
 	*Client
 	mu            sync.Mutex
-	assignedIDMap map[string]*aadpodid.AzureAssignedIdentity
+	assignedIDMap map[string]*internalaadpodid.AzureAssignedIdentity
 	bindingMap    map[string]*aadpodid.AzureIdentityBinding
 	idMap         map[string]*aadpodid.AzureIdentity
 	err           *error
@@ -336,7 +337,7 @@ type TestCrdClient struct {
 
 func NewTestCrdClient(config *rest.Config) *TestCrdClient {
 	return &TestCrdClient{
-		assignedIDMap: make(map[string]*aadpodid.AzureAssignedIdentity),
+		assignedIDMap: make(map[string]*internalaadpodid.AzureAssignedIdentity),
 		bindingMap:    make(map[string]*aadpodid.AzureIdentityBinding),
 		idMap:         make(map[string]*aadpodid.AzureIdentity),
 	}
@@ -353,11 +354,11 @@ func (c *TestCrdClient) SyncCacheLite(exit <-chan struct{}) {
 
 }
 
-func (c *TestCrdClient) CreateCrdWatchers(eventCh chan aadpodid.EventType) (err error) {
+func (c *TestCrdClient) CreateCrdWatchers(eventCh chan internalaadpodid.EventType) (err error) {
 	return nil
 }
 
-func (c *TestCrdClient) RemoveAssignedIdentity(assignedIdentity *aadpodid.AzureAssignedIdentity) error {
+func (c *TestCrdClient) RemoveAssignedIdentity(assignedIdentity *internalaadpodid.AzureAssignedIdentity) error {
 	c.mu.Lock()
 	defer c.mu.Unlock()
 
@@ -370,7 +371,7 @@ func (c *TestCrdClient) RemoveAssignedIdentity(assignedIdentity *aadpodid.AzureA
 
 // This function is not used currently
 // TODO: consider remove
-func (c *TestCrdClient) CreateAssignedIdentity(assignedIdentity *aadpodid.AzureAssignedIdentity) error {
+func (c *TestCrdClient) CreateAssignedIdentity(assignedIdentity *internalaadpodid.AzureAssignedIdentity) error {
 	assignedIdentityToStore := *assignedIdentity //Make a copy to store in the map.
 	c.mu.Lock()
 	c.assignedIDMap[assignedIdentity.Name] = &assignedIdentityToStore
@@ -378,7 +379,7 @@ func (c *TestCrdClient) CreateAssignedIdentity(assignedIdentity *aadpodid.AzureA
 	return nil
 }
 
-func (c *TestCrdClient) UpdateAzureAssignedIdentityStatus(assignedIdentity *aadpodid.AzureAssignedIdentity, status string) error {
+func (c *TestCrdClient) UpdateAzureAssignedIdentityStatus(assignedIdentity *internalaadpodid.AzureAssignedIdentity, status string) error {
 	assignedIdentity.Status.Status = status
 	assignedIdentityToStore := *assignedIdentity //Make a copy to store in the map.
 	c.mu.Lock()
@@ -425,28 +426,30 @@ func (c *TestCrdClient) CreateID(idName, ns string, t aadpodid.IdentityType, rID
 	c.mu.Unlock()
 }
 
-func (c *TestCrdClient) ListIds() (res *[]aadpodid.AzureIdentity, err error) {
-	idList := make([]aadpodid.AzureIdentity, 0)
+func (c *TestCrdClient) ListIds() (res *[]internalaadpodid.AzureIdentity, err error) {
+	idList := make([]internalaadpodid.AzureIdentity, 0)
 	c.mu.Lock()
 	for _, v := range c.idMap {
-		idList = append(idList, *v)
+		currID := aadpodid.ConvertV1IdentityToInternalIdentity(*v)
+		idList = append(idList, currID)
 	}
 	c.mu.Unlock()
 	return &idList, nil
 }
 
-func (c *TestCrdClient) ListBindings() (res *[]aadpodid.AzureIdentityBinding, err error) {
-	bindingList := make([]aadpodid.AzureIdentityBinding, 0)
+func (c *TestCrdClient) ListBindings() (res *[]internalaadpodid.AzureIdentityBinding, err error) {
+	bindingList := make([]internalaadpodid.AzureIdentityBinding, 0)
 	c.mu.Lock()
 	for _, v := range c.bindingMap {
-		bindingList = append(bindingList, *v)
+		newBinding := aadpodid.ConvertV1BindingToInternalBinding(*v)
+		bindingList = append(bindingList, newBinding)
 	}
 	c.mu.Unlock()
 	return &bindingList, nil
 }
 
-func (c *TestCrdClient) ListAssignedIDs() (res *[]aadpodid.AzureAssignedIdentity, err error) {
-	assignedIDList := make([]aadpodid.AzureAssignedIdentity, 0)
+func (c *TestCrdClient) ListAssignedIDs() (res *[]internalaadpodid.AzureAssignedIdentity, err error) {
+	assignedIDList := make([]internalaadpodid.AzureAssignedIdentity, 0)
 	c.mu.Lock()
 	for _, v := range c.assignedIDMap {
 		assignedIDList = append(assignedIDList, *v)
@@ -455,8 +458,8 @@ func (c *TestCrdClient) ListAssignedIDs() (res *[]aadpodid.AzureAssignedIdentity
 	return &assignedIDList, nil
 }
 
-func (c *TestCrdClient) ListAssignedIDsInMap() (res map[string]aadpodid.AzureAssignedIdentity, err error) {
-	assignedIDMap := make(map[string]aadpodid.AzureAssignedIdentity)
+func (c *TestCrdClient) ListAssignedIDsInMap() (res map[string]internalaadpodid.AzureAssignedIdentity, err error) {
+	assignedIDMap := make(map[string]internalaadpodid.AzureAssignedIdentity)
 	c.mu.Lock()
 	for k, v := range c.assignedIDMap {
 		assignedIDMap[k] = *v
@@ -465,12 +468,12 @@ func (c *TestCrdClient) ListAssignedIDsInMap() (res map[string]aadpodid.AzureAss
 	return assignedIDMap, nil
 }
 
-func (c *Client) ListPodIds(podns, podname string) (map[string][]aadpodid.AzureIdentity, error) {
-	return map[string][]aadpodid.AzureIdentity{}, nil
+func (c *Client) ListPodIds(podns, podname string) (map[string][]internalaadpodid.AzureIdentity, error) {
+	return map[string][]internalaadpodid.AzureIdentity{}, nil
 }
 
 // ListPodIdentityExceptions ...
-func (c *Client) ListPodIdentityExceptions(ns string) (*[]aadpodid.AzurePodIdentityException, error) {
+func (c *Client) ListPodIdentityExceptions(ns string) (*[]internalaadpodid.AzurePodIdentityException, error) {
 	return nil, nil
 }
 
@@ -595,7 +598,7 @@ func (c *TestEventRecorder) AnnotatedEventf(object runtime.Object, annotations m
 }
 
 /************************ MIC MOC *************************************/
-func NewMICTestClient(eventCh chan aadpodid.EventType,
+func NewMICTestClient(eventCh chan internalaadpodid.EventType,
 	cpClient *TestCloudClient,
 	crdClient *TestCrdClient,
 	podClient *TestPodClient,
@@ -635,9 +638,9 @@ func TestMapMICClient(t *testing.T) {
 	defaultNS := "default"
 	micClient := &TestMICClient{}
 
-	idList := make([]aadpodid.AzureIdentity, 0)
+	idList := make([]internalaadpodid.AzureIdentity, 0)
 
-	id := new(aadpodid.AzureIdentity)
+	id := new(internalaadpodid.AzureIdentity)
 	id.Namespace = "default"
 	id.Name = "test-azure-identity"
 	id.Namespace = defaultNS
@@ -715,7 +718,7 @@ func (c *TestMICClient) testRunSync() func(t *testing.T) {
 }
 
 func TestSimpleMICClient(t *testing.T) {
-	eventCh := make(chan aadpodid.EventType, 100)
+	eventCh := make(chan internalaadpodid.EventType, 100)
 	cloudClient := NewTestCloudClient(config.AzureConfig{})
 	crdClient := NewTestCrdClient(nil)
 	podClient := NewTestPodClient()
@@ -732,7 +735,7 @@ func TestSimpleMICClient(t *testing.T) {
 	nodeClient.AddNode("test-node")
 	podClient.AddPod("test-pod", "default", "test-node", "test-select")
 
-	eventCh <- aadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
 
 	defer micClient.testRunSync()(t)
 
@@ -762,7 +765,7 @@ func TestSimpleMICClient(t *testing.T) {
 	//Test2: Remove assigned id event test
 	podClient.DeletePod("test-pod", "default")
 
-	eventCh <- aadpodid.PodDeleted
+	eventCh <- internalaadpodid.PodDeleted
 	if !evtRecorder.WaitForEvents(1) {
 		t.Fatal("timeout waiting for event sync")
 	}
@@ -792,7 +795,7 @@ func TestSimpleMICClient(t *testing.T) {
 
 	podClient.AddPod("test-pod", "default", "test-node", "test-select")
 
-	eventCh <- aadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
 	evtRecorder.WaitForEvents(1)
 
 	listAssignedIDs, err = crdClient.ListAssignedIDs()
@@ -818,13 +821,13 @@ func TestSimpleMICClient(t *testing.T) {
 	cloudClient.UnSetError()
 
 	//podClient.AddPod("test-pod", "default", "test-node", "test-select")
-	eventCh <- aadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
 
 	err = errors.New("remove error returned from cloud provider")
 	cloudClient.SetError(err)
 
 	podClient.DeletePod("test-pod", "default")
-	eventCh <- aadpodid.PodDeleted
+	eventCh <- internalaadpodid.PodDeleted
 	/*
 		testPass = evtRecorder.Validate(&LastEvent{Type: "Warning", Reason: "binding remove error",
 			Message: "Binding testbinding removal from node test-node for pod test-pod resulted in error remove error returned from cloud provider"})
@@ -836,7 +839,7 @@ func TestSimpleMICClient(t *testing.T) {
 }
 
 func TestAddDelMICClient(t *testing.T) {
-	eventCh := make(chan aadpodid.EventType, 100)
+	eventCh := make(chan internalaadpodid.EventType, 100)
 	cloudClient := NewTestCloudClient(config.AzureConfig{})
 	crdClient := NewTestCrdClient(nil)
 	podClient := NewTestPodClient()
@@ -861,8 +864,8 @@ func TestAddDelMICClient(t *testing.T) {
 	podClient.AddPod("test-pod4", "default", "test-node2", "test-select4")
 	podClient.GetPods()
 
-	eventCh <- aadpodid.PodCreated
-	eventCh <- aadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
 
 	stopSync1 := micClient.testRunSync()
 	defer stopSync1(t)
@@ -894,9 +897,9 @@ func TestAddDelMICClient(t *testing.T) {
 	podClient.AddPod("test-pod3", "default", "test-node2", "test-select3")
 	podClient.GetPods()
 
-	eventCh <- aadpodid.PodCreated
-	eventCh <- aadpodid.PodDeleted
-	eventCh <- aadpodid.PodDeleted
+	eventCh <- internalaadpodid.PodCreated
+	eventCh <- internalaadpodid.PodDeleted
+	eventCh <- internalaadpodid.PodDeleted
 
 	stopSync1(t)
 	defer micClient.testRunSync()(t)
@@ -928,7 +931,7 @@ func TestAddDelMICClient(t *testing.T) {
 }
 
 func TestMicAddDelVMSS(t *testing.T) {
-	eventCh := make(chan aadpodid.EventType, 100)
+	eventCh := make(chan internalaadpodid.EventType, 100)
 	cloudClient := NewTestCloudClient(config.AzureConfig{VMType: "vmss"})
 	crdClient := NewTestCrdClient(nil)
 	podClient := NewTestPodClient()
@@ -962,9 +965,9 @@ func TestMicAddDelVMSS(t *testing.T) {
 
 	defer micClient.testRunSync()(t)
 
-	eventCh <- aadpodid.PodCreated
-	eventCh <- aadpodid.PodCreated
-	eventCh <- aadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
 	if !evtRecorder.WaitForEvents(3) {
 		t.Fatalf("Timeout waiting for mic sync cycles")
 	}
@@ -985,7 +988,7 @@ func TestMicAddDelVMSS(t *testing.T) {
 	}
 
 	podClient.DeletePod("test-pod1", "default")
-	eventCh <- aadpodid.PodDeleted
+	eventCh <- internalaadpodid.PodDeleted
 
 	if !evtRecorder.WaitForEvents(1) {
 		t.Fatal("Timeout waiting for mic sync cycles")
@@ -1008,7 +1011,7 @@ func TestMicAddDelVMSS(t *testing.T) {
 
 	podClient.DeletePod("test-pod2", "default")
 
-	eventCh <- aadpodid.PodDeleted
+	eventCh <- internalaadpodid.PodDeleted
 
 	if !evtRecorder.WaitForEvents(1) {
 		t.Fatal("Timeout waiting for mic sync cycles")
@@ -1031,7 +1034,7 @@ func TestMicAddDelVMSS(t *testing.T) {
 }
 
 func TestMICStateFlow(t *testing.T) {
-	eventCh := make(chan aadpodid.EventType, 100)
+	eventCh := make(chan internalaadpodid.EventType, 100)
 	cloudClient := NewTestCloudClient(config.AzureConfig{})
 	crdClient := NewTestCrdClient(nil)
 	podClient := NewTestPodClient()
@@ -1049,7 +1052,7 @@ func TestMICStateFlow(t *testing.T) {
 	nodeClient.AddNode("test-node1")
 	podClient.AddPod("test-pod1", "default", "test-node1", "test-select1")
 
-	eventCh <- aadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
 	defer micClient.testRunSync()(t)
 
 	if !evtRecorder.WaitForEvents(1) {
@@ -1074,7 +1077,7 @@ func TestMICStateFlow(t *testing.T) {
 	cloudClient.SetError(errors.New("error removing identity from node"))
 	cloudClient.testVMClient.identity = &compute.VirtualMachineIdentity{IdentityIds: &[]string{"test-user-msi-resourceid"}}
 
-	eventCh <- aadpodid.PodDeleted
+	eventCh <- internalaadpodid.PodDeleted
 	if !evtRecorder.WaitForEvents(1) {
 		t.Fatalf("Timeout waiting for mic sync cycles")
 	}
@@ -1102,7 +1105,7 @@ func TestMICStateFlow(t *testing.T) {
 	nodeClient.AddNode("test-node2")
 	podClient.AddPod("test-pod2", "default", "test-node2", "test-select2")
 
-	eventCh <- aadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
 	if !evtRecorder.WaitForEvents(2) {
 		t.Fatalf("Timeout waiting for mic sync cycles")
 	}
@@ -1130,7 +1133,7 @@ func TestMICStateFlow(t *testing.T) {
 
 	// delete pod2 and everything should be cleaned up now
 	podClient.DeletePod("test-pod2", "default")
-	eventCh <- aadpodid.PodDeleted
+	eventCh <- internalaadpodid.PodDeleted
 	if !evtRecorder.WaitForEvents(2) {
 		t.Fatalf("Timeout waiting for mic sync cycles")
 	}
@@ -1145,7 +1148,7 @@ func TestMICStateFlow(t *testing.T) {
 }
 
 func TestForceNamespaced(t *testing.T) {
-	eventCh := make(chan aadpodid.EventType, 100)
+	eventCh := make(chan internalaadpodid.EventType, 100)
 	cloudClient := NewTestCloudClient(config.AzureConfig{})
 	crdClient := NewTestCrdClient(nil)
 	podClient := NewTestPodClient()
@@ -1162,7 +1165,7 @@ func TestForceNamespaced(t *testing.T) {
 	nodeClient.AddNode("test-node1")
 	podClient.AddPod("test-pod1", "default", "test-node1", "test-select1")
 
-	eventCh <- aadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
 	defer micClient.testRunSync()(t)
 
 	if !evtRecorder.WaitForEvents(1) {
@@ -1184,9 +1187,9 @@ func TestForceNamespaced(t *testing.T) {
 	crdClient.CreateBinding("testbinding1", "default2", "test-id1", "test-select1", "bindingrv2")
 	podClient.AddPod("test-pod2", "default2", "test-node1", "test-select1")
 
-	eventCh <- aadpodid.IdentityCreated
-	eventCh <- aadpodid.BindingCreated
-	eventCh <- aadpodid.PodCreated
+	eventCh <- internalaadpodid.IdentityCreated
+	eventCh <- internalaadpodid.BindingCreated
+	eventCh <- internalaadpodid.PodCreated
 
 	if !evtRecorder.WaitForEvents(1) {
 		t.Fatalf("Timeout waiting for mic sync cycles")
@@ -1209,7 +1212,7 @@ func TestForceNamespaced(t *testing.T) {
 }
 
 func TestSyncRetryLoop(t *testing.T) {
-	eventCh := make(chan aadpodid.EventType, 100)
+	eventCh := make(chan internalaadpodid.EventType, 100)
 	cloudClient := NewTestCloudClient(config.AzureConfig{})
 	crdClient := NewTestCrdClient(nil)
 	podClient := NewTestPodClient()
@@ -1232,7 +1235,7 @@ func TestSyncRetryLoop(t *testing.T) {
 	nodeClient.AddNode("test-node1")
 	podClient.AddPod("test-pod1", "default", "test-node1", "test-select1")
 
-	eventCh <- aadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
 	defer micClient.testRunSync()(t)
 
 	if !evtRecorder.WaitForEvents(1) {
@@ -1255,7 +1258,7 @@ func TestSyncRetryLoop(t *testing.T) {
 	cloudClient.SetError(errors.New("error removing identity from node"))
 	cloudClient.testVMClient.identity = &compute.VirtualMachineIdentity{IdentityIds: &[]string{"test-user-msi-resourceid"}}
 
-	eventCh <- aadpodid.PodDeleted
+	eventCh <- internalaadpodid.PodDeleted
 	if !evtRecorder.WaitForEvents(1) {
 		t.Fatalf("Timeout waiting for mic sync cycles")
 	}
@@ -1288,7 +1291,7 @@ func TestSyncRetryLoop(t *testing.T) {
 }
 
 func TestSyncNodeNotFound(t *testing.T) {
-	eventCh := make(chan aadpodid.EventType, 100)
+	eventCh := make(chan internalaadpodid.EventType, 100)
 	cloudClient := NewTestCloudClient(config.AzureConfig{})
 	crdClient := NewTestCrdClient(nil)
 	podClient := NewTestPodClient()
@@ -1306,7 +1309,7 @@ func TestSyncNodeNotFound(t *testing.T) {
 	for i := 0; i < 10; i++ {
 		nodeClient.AddNode(fmt.Sprintf("test-node%d", i))
 		podClient.AddPod(fmt.Sprintf("test-pod%d", i), "default", fmt.Sprintf("test-node%d", i), "test-select1")
-		eventCh <- aadpodid.PodCreated
+		eventCh <- internalaadpodid.PodCreated
 	}
 
 	defer micClient.testRunSync()(t)
@@ -1333,12 +1336,12 @@ func TestSyncNodeNotFound(t *testing.T) {
 	for i := 5; i < 10; i++ {
 		nodeClient.Delete(fmt.Sprintf("test-node%d", i))
 		podClient.DeletePod(fmt.Sprintf("test-pod%d", i), "default")
-		eventCh <- aadpodid.PodDeleted
+		eventCh <- internalaadpodid.PodDeleted
 	}
 
 	nodeClient.AddNode("test-nodex")
 	podClient.AddPod("test-podx", "default", "test-node1", "test-select1")
-	eventCh <- aadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
 
 	if !evtRecorder.WaitForEvents(6) {
 		t.Fatalf("Timeout waiting for mic sync cycles")
@@ -1360,7 +1363,7 @@ func TestSyncNodeNotFound(t *testing.T) {
 }
 
 func TestProcessingTimeForScale(t *testing.T) {
-	eventCh := make(chan aadpodid.EventType, 20000)
+	eventCh := make(chan internalaadpodid.EventType, 20000)
 	cloudClient := NewTestCloudClient(config.AzureConfig{})
 	crdClient := NewTestCrdClient(nil)
 	podClient := NewTestPodClient()
@@ -1379,7 +1382,7 @@ func TestProcessingTimeForScale(t *testing.T) {
 	for i := 0; i < 20000; i++ {
 		podClient.AddPod(fmt.Sprintf("test-pod%d", i), "default", "test-node1", "test-select1")
 	}
-	eventCh <- aadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
 
 	defer micClient.testRunSync()(t)
 
@@ -1399,7 +1402,7 @@ func TestProcessingTimeForScale(t *testing.T) {
 	for i := 10000; i < 20000; i++ {
 		podClient.DeletePod(fmt.Sprintf("test-pod%d", i), "default")
 	}
-	eventCh <- aadpodid.PodDeleted
+	eventCh <- internalaadpodid.PodDeleted
 
 	if !evtRecorder.WaitForEvents(10000) {
 		t.Fatalf("Timeout waiting for mic sync cycles")
@@ -1415,7 +1418,7 @@ func TestProcessingTimeForScale(t *testing.T) {
 }
 
 func TestSyncExit(t *testing.T) {
-	eventCh := make(chan aadpodid.EventType)
+	eventCh := make(chan internalaadpodid.EventType)
 	cloudClient := NewTestCloudClient(config.AzureConfig{VMType: "vmss"})
 	crdClient := NewTestCrdClient(nil)
 	podClient := NewTestPodClient()
@@ -1430,7 +1433,7 @@ func TestSyncExit(t *testing.T) {
 }
 
 func TestMicAddDelVMSSwithImmutableIdentities(t *testing.T) {
-	eventCh := make(chan aadpodid.EventType, 100)
+	eventCh := make(chan internalaadpodid.EventType, 100)
 	cloudClient := NewTestCloudClient(config.AzureConfig{VMType: "vmss"})
 	crdClient := NewTestCrdClient(nil)
 	podClient := NewTestPodClient()
@@ -1468,9 +1471,9 @@ func TestMicAddDelVMSSwithImmutableIdentities(t *testing.T) {
 
 	defer micClient.testRunSync()(t)
 
-	eventCh <- aadpodid.PodCreated
-	eventCh <- aadpodid.PodCreated
-	eventCh <- aadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
+	eventCh <- internalaadpodid.PodCreated
 	if !evtRecorder.WaitForEvents(3) {
 		t.Fatalf("Timeout waiting for mic sync cycles")
 	}
@@ -1491,7 +1494,7 @@ func TestMicAddDelVMSSwithImmutableIdentities(t *testing.T) {
 	}
 
 	podClient.DeletePod("test-pod1", "default")
-	eventCh <- aadpodid.PodDeleted
+	eventCh <- internalaadpodid.PodDeleted
 
 	if !evtRecorder.WaitForEvents(1) {
 		t.Fatal("Timeout waiting for mic sync cycles")
@@ -1514,7 +1517,7 @@ func TestMicAddDelVMSSwithImmutableIdentities(t *testing.T) {
 
 	podClient.DeletePod("test-pod2", "default")
 
-	eventCh <- aadpodid.PodDeleted
+	eventCh <- internalaadpodid.PodDeleted
 
 	if !evtRecorder.WaitForEvents(1) {
 		t.Fatal("Timeout waiting for mic sync cycles")
diff --git a/pkg/nmi/server/server_test.go b/pkg/nmi/server/server_test.go
index ddd1ca1d..97756843 100644
--- a/pkg/nmi/server/server_test.go
+++ b/pkg/nmi/server/server_test.go
@@ -4,7 +4,7 @@ import (
 	"encoding/base64"
 	"testing"
 
-	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1"
+	internalaadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity"
 	auth "github.com/Azure/aad-pod-identity/pkg/auth"
 	"github.com/Azure/aad-pod-identity/pkg/k8s"
 	"github.com/Azure/aad-pod-identity/pkg/metrics"
@@ -34,14 +34,14 @@ func TestGetTokenForMatchingIDBySP(t *testing.T) {
 		Namespace: "default",
 	}
 
-	podID := aadpodid.AzureIdentity{
-		Spec: aadpodid.AzureIdentitySpec{
-			Type:           aadpodid.ServicePrincipal,
+	podID := internalaadpodid.AzureIdentity{
+		Spec: internalaadpodid.AzureIdentitySpec{
+			Type:           internalaadpodid.ServicePrincipal,
 			TenantID:       "tid",
 			ClientID:       "aabc0000-a83v-9h4m-000j-2c0a66b0c1f9",
 			ClientPassword: secretRef,
 		},
 	}
-	podIDs := []aadpodid.AzureIdentity{podID}
+	podIDs := []internalaadpodid.AzureIdentity{podID}
 	getTokenForMatchingID(kubeClient, podID.Spec.ClientID, "https://management.azure.com/", podIDs)
 }
diff --git a/pkg/pod/pod_test.go b/pkg/pod/pod_test.go
index 6e02f741..d5af21b7 100644
--- a/pkg/pod/pod_test.go
+++ b/pkg/pod/pod_test.go
@@ -3,7 +3,7 @@ package pod
 import (
 	"testing"
 
-	aadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity/v1"
+	internalaadpodid "github.com/Azure/aad-pod-identity/pkg/apis/aadpodidentity"
 
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -32,7 +32,7 @@ func (c TestPodClient) GetPods() (pods []*corev1.Pod, err error) {
 
 func (c *TestPodClient) AddPod(podName string, podNs string, nodeName string, binding string) {
 	labels := make(map[string]string)
-	labels[aadpodid.CRDLabelKey] = binding
+	labels[internalaadpodid.CRDLabelKey] = binding
 	pod := &corev1.Pod{
 		ObjectMeta: metav1.ObjectMeta{
 			Name:      podName,
@@ -65,7 +65,7 @@ func (c *TestPodClient) DeletePod(podName string, podNs string) {
 func TestIsPodExcepted(t *testing.T) {
 	cases := []struct {
 		podLabels        map[string]string
-		exceptionList    []aadpodid.AzurePodIdentityException
+		exceptionList    []internalaadpodid.AzurePodIdentityException
 		shouldBeExcepted bool
 	}{
 		{
@@ -75,12 +75,12 @@ func TestIsPodExcepted(t *testing.T) {
 		},
 		{
 			podLabels: map[string]string{"foo": "except"},
-			exceptionList: []aadpodid.AzurePodIdentityException{
+			exceptionList: []internalaadpodid.AzurePodIdentityException{
 				{
 					ObjectMeta: metav1.ObjectMeta{
 						Name: "exception1",
 					},
-					Spec: aadpodid.AzurePodIdentityExceptionSpec{
+					Spec: internalaadpodid.AzurePodIdentityExceptionSpec{
 						PodLabels: map[string]string{"foo": "notexcept"},
 					},
 				},
@@ -89,12 +89,12 @@ func TestIsPodExcepted(t *testing.T) {
 		},
 		{
 			podLabels: map[string]string{"foo": "except"},
-			exceptionList: []aadpodid.AzurePodIdentityException{
+			exceptionList: []internalaadpodid.AzurePodIdentityException{
 				{
 					ObjectMeta: metav1.ObjectMeta{
 						Name: "exception1",
 					},
-					Spec: aadpodid.AzurePodIdentityExceptionSpec{
+					Spec: internalaadpodid.AzurePodIdentityExceptionSpec{
 						PodLabels: map[string]string{"foo": "notexcept"},
 					},
 				},
@@ -102,7 +102,7 @@ func TestIsPodExcepted(t *testing.T) {
 					ObjectMeta: metav1.ObjectMeta{
 						Name: "exception2",
 					},
-					Spec: aadpodid.AzurePodIdentityExceptionSpec{
+					Spec: internalaadpodid.AzurePodIdentityExceptionSpec{
 						PodLabels: map[string]string{"foo": "except"},
 					},
 				},
diff --git a/test/e2e/aadpodidentity_test.go b/test/e2e/aadpodidentity_test.go
index dd1c4565..a55d7c10 100644
--- a/test/e2e/aadpodidentity_test.go
+++ b/test/e2e/aadpodidentity_test.go
@@ -296,52 +296,6 @@ var _ = Describe("Kubernetes cluster using aad-pod-identity", func() {
 		}
 	})
 
-	// It("should re-schedule the identity validator and its identity to a new node after powering down and restarting the node containing them", func() {
-	// 	setUpIdentityAndDeployment(keyvaultIdentity, "")
-
-	// 	identityClientID, err := azure.GetIdentityClientID(cfg.ResourceGroup, keyvaultIdentity)
-	// 	Expect(err).NotTo(HaveOccurred())
-	// 	Expect(identityClientID).NotTo(Equal(""))
-
-	// 	podName, err := pod.GetNameByPrefix(identityValidator)
-	// 	Expect(err).NotTo(HaveOccurred())
-	// 	Expect(podName).NotTo(Equal(""))
-
-	// 	// Get the name of the node to drain
-	// 	nodeName, err := pod.GetNodeName(podName)
-	// 	Expect(err).NotTo(HaveOccurred())
-	// 	Expect(nodeName).NotTo(Equal(""))
-
-	// 	azure.StopKubelet(cfg.ResourceGroup, nodeName)
-	// 	azure.StopVM(cfg.ResourceGroup, nodeName)
-
-	// 	// 2 AzureAssignedIdentity, one from the powered down node, in Unknown state,
-	// 	// and one from the other node, in Running state
-	// 	ok, err := azureassignedidentity.WaitOnLengthMatched(2)
-	// 	Expect(err).NotTo(HaveOccurred())
-	// 	Expect(ok).To(Equal(true))
-
-	// 	// Get the new pod name
-	// 	podName, err = pod.GetNameByPrefix(identityValidator)
-	// 	Expect(err).NotTo(HaveOccurred())
-	// 	Expect(podName).NotTo(Equal(""))
-
-	// 	azureAssignedIdentity, err := azureassignedidentity.GetByPrefix(identityValidator)
-	// 	validateAzureAssignedIdentity(azureAssignedIdentity, keyvaultIdentity)
-
-	// 	// Start the VM again to ensure that the old AzureAssignedIdentity is deleted
-	// 	azure.StartVM(cfg.ResourceGroup, nodeName)
-	// 	azure.StartKubelet(cfg.ResourceGroup, nodeName)
-
-	// 	ok, err = azureassignedidentity.WaitOnLengthMatched(1)
-	// 	Expect(ok).To(Equal(true))
-	// 	Expect(err).NotTo(HaveOccurred())
-
-	// 	// Final validation to ensure that everything is functioning after restarting the node
-	// 	azureAssignedIdentity, err = azureassignedidentity.GetByPrefix(identityValidator)
-	// 	validateAzureAssignedIdentity(azureAssignedIdentity, keyvaultIdentity)
-	// })
-
 	It("should not alter the user assigned identity on VM after AAD pod identity is created and deleted", func() {
 		azureIdentityResource := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ManagedIdentity/userAssignedIdentities/%s"
 		clusterIdentityResource := fmt.Sprintf(azureIdentityResource, cfg.SubscriptionID, cfg.ResourceGroup, clusterIdentity)
@@ -355,6 +309,10 @@ var _ = Describe("Kubernetes cluster using aad-pod-identity", func() {
 
 		setUpIdentityAndDeployment(keyvaultIdentity, "", "1")
 
+		ok, err := azureassignedidentity.WaitOnLengthMatched(1)
+		Expect(err).NotTo(HaveOccurred())
+		Expect(ok).To(Equal(true))
+
 		podName, err := pod.GetNameByPrefix(identityValidator)
 		Expect(err).NotTo(HaveOccurred())
 		Expect(podName).NotTo(Equal(""))
@@ -375,7 +333,7 @@ var _ = Describe("Kubernetes cluster using aad-pod-identity", func() {
 		Expect(len(userAssignedIdentities)).To(Equal(2))
 
 		// Check if both VM identity and pod identity exist in the node
-		_, ok := (userAssignedIdentities)[clusterIdentityResource]
+		_, ok = (userAssignedIdentities)[clusterIdentityResource]
 		Expect(ok).To(Equal(true))
 		_, ok = (userAssignedIdentities)[keyvaultIdentityResource]
 		Expect(ok).To(Equal(true))
@@ -405,71 +363,6 @@ var _ = Describe("Kubernetes cluster using aad-pod-identity", func() {
 		removeUserAssignedIdentityFromCluster(nodeList, clusterIdentity)
 	})
 
-	// Require issue #93 to be fixed in order for this test to pass
-	// It("should not alter the user assigned identity on VM after assigning and removing the same identity to the pod", func() {
-	// 	azureIdentityResource := "/subscriptions/%s/resourceGroups/aad-pod-identity-e2e/providers/Microsoft.ManagedIdentity/userAssignedIdentities/%s"
-	// 	clusterIdentityResource := fmt.Sprintf(azureIdentityResource, cfg.SubscriptionID, clusterIdentity)
-
-	// 	// Assign user assigned identity to every node
-	// 	nodeList, err := node.GetAll()
-	// 	Expect(err).NotTo(HaveOccurred())
-
-	// 	// Re-deploy aad pod identity infra to allow MIC to register the correct VM level identity
-	// 	cmd := exec.Command("kubectl", "delete", "-f", "../../deploy/infra/deployment-rbac.yaml", "--ignore-not-found")
-	// 	_, err = cmd.CombinedOutput()
-	// 	Expect(err).NotTo(HaveOccurred())
-
-	// 	enableUserAssignedIdentityOnCluster(nodeList, clusterIdentity)
-
-	// 	cmd = exec.Command("kubectl", "apply", "-f", "../../deploy/infra/deployment-rbac.yaml")
-	// 	_, err = cmd.CombinedOutput()
-	// 	Expect(err).NotTo(HaveOccurred())
-
-	// 	// Assign the same identity to identity validator pod
-	// 	setUpIdentityAndDeployment(clusterIdentity, "")
-
-	// 	podName, err := pod.GetNameByPrefix(identityValidator)
-	// 	Expect(err).NotTo(HaveOccurred())
-	// 	Expect(podName).NotTo(Equal(""))
-
-	// 	// Get the name of the node to assign the identity to
-	// 	nodeName, err := pod.GetNodeName(podName)
-	// 	Expect(err).NotTo(HaveOccurred())
-	// 	Expect(nodeName).NotTo(Equal(""))
-
-	// 	// Make sure that there is only one identity assigned to the VM
-	// 	userAssignedIdentities, err := azure.GetUserAssignedIdentities(cfg.ResourceGroup, nodeName)
-	// 	Expect(err).NotTo(HaveOccurred())
-	// 	Expect(len(*userAssignedIdentities)).To(Equal(1))
-
-	// 	_, ok := (*userAssignedIdentities)[clusterIdentityResource]
-	// 	Expect(ok).To(Equal(true))
-
-	// 	azureAssignedIdentity, err := azureassignedidentity.GetByPrefix(identityValidator)
-	// 	Expect(err).NotTo(HaveOccurred())
-	// 	validateAzureAssignedIdentity(azureAssignedIdentity, clusterIdentity)
-
-	// 	// Delete pod identity to verify that the VM identity did not get deleted
-	// 	waitForDeployDeletion(identityValidator)
-	// 	cmd = exec.Command("kubectl", "delete", "AzureIdentity,AzureIdentityBinding,AzureAssignedIdentity", "--all")
-	// 	util.PrintCommand(cmd)
-	// 	_, err = cmd.CombinedOutput()
-	// 	Expect(err).NotTo(HaveOccurred())
-
-	// 	ok, err = azureassignedidentity.WaitOnLengthMatched(0)
-	// 	Expect(err).NotTo(HaveOccurred())
-	// 	Expect(ok).To(Equal(true))
-
-	// 	userAssignedIdentities, err = azure.GetUserAssignedIdentities(cfg.ResourceGroup, nodeName)
-	// 	Expect(err).NotTo(HaveOccurred())
-	// 	Expect(len(*userAssignedIdentities)).To(Equal(1))
-
-	// 	_, ok = (*userAssignedIdentities)[clusterIdentityResource]
-	// 	Expect(ok).To(Equal(true))
-
-	// 	removeUserAssignedIdentityFromCluster(nodeList, clusterIdentity)
-	// })
-
 	It("should cleanup iptable rules after deleting aad-pod-identity", func() {
 		// delete the aad-pod-identity deployment
 		cmd := exec.Command("kubectl", "delete", "-f", "../../deploy/infra/deployment-rbac.yaml", "--ignore-not-found")
diff --git a/test/e2e/config/config.go b/test/e2e/config/config.go
index e05c2ddb..b3a61f59 100644
--- a/test/e2e/config/config.go
+++ b/test/e2e/config/config.go
@@ -1,6 +1,10 @@
 package config
 
-import "github.com/kelseyhightower/envconfig"
+import (
+	"strings"
+
+	"github.com/kelseyhightower/envconfig"
+)
 
 // Config holds global test configuration translated from environment variables
 type Config struct {
@@ -25,6 +29,6 @@ func ParseConfig() (*Config, error) {
 	if err := envconfig.Process("config", c); err != nil {
 		return nil, err
 	}
-
+	c.ResourceGroup = strings.ToLower(c.ResourceGroup)
 	return c, nil
 }