From 703d305a4534a431f5441192e15647367234d1e8 Mon Sep 17 00:00:00 2001 From: Ruben Vallejo Date: Thu, 12 Jan 2023 16:59:54 -0500 Subject: [PATCH] Add deprecation tag to k8s annotation in catalog and add new k8s annotations in plugin-kubernetes-common Signed-off-by: Ruben Vallejo --- .../catalog-model/src/entity/constants.ts | 3 + .../src/catalog-entity-constants.ts | 78 +++++++++++++++++++ plugins/kubernetes-common/src/index.ts | 1 + 3 files changed, 82 insertions(+) create mode 100644 plugins/kubernetes-common/src/catalog-entity-constants.ts diff --git a/packages/catalog-model/src/entity/constants.ts b/packages/catalog-model/src/entity/constants.ts index ac9e813394..729cb87aee 100644 --- a/packages/catalog-model/src/entity/constants.ts +++ b/packages/catalog-model/src/entity/constants.ts @@ -38,6 +38,7 @@ export const ANNOTATION_EDIT_URL = 'backstage.io/edit-url'; /** * Annotation for specifying the API server of a Kubernetes cluster * + * @deprecated Import this constant from `@backstage/plugin-kubernetes-common` instead * @public */ export const ANNOTATION_KUBERNETES_API_SERVER = 'kubernetes.io/api-server'; @@ -45,6 +46,7 @@ export const ANNOTATION_KUBERNETES_API_SERVER = 'kubernetes.io/api-server'; /** * Annotation for specifying the Certificate Authority of an API server for a Kubernetes cluster * + * @deprecated Import this constant from `@backstage/plugin-kubernetes-common` instead * @public */ export const ANNOTATION_KUBERNETES_API_SERVER_CA = @@ -53,6 +55,7 @@ export const ANNOTATION_KUBERNETES_API_SERVER_CA = /** * Annotation for specifying the auth provider for a Kubernetes cluster * + * @deprecated Import this constant from `@backstage/plugin-kubernetes-common` instead * @public */ export const ANNOTATION_KUBERNETES_AUTH_PROVIDER = diff --git a/plugins/kubernetes-common/src/catalog-entity-constants.ts b/plugins/kubernetes-common/src/catalog-entity-constants.ts new file mode 100644 index 0000000000..a1a1996777 --- /dev/null +++ b/plugins/kubernetes-common/src/catalog-entity-constants.ts @@ -0,0 +1,78 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Annotation for specifying the API server of a Kubernetes cluster + * + * @public + */ +export const ANNOTATION_KUBERNETES_API_SERVER = 'kubernetes.io/api-server'; + +/** + * Annotation for specifying the Certificate Authority of an API server for a Kubernetes cluster + * + * @public + */ +export const ANNOTATION_KUBERNETES_API_SERVER_CA = + 'kubernetes.io/api-server-certificate-authority'; + +/** + * Annotation for specifying the auth provider for a Kubernetes cluster + * + * @public + */ +export const ANNOTATION_KUBERNETES_AUTH_PROVIDER = + 'kubernetes.io/auth-provider'; + +/** + * Annotation for specifying the oidc provider used to get id tokens for a Kubernetes cluster + * + * @public + */ +export const ANNOTATION_KUBERNETES_OIDC_TOKEN_PROVIDER = + 'kubernetes.io/oidc-token-provider'; + +/** + * Annotation for specifying boolean value for skip metric lookup. + * + * @public + */ +export const ANNOTATION_KUBERNETES_SKIP_METRICS_LOOKUP = + 'kubernetes.io/skip-metrics-lookup'; + +/** + * Annotation for specifying boolean value for skip tls verify. + * + * @public + */ +export const ANNOTATION_KUBERNETES_SKIP_TLS_VERIFY = + 'kubernetes.io/skip-tls-verify'; + +/** + * Annotation for specifying the dashboard url for a Kubernetes cluster. + * + * @public + */ +export const ANNOTATION_KUBERNETES_DASHBOARD_URL = + 'kubernetes.io/dashboard-url'; + +/** + * Annotation for specifying the dashboard app for a Kubernetes cluster. + * + * @public + */ +export const ANNOTATION_KUBERNETES_DASHBOARD_APP = + 'kubernetes.io/dashboard-app'; diff --git a/plugins/kubernetes-common/src/index.ts b/plugins/kubernetes-common/src/index.ts index 6b97c0eb7d..ade73e4f79 100644 --- a/plugins/kubernetes-common/src/index.ts +++ b/plugins/kubernetes-common/src/index.ts @@ -21,3 +21,4 @@ */ export * from './types'; +export * from './catalog-entity-constants';