Upgraded Daemonset apiversion to apps/v1
Issue-ID: ONAPARC-461
Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
Change-Id: I6cf5d355808fb0c86bfb469018ae570c6f7465f7
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
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"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
// Retrieve the latest version of Daemonset before attempting update
// RetryOnConflict uses exponential backoff to avoid exhausting the apiserver
// Select DaemonSets with label
// 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 {
opts := &client.ListOptions{}
labelSelector, err := collectdutils.GetWatchLabels()
if err != 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
if isDelete || cr.Spec.ConfigMap == "" {
dsutils.RemoveTypesDB(ds)
return nil
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
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"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/util/retry"
// Retrieve the latest version of Daemonset before attempting update
// RetryOnConflict uses exponential backoff to avoid exhausting the apiserver
// Select DaemonSets with label
// 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 {
opts := &client.ListOptions{}
labelSelector, err := collectdutils.GetWatchLabels()
if err != nil {
onapv1alpha1 "collectd-operator/pkg/apis/onap/v1alpha1"
onapv1alpha1 "collectd-operator/pkg/apis/onap/v1alpha1"
+ appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/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"
)
"k8s.io/apimachinery/pkg/api/errors"
"sigs.k8s.io/controller-runtime/pkg/client"
)
// ResourceMap to hold objects to update/reload
type ResourceMap struct {
ConfigMap *corev1.ConfigMap
// ResourceMap to hold objects to update/reload
type ResourceMap struct {
ConfigMap *corev1.ConfigMap
- DaemonSet *extensionsv1beta1.DaemonSet
+ DaemonSet *appsv1.DaemonSet
CollectdPlugins *[]onapv1alpha1.CollectdPlugin
}
CollectdPlugins *[]onapv1alpha1.CollectdPlugin
}
}
// Select DaemonSets with label
}
// Select DaemonSets with label
- dsList := &extensionsv1beta1.DaemonSetList{}
+ dsList := &appsv1.DaemonSetList{}
err = rc.List(context.TODO(), opts, dsList)
if err != nil {
return rmap, err
err = rc.List(context.TODO(), opts, dsList)
if err != nil {
return rmap, err
onapv1alpha1 "collectd-operator/pkg/apis/onap/v1alpha1"
onapv1alpha1 "collectd-operator/pkg/apis/onap/v1alpha1"
+ appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
corev1 "k8s.io/api/core/v1"
- extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
)
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
)
)
// RemoveTypesDB - removes TypesDB volumes and volume mounts from collectd pods.
)
// 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 {
vols := &ds.Spec.Template.Spec.Volumes
for i:=0; i < len(*vols); i++ {
if (*vols)[i].Name == typesDB {
}
// UpsertTypesDB - Insert/Update TypesDB volumes and volume mounts to collectd pods.
}
// 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
typesVM := findMountInfo(cr)
if *typesVM == nil || len(*typesVM) == 0 {
return