GetClusterWideProxy returns cluster wide proxy object setup in OCP
(ctx context.Context)
| 227 | |
| 228 | // GetClusterWideProxy returns cluster wide proxy object setup in OCP |
| 229 | func GetClusterWideProxy(ctx context.Context) (*apiconfigv1.Proxy, error) { |
| 230 | cfg := config.GetConfigOrDie() |
| 231 | client, err := configv1.NewForConfig(cfg) |
| 232 | if err != nil { |
| 233 | return nil, err |
| 234 | } |
| 235 | |
| 236 | proxy, err := client.Proxies().Get(ctx, "cluster", metav1.GetOptions{}) |
| 237 | if err != nil { |
| 238 | return nil, err |
| 239 | } |
| 240 | return proxy, nil |
| 241 | } |
| 242 | |
| 243 | func hasMIGConfigLabel(labels map[string]string) bool { |
| 244 | if _, ok := labels[migConfigLabelKey]; ok { |
no test coverage detected