diff options
Diffstat (limited to 'src/monitor/pkg/controller')
10 files changed, 22 insertions, 6 deletions
diff --git a/src/monitor/pkg/controller/resourcebundlestate/configMap_controller.go b/src/monitor/pkg/controller/resourcebundlestate/configMap_controller.go index f93355af..ed9283cc 100644 --- a/src/monitor/pkg/controller/resourcebundlestate/configMap_controller.go +++ b/src/monitor/pkg/controller/resourcebundlestate/configMap_controller.go @@ -166,6 +166,7 @@ func (r *configMapReconciler) updateSingleCR(cr *v1alpha1.ResourceBundleState, c // Add it to CR cr.Status.ConfigMapStatuses = append(cr.Status.ConfigMapStatuses, corev1.ConfigMap{ + TypeMeta: cm.TypeMeta, ObjectMeta: cm.ObjectMeta, }) diff --git a/src/monitor/pkg/controller/resourcebundlestate/controller.go b/src/monitor/pkg/controller/resourcebundlestate/controller.go index 7206116b..faee5892 100644 --- a/src/monitor/pkg/controller/resourcebundlestate/controller.go +++ b/src/monitor/pkg/controller/resourcebundlestate/controller.go @@ -145,6 +145,7 @@ func (r *reconciler) updateServices(rbstate *v1alpha1.ResourceBundleState, for _, svc := range serviceList.Items { resStatus := corev1.Service{ + TypeMeta: svc.TypeMeta, ObjectMeta: svc.ObjectMeta, Status: svc.Status, } @@ -165,12 +166,12 @@ func (r *reconciler) updatePods(rbstate *v1alpha1.ResourceBundleState, return err } - rbstate.Status.PodStatuses = []v1alpha1.PodStatus{} + rbstate.Status.PodStatuses = []corev1.Pod{} for _, pod := range podList.Items { - resStatus := v1alpha1.PodStatus{ + resStatus := corev1.Pod{ + TypeMeta: pod.TypeMeta, ObjectMeta: pod.ObjectMeta, - Ready: false, Status: pod.Status, } rbstate.Status.PodStatuses = append(rbstate.Status.PodStatuses, resStatus) @@ -194,6 +195,7 @@ func (r *reconciler) updateConfigMaps(rbstate *v1alpha1.ResourceBundleState, for _, cm := range configMapList.Items { resStatus := corev1.ConfigMap{ + TypeMeta: cm.TypeMeta, ObjectMeta: cm.ObjectMeta, } rbstate.Status.ConfigMapStatuses = append(rbstate.Status.ConfigMapStatuses, resStatus) @@ -217,6 +219,7 @@ func (r *reconciler) updateDeployments(rbstate *v1alpha1.ResourceBundleState, for _, dep := range deploymentList.Items { resStatus := appsv1.Deployment{ + TypeMeta: dep.TypeMeta, ObjectMeta: dep.ObjectMeta, Status: dep.Status, } @@ -241,6 +244,7 @@ func (r *reconciler) updateSecrets(rbstate *v1alpha1.ResourceBundleState, for _, sec := range secretList.Items { resStatus := corev1.Secret{ + TypeMeta: sec.TypeMeta, ObjectMeta: sec.ObjectMeta, } rbstate.Status.SecretStatuses = append(rbstate.Status.SecretStatuses, resStatus) @@ -264,6 +268,7 @@ func (r *reconciler) updateDaemonSets(rbstate *v1alpha1.ResourceBundleState, for _, ds := range daemonSetList.Items { resStatus := appsv1.DaemonSet{ + TypeMeta: ds.TypeMeta, ObjectMeta: ds.ObjectMeta, Status: ds.Status, } @@ -288,6 +293,7 @@ func (r *reconciler) updateIngresses(rbstate *v1alpha1.ResourceBundleState, for _, ing := range ingressList.Items { resStatus := v1beta1.Ingress{ + TypeMeta: ing.TypeMeta, ObjectMeta: ing.ObjectMeta, Status: ing.Status, } @@ -312,6 +318,7 @@ func (r *reconciler) updateJobs(rbstate *v1alpha1.ResourceBundleState, for _, job := range jobList.Items { resStatus := v1.Job{ + TypeMeta: job.TypeMeta, ObjectMeta: job.ObjectMeta, Status: job.Status, } @@ -336,6 +343,7 @@ func (r *reconciler) updateStatefulSets(rbstate *v1alpha1.ResourceBundleState, for _, sfs := range statefulSetList.Items { resStatus := appsv1.StatefulSet{ + TypeMeta: sfs.TypeMeta, ObjectMeta: sfs.ObjectMeta, Status: sfs.Status, } diff --git a/src/monitor/pkg/controller/resourcebundlestate/daemonSet_controller.go b/src/monitor/pkg/controller/resourcebundlestate/daemonSet_controller.go index 3ccb40ce..1f46f05c 100644 --- a/src/monitor/pkg/controller/resourcebundlestate/daemonSet_controller.go +++ b/src/monitor/pkg/controller/resourcebundlestate/daemonSet_controller.go @@ -168,6 +168,7 @@ func (r *daemonSetReconciler) updateSingleCR(cr *v1alpha1.ResourceBundleState, d // Add it to CR cr.Status.DaemonSetStatuses = append(cr.Status.DaemonSetStatuses, appsv1.DaemonSet{ + TypeMeta: ds.TypeMeta, ObjectMeta: ds.ObjectMeta, Status: ds.Status, }) diff --git a/src/monitor/pkg/controller/resourcebundlestate/deployment_controller.go b/src/monitor/pkg/controller/resourcebundlestate/deployment_controller.go index c563ed77..99ca2f40 100644 --- a/src/monitor/pkg/controller/resourcebundlestate/deployment_controller.go +++ b/src/monitor/pkg/controller/resourcebundlestate/deployment_controller.go @@ -168,6 +168,7 @@ func (r *deploymentReconciler) updateSingleCR(cr *v1alpha1.ResourceBundleState, // Add it to CR cr.Status.DeploymentStatuses = append(cr.Status.DeploymentStatuses, appsv1.Deployment{ + TypeMeta: dep.TypeMeta, ObjectMeta: dep.ObjectMeta, Status: dep.Status, }) diff --git a/src/monitor/pkg/controller/resourcebundlestate/ingress_controller.go b/src/monitor/pkg/controller/resourcebundlestate/ingress_controller.go index 603536b3..f6113686 100644 --- a/src/monitor/pkg/controller/resourcebundlestate/ingress_controller.go +++ b/src/monitor/pkg/controller/resourcebundlestate/ingress_controller.go @@ -168,6 +168,7 @@ func (r *ingressReconciler) updateSingleCR(cr *v1alpha1.ResourceBundleState, ing // Add it to CR cr.Status.IngressStatuses = append(cr.Status.IngressStatuses, v1beta1.Ingress{ + TypeMeta: ing.TypeMeta, ObjectMeta: ing.ObjectMeta, Status: ing.Status, }) diff --git a/src/monitor/pkg/controller/resourcebundlestate/job_controller.go b/src/monitor/pkg/controller/resourcebundlestate/job_controller.go index cd76e66f..63bd9535 100644 --- a/src/monitor/pkg/controller/resourcebundlestate/job_controller.go +++ b/src/monitor/pkg/controller/resourcebundlestate/job_controller.go @@ -168,6 +168,7 @@ func (r *jobReconciler) updateSingleCR(cr *v1alpha1.ResourceBundleState, job *v1 // Add it to CR cr.Status.JobStatuses = append(cr.Status.JobStatuses, v1.Job{ + TypeMeta: job.TypeMeta, ObjectMeta: job.ObjectMeta, Status: job.Status, }) diff --git a/src/monitor/pkg/controller/resourcebundlestate/pod_controller.go b/src/monitor/pkg/controller/resourcebundlestate/pod_controller.go index 65a324db..0f7ce47e 100644 --- a/src/monitor/pkg/controller/resourcebundlestate/pod_controller.go +++ b/src/monitor/pkg/controller/resourcebundlestate/pod_controller.go @@ -136,7 +136,7 @@ func (r *podReconciler) deleteFromSingleCR(cr *v1alpha1.ResourceBundleState, nam if rstatus.Name == name { //Delete that status from the array cr.Status.PodStatuses[i] = cr.Status.PodStatuses[length-1] - cr.Status.PodStatuses[length-1] = v1alpha1.PodStatus{} + cr.Status.PodStatuses[length-1] = corev1.Pod{} cr.Status.PodStatuses = cr.Status.PodStatuses[:length-1] return nil } @@ -167,9 +167,9 @@ func (r *podReconciler) updateSingleCR(cr *v1alpha1.ResourceBundleState, pod *co cr.Status.ResourceCount++ // Add it to CR - cr.Status.PodStatuses = append(cr.Status.PodStatuses, v1alpha1.PodStatus{ + cr.Status.PodStatuses = append(cr.Status.PodStatuses, corev1.Pod{ + TypeMeta: pod.TypeMeta, ObjectMeta: pod.ObjectMeta, - Ready: false, Status: pod.Status, }) diff --git a/src/monitor/pkg/controller/resourcebundlestate/secret_controller.go b/src/monitor/pkg/controller/resourcebundlestate/secret_controller.go index fe70d53f..0540b687 100644 --- a/src/monitor/pkg/controller/resourcebundlestate/secret_controller.go +++ b/src/monitor/pkg/controller/resourcebundlestate/secret_controller.go @@ -166,6 +166,7 @@ func (r *secretReconciler) updateSingleCR(cr *v1alpha1.ResourceBundleState, sec // Add it to CR cr.Status.SecretStatuses = append(cr.Status.SecretStatuses, corev1.Secret{ + TypeMeta: sec.TypeMeta, ObjectMeta: sec.ObjectMeta, }) diff --git a/src/monitor/pkg/controller/resourcebundlestate/service_controller.go b/src/monitor/pkg/controller/resourcebundlestate/service_controller.go index d1bb2fd6..80bde3b6 100644 --- a/src/monitor/pkg/controller/resourcebundlestate/service_controller.go +++ b/src/monitor/pkg/controller/resourcebundlestate/service_controller.go @@ -168,6 +168,7 @@ func (r *serviceReconciler) updateSingleCR(cr *v1alpha1.ResourceBundleState, svc // Add it to CR cr.Status.ServiceStatuses = append(cr.Status.ServiceStatuses, corev1.Service{ + TypeMeta: svc.TypeMeta, ObjectMeta: svc.ObjectMeta, Status: svc.Status, }) diff --git a/src/monitor/pkg/controller/resourcebundlestate/statefulSet_controller.go b/src/monitor/pkg/controller/resourcebundlestate/statefulSet_controller.go index ebe61dba..c6183d08 100644 --- a/src/monitor/pkg/controller/resourcebundlestate/statefulSet_controller.go +++ b/src/monitor/pkg/controller/resourcebundlestate/statefulSet_controller.go @@ -168,6 +168,7 @@ func (r *statefulSetReconciler) updateSingleCR(cr *v1alpha1.ResourceBundleState, // Add it to CR cr.Status.StatefulSetStatuses = append(cr.Status.StatefulSetStatuses, appsv1.StatefulSet{ + TypeMeta: sfs.TypeMeta, ObjectMeta: sfs.ObjectMeta, Status: sfs.Status, }) |