non-oss/pharos_pro/addons/kontena-storage/addon.rb
# Remove old ceph mgr replica sets
#
# @param ceph_version [String]
Remove old ceph mgr replica sets
Remove old ceph mgr replica sets
def remove_old_mgr(ceph_version)
    rs_client = kube_client.api('extensions/v1beta1').resource('replicasets', namespace: 'kontena-storage')
    old_replicasets = rs_client.list(labelSelector: 'app=rook-ceph-mgr').reject do |rs|
      rs.spec.template.spec.containers.first.image.include?("ceph/ceph:v#{ceph_version}")
    end
    old_replicasets.each do |rs|
      rs_client.delete_resource(rs, propagationPolicy: 'Background')
    end
  end
def remove_old_mgr ( ceph_version ) rs_client = kube_client . api ( 'extensions/v1beta1' ) . resource ( 'replicasets' , namespace : 'kontena-storage' ) old_replicasets = rs_client . list ( labelSelector : 'app=rook-ceph-mgr' ) . reject do | rs | rs . spec . template . spec . containers . first . image . include? ( "ceph/ceph:v#{ceph_version}" ) end old_replicasets . each do | rs | rs_client . delete_resource ( rs , propagationPolicy : 'Background' ) end end
Remove old ceph mgr replica sets
Remove old ceph mgr replica sets
ceph_version
None