我已经安装了Kubernetes插件,并在class ViewController: UIViewController {
private lazy var panRecognizer: UIPanGestureRecognizer = {
return UIPanGestureRecognizer(target: self, action: #selector(panGestureCalled(_:)))
}()
/// The path that is being drawn (resets on .began, closes on .ended)
private var currentPath: UIBezierPath = .init()
/// All of the layers added to the view
private var shapes: [CAShapeLayer] = []
override func viewDidLoad() {
super.viewDidLoad()
view.addGestureRecognizer(panRecognizer)
}
@objc private func panGestureCalled(_ sender: UIPanGestureRecognizer) {
let point = sender.location(in: self.view)
switch sender.state {
case .began:
// Reset the path
currentPath = .init()
// Set the starting point
currentPath.move(to: point)
// Creates a new layer when gesture starts.
let layer = newShapeLayer()
// Save the layer with all shapes.
shapes.append(layer)
// Add the layer to the view
view.layer.addSublayer(layer)
case .changed:
// Update the current path to the new point
currentPath.addLine(to: point)
case .ended:
// Close/Finish the path
currentPath.close()
default:
break
}
// Update the most-current shape with the path being drawn.
shapes.last?.path = currentPath.cgPath
}
/// Creates a new `CAShapeLayer`
private func newShapeLayer() -> CAShapeLayer {
let layer = CAShapeLayer()
layer.frame = view.bounds
layer.strokeColor = UIColor.blue.cgColor
layer.lineWidth = 2.0
return layer
}
}
中添加了2个kubernetes从属节点。
然后添加作业时,我看不到配置目标环境的位置。根本没有标签,例如在这里看到的:
这是我的工作配置的外观: