mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 23:09:41 +02:00
fix(kubernetes): deprecate old configurations api EE-5571 (#10837)
* fix(kubernetes): deprecate old configurations api EE-5571 * fix doc variable type
This commit is contained in:
parent
0b9407f0a6
commit
0ddf84638f
3 changed files with 26 additions and 59 deletions
|
@ -4,7 +4,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|||
import { debounce } from 'lodash';
|
||||
|
||||
import { useEnvironmentId } from '@/react/hooks/useEnvironmentId';
|
||||
import { useConfigurations } from '@/react/kubernetes/configs/queries';
|
||||
import { useSecrets } from '@/react/kubernetes/configs/secret.service';
|
||||
import { useNamespaceServices } from '@/react/kubernetes/networks/services/queries';
|
||||
import { notifyError, notifySuccess } from '@/portainer/services/notifications';
|
||||
import { useAuthorizations } from '@/react/hooks/useUser';
|
||||
|
@ -68,7 +68,7 @@ export function CreateIngressView() {
|
|||
useNamespacesQuery(environmentId);
|
||||
|
||||
const { data: allServices } = useNamespaceServices(environmentId, namespace);
|
||||
const configResults = useConfigurations(environmentId, namespace);
|
||||
const secretsResults = useSecrets(environmentId, namespace);
|
||||
const ingressesResults = useIngresses(
|
||||
environmentId,
|
||||
namespaces ? Object.keys(namespaces || {}) : []
|
||||
|
@ -266,20 +266,20 @@ export function CreateIngressView() {
|
|||
ingressRule.IngressClassName,
|
||||
]);
|
||||
|
||||
const matchedConfigs = configResults?.data?.filter(
|
||||
const secrets = secretsResults?.data?.filter(
|
||||
(config) =>
|
||||
config.SecretType === 'kubernetes.io/tls' &&
|
||||
config.Namespace === namespace
|
||||
config.type === 'kubernetes.io/tls' &&
|
||||
config.metadata?.namespace === namespace
|
||||
);
|
||||
const tlsOptions: Option<string>[] = useMemo(
|
||||
() => [
|
||||
{ label: 'No TLS', value: '' },
|
||||
...(matchedConfigs?.map((config) => ({
|
||||
label: config.Name,
|
||||
value: config.Name,
|
||||
...(secrets?.map((config) => ({
|
||||
label: config.metadata?.name as string,
|
||||
value: config.metadata?.name as string,
|
||||
})) || []),
|
||||
],
|
||||
[matchedConfigs]
|
||||
[secrets]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -811,7 +811,7 @@ export function CreateIngressView() {
|
|||
}
|
||||
|
||||
function reloadTLSCerts() {
|
||||
configResults.refetch();
|
||||
secretsResults.refetch();
|
||||
}
|
||||
|
||||
function handleCreateIngressRules() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue