问题描述
我有一个命名空间列表,我想删除它们,但是其中一些出现了错误,我想跳过那些命名空间并继续其他删除操作。我该怎么办?
<?PHP
$count = 0;
while ( have_rows('video') ) : the_row(); ?>
<div class="col-lg-4 col-md-6 mt-3 mt-lg-5">
<div class="d-flex flex-column h-100 px-3">
<div data-toggle="modal" data-target="#videoModal<?PHP echo $count?>" id="videoBtn<?PHP echo $count?>">
<img src="<?PHP echo get_sub_field('video_thumbnail') ?> " width="100%" style="height: 240px;object-fit: cover;">
</div>
<div class="py-3 h-100 d-flex flex-column align-items-start">
<h4 class="text-heavy">
<?PHP echo get_sub_field('title') ?>
</h4>
<p>
<?PHP echo get_sub_field('content') ?>
</p>
</div>
</div>
</div>
<!--Video Modal -->
<div class="modal fade" id="videoModal<?PHP echo $count?>" role="dialog" aria-labelledby="videoModal<?PHP echo $count?>Label" aria-hidden="true" >
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-body p-3 position-relative">
<div type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true" class="text-white">×</span>
</div>
<video id="htmlVideo<?PHP echo $count?>" width="100%" controls style="z-index:5">
<source src="<?PHP echo get_sub_field('video')?>" type="video/mp4">
</video>
<script>
var container = $("#htmlVideo<?PHP echo $count?>");
var myVideo=document.getElementById('htmlVideo' + <?PHP echo $count?>);
$(document).ready(function(){
$("#videoBtn<?PHP echo $count?>").click(function(){
console.log(myVideo);
myVideo.play();
});
$("#videoModal<?PHP echo $count?>").click(function(e)
{
// if the target of the click isn't the container nor a descendant of the container
if (!container.is(e.target) && container.has(e.target).length === 0)
{
myVideo.pause();
}
});
});
</script>
</div>
</div>
</div>
</div>
<?PHP
$count++;
endwhile;
?>
解决方法
您可以尝试在命令中使用--ignore-not-found=true
标志
kubectl delete deployments --ignore-not-found=true -n ${namespace} --all --grace-period=10