summaryrefslogtreecommitdiffstats
path: root/vnfs
diff options
context:
space:
mode:
authorDileep Ranganathan <dileep.ranganathan@intel.com>2019-08-10 16:53:06 -0700
committerDileep Ranganathan <dileep.ranganathan@intel.com>2019-08-12 10:51:22 -0700
commit6bae7d6e0110dcb57cd48e813d1dbaf4fe1c9293 (patch)
treea729a934892c88004da42315da27f58e788582ce /vnfs
parentebc40b61c64d5f06b5fe2b4d886ed4e5748db6d3 (diff)
Upgraded Daemonset apiversion to apps/v1
Upgraded Daemonset apiversion to apps/v1 Issue-ID: ONAPARC-461 Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com> Change-Id: I6cf5d355808fb0c86bfb469018ae570c6f7465f7
Diffstat (limited to 'vnfs')
-rw-r--r--vnfs/DAaaS/microservices/collectd-operator/pkg/controller/collectdglobal/collectdglobal_controller.go5
-rw-r--r--vnfs/DAaaS/microservices/collectd-operator/pkg/controller/collectdplugin/collectdplugin_controller.go3
-rw-r--r--vnfs/DAaaS/microservices/collectd-operator/pkg/controller/utils/collectdutils.go6
-rw-r--r--vnfs/DAaaS/microservices/collectd-operator/pkg/controller/utils/dsutils.go6
4 files changed, 9 insertions, 11 deletions
diff --git a/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/collectdglobal/collectdglobal_controller.go b/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/collectdglobal/collectdglobal_controller.go
index 539b680d..0c4064e7 100644
--- a/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/collectdglobal/collectdglobal_controller.go
+++ b/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/collectdglobal/collectdglobal_controller.go
@@ -16,7 +16,6 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
- extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
@@ -191,7 +190,7 @@ func (r *ReconcileCollectdGlobal) handleCollectdGlobal(reqLogger logr.Logger, cr
// Retrieve the latest version of Daemonset before attempting update
// RetryOnConflict uses exponential backoff to avoid exhausting the apiserver
// Select DaemonSets with label
- dsList := &extensionsv1beta1.DaemonSetList{}
+ dsList := &appsv1.DaemonSetList{}
opts := &client.ListOptions{}
labelSelector, err := collectdutils.GetWatchLabels()
if err != nil {
@@ -312,7 +311,7 @@ func (r *ReconcileCollectdGlobal) addFinalizer(reqLogger logr.Logger, cr *onapv1
return nil
}
-func (r *ReconcileCollectdGlobal) handleTypesDB(reqLogger logr.Logger, cr *onapv1alpha1.CollectdGlobal, ds *extensionsv1beta1.DaemonSet, isDelete bool) error {
+func (r *ReconcileCollectdGlobal) handleTypesDB(reqLogger logr.Logger, cr *onapv1alpha1.CollectdGlobal, ds *appsv1.DaemonSet, isDelete bool) error {
if isDelete || cr.Spec.ConfigMap == "" {
dsutils.RemoveTypesDB(ds)
return nil
diff --git a/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/collectdplugin/collectdplugin_controller.go b/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/collectdplugin/collectdplugin_controller.go
index 98d770a1..9329c55e 100644
--- a/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/collectdplugin/collectdplugin_controller.go
+++ b/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/collectdplugin/collectdplugin_controller.go
@@ -14,7 +14,6 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
- extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/util/retry"
@@ -185,7 +184,7 @@ func (r *ReconcileCollectdPlugin) handleCollectdPlugin(reqLogger logr.Logger, cr
// Retrieve the latest version of Daemonset before attempting update
// RetryOnConflict uses exponential backoff to avoid exhausting the apiserver
// Select DaemonSets with label
- dsList := &extensionsv1beta1.DaemonSetList{}
+ dsList := &appsv1.DaemonSetList{}
opts := &client.ListOptions{}
labelSelector, err := collectdutils.GetWatchLabels()
if err != nil {
diff --git a/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/utils/collectdutils.go b/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/utils/collectdutils.go
index 0b3cf3fd..95604835 100644
--- a/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/utils/collectdutils.go
+++ b/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/utils/collectdutils.go
@@ -11,8 +11,8 @@ import (
onapv1alpha1 "collectd-operator/pkg/apis/onap/v1alpha1"
+ appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
- extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
"sigs.k8s.io/controller-runtime/pkg/client"
)
@@ -33,7 +33,7 @@ var lock sync.Mutex
// ResourceMap to hold objects to update/reload
type ResourceMap struct {
ConfigMap *corev1.ConfigMap
- DaemonSet *extensionsv1beta1.DaemonSet
+ DaemonSet *appsv1.DaemonSet
CollectdPlugins *[]onapv1alpha1.CollectdPlugin
}
@@ -98,7 +98,7 @@ func FindResourceMapForCR(rc client.Client, reqLogger logr.Logger, ns string) (*
}
// Select DaemonSets with label
- dsList := &extensionsv1beta1.DaemonSetList{}
+ dsList := &appsv1.DaemonSetList{}
err = rc.List(context.TODO(), opts, dsList)
if err != nil {
return rmap, err
diff --git a/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/utils/dsutils.go b/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/utils/dsutils.go
index d6c60cce..d52a68ce 100644
--- a/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/utils/dsutils.go
+++ b/vnfs/DAaaS/microservices/collectd-operator/pkg/controller/utils/dsutils.go
@@ -7,8 +7,8 @@ import (
onapv1alpha1 "collectd-operator/pkg/apis/onap/v1alpha1"
+ appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
- extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
)
@@ -24,7 +24,7 @@ const (
)
// RemoveTypesDB - removes TypesDB volumes and volume mounts from collectd pods.
-func RemoveTypesDB(ds *extensionsv1beta1.DaemonSet) {
+func RemoveTypesDB(ds *appsv1.DaemonSet) {
vols := &ds.Spec.Template.Spec.Volumes
for i:=0; i < len(*vols); i++ {
if (*vols)[i].Name == typesDB {
@@ -48,7 +48,7 @@ func RemoveTypesDB(ds *extensionsv1beta1.DaemonSet) {
}
// UpsertTypesDB - Insert/Update TypesDB volumes and volume mounts to collectd pods.
-func UpsertTypesDB(ds *extensionsv1beta1.DaemonSet, cm *corev1.ConfigMap, cr *onapv1alpha1.CollectdGlobal) {
+func UpsertTypesDB(ds *appsv1.DaemonSet, cm *corev1.ConfigMap, cr *onapv1alpha1.CollectdGlobal) {
typesVM := findMountInfo(cr)
if *typesVM == nil || len(*typesVM) == 0 {
return