Skip to content

Fix and migrate missing clipboard buttons on Kubernetes cluster

What does this MR do and why?

The Copy to clipboard buttons were not properly rendering in a read-only state. They also were using a deprecated style and needed to be migrated.

Screenshots or screen recordings

Before After
CleanShot_2023-10-13_at_14.17.00_2x CleanShot_2023-10-13_at_14.18.05_2x
Field Default Mouse hover :hover :focus :active
Kubernetes cluster name CleanShot 2023-10-13 at 14.26.56@2x.png CleanShot_2023-10-13_at_14.22.57_2x CleanShot_2023-10-13_at_14.23.21_2x CleanShot_2023-10-13_at_14.23.23_2x CleanShot_2023-10-13_at_14.23.26_2x
API URL CleanShot 2023-10-13 at 14.29.25@2x.png CleanShot 2023-10-13 at 14.29.14@2x.png CleanShot 2023-10-13 at 14.29.33@2x.png CleanShot 2023-10-13 at 14.29.35@2x.png CleanShot 2023-10-13 at 14.29.36@2x.png
CA Cert CleanShot 2023-10-13 at 14.30.37@2x.png CleanShot 2023-10-13 at 14.30.27@2x.png CleanShot 2023-10-13 at 14.31.17@2x.png CleanShot 2023-10-13 at 14.30.57@2x.png CleanShot 2023-10-13 at 14.30.59@2x.png

How to set up and validate locally

  1. Turn on the feature flag for Kubernetes certificate clusters
echo "Feature.enable(:certificate_based_clusters)" | rails c
  1. Add a Kubernetes certificate cluster to any project. You should be able to leave CA Certificate blank, but if that doesn't work then in the model comment it out.

CleanShot 2023-10-13 at 14.34.17@2x.png

  1. After creating click on the name of the cluster in the list to go to the edit page.
  2. Turn the edit page into a read-only state. Easiest was is to remove the ! from line 56 in app/presenters/clusters/cluster_presenter.rb
- !cluster.provided_by_user?
+ cluster.provided_by_user?

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #417811 (closed)

Edited by Austin Regnery

Merge request reports