From d43ce053a3a774f110cde69a0ead3046eb1aa567 Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Date: Thu, 10 Oct 2024 14:57:00 -0400 Subject: [PATCH] Add P0 OOTB connection types --- .../connectionTypes/ConnectionTypesTableRow.tsx | 2 ++ .../manage/EditConnectionTypePage.tsx | 12 ++++++++++++ .../common/connection-types/kustomization.yaml | 6 ++++++ .../oci-compliant-registry-v1.yaml | 14 ++++++++++++++ manifests/common/connection-types/s3.yaml | 14 ++++++++++++++ manifests/common/connection-types/uri-v1.yaml | 14 ++++++++++++++ manifests/common/kustomization.yaml | 1 + 7 files changed, 63 insertions(+) create mode 100644 manifests/common/connection-types/kustomization.yaml create mode 100644 manifests/common/connection-types/oci-compliant-registry-v1.yaml create mode 100644 manifests/common/connection-types/s3.yaml create mode 100644 manifests/common/connection-types/uri-v1.yaml diff --git a/frontend/src/pages/connectionTypes/ConnectionTypesTableRow.tsx b/frontend/src/pages/connectionTypes/ConnectionTypesTableRow.tsx index fcafc629c2..c65451de43 100644 --- a/frontend/src/pages/connectionTypes/ConnectionTypesTableRow.tsx +++ b/frontend/src/pages/connectionTypes/ConnectionTypesTableRow.tsx @@ -152,6 +152,7 @@ const ConnectionTypesTableRow: React.FC = ({ { title: 'Edit', onClick: () => navigate(`/connectionTypes/edit/${obj.metadata.name}`), + isDisabled: ownedByDSC(obj), }, { title: 'Duplicate', @@ -160,6 +161,7 @@ const ConnectionTypesTableRow: React.FC = ({ { title: 'Delete', onClick: () => handleDelete(obj), + isDisabled: ownedByDSC(obj), }, ]} /> diff --git a/frontend/src/pages/connectionTypes/manage/EditConnectionTypePage.tsx b/frontend/src/pages/connectionTypes/manage/EditConnectionTypePage.tsx index d70ace605c..be1baa34ad 100644 --- a/frontend/src/pages/connectionTypes/manage/EditConnectionTypePage.tsx +++ b/frontend/src/pages/connectionTypes/manage/EditConnectionTypePage.tsx @@ -3,12 +3,24 @@ import { useParams } from 'react-router'; import ApplicationsPage from '~/pages/ApplicationsPage'; import { useConnectionType } from '~/concepts/connectionTypes/useConnectionType'; import { updateConnectionType } from '~/services/connectionTypesService'; +import { ownedByDSC } from '~/concepts/k8s/utils'; import ManageConnectionTypePage from './ManageConnectionTypePage'; const EditConnectionTypePage: React.FC = () => { const { name } = useParams(); const [existingConnectionType, isLoaded, error] = useConnectionType(name); + if (existingConnectionType && ownedByDSC(existingConnectionType)) { + return ( + + ); + } + if (!isLoaded || error) { return ; } diff --git a/manifests/common/connection-types/kustomization.yaml b/manifests/common/connection-types/kustomization.yaml new file mode 100644 index 0000000000..1b341f5c81 --- /dev/null +++ b/manifests/common/connection-types/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./oci-compliant-registry-v1.yaml + - ./s3.yaml + - ./uri-v1.yaml diff --git a/manifests/common/connection-types/oci-compliant-registry-v1.yaml b/manifests/common/connection-types/oci-compliant-registry-v1.yaml new file mode 100644 index 0000000000..016f4226fd --- /dev/null +++ b/manifests/common/connection-types/oci-compliant-registry-v1.yaml @@ -0,0 +1,14 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: oci-compliant-registry-v1 + labels: + opendatahub.io/connection-type: 'true' + opendatahub.io/dashboard: 'true' + annotations: + opendatahub.io/enabled: 'true' + openshift.io/description: 'Connect to an OCI-compliant container registry, enabling integration with containerized applications and services. Use this connection type to pull and manage container images and artifacts that adhere to the Open Container Initiative (OCI) standards, ensuring compatibility with OCI-compliant tools and workflows.' + openshift.io/display-name: OCI compliant registry - v1 +data: + category: '["URI"]' + fields: '[{"type":"uri","name":"URI","envVar":"URI","required":true,"properties":{}}]' diff --git a/manifests/common/connection-types/s3.yaml b/manifests/common/connection-types/s3.yaml new file mode 100644 index 0000000000..900d0dc62f --- /dev/null +++ b/manifests/common/connection-types/s3.yaml @@ -0,0 +1,14 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: s3 + labels: + opendatahub.io/connection-type: 'true' + opendatahub.io/dashboard: 'true' + annotations: + opendatahub.io/enabled: 'true' + openshift.io/description: 'Connect to storage systems that are compatible with Amazon S3, enabling integration with other S3-compatible services and applications.' + openshift.io/display-name: S3 compatible object storage - v1 +data: + category: '["Object storage"]' + fields: '[{"type":"short-text","name":"Access key","envVar":"AWS_ACCESS_KEY_ID","properties":{},"required":true},{"type":"hidden","name":"Secret key","envVar":"AWS_SECRET_ACCESS_KEY","required":true,"properties":{}},{"type":"short-text","name":"Endpoint","envVar":"AWS_S3_ENDPOINT","required":true,"properties":{}},{"type":"short-text","name":"Region","envVar":"AWS_DEFAULT_REGION","required":false,"properties":{}},{"type":"short-text","name":"Bucket","envVar":"AWS_S3_BUCKET","required":false,"properties":{}},{"type":"short-text","name":"Path","envVar":"AWS_S3_PATH","properties":{}}]' diff --git a/manifests/common/connection-types/uri-v1.yaml b/manifests/common/connection-types/uri-v1.yaml new file mode 100644 index 0000000000..8bd2f15526 --- /dev/null +++ b/manifests/common/connection-types/uri-v1.yaml @@ -0,0 +1,14 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: uri-v1 + labels: + opendatahub.io/connection-type: 'true' + opendatahub.io/dashboard: 'true' + annotations: + opendatahub.io/enabled: 'true' + openshift.io/description: Establish connections by using Uniform Resource Identifiers (URIs) to access various data sources. + openshift.io/display-name: URI - v1 +data: + category: '["URI"]' + fields: '[{"type":"uri","name":"URI","envVar":"URI","required":true,"properties":{}}]' diff --git a/manifests/common/kustomization.yaml b/manifests/common/kustomization.yaml index 1ed46d1a44..401198db95 100644 --- a/manifests/common/kustomization.yaml +++ b/manifests/common/kustomization.yaml @@ -3,3 +3,4 @@ kind: Kustomization resources: - ./crd - ./apps + - ./connection-types