You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/kubernetes/views/summary/resources/configurationResources.js

18 lines
776 B

import { KubernetesResourceTypes, KubernetesResourceActions } from 'Kubernetes/models/resource-types/models';
import { KubernetesConfigurationKinds } from 'Kubernetes/models/configuration/models';
const { CREATE, UPDATE } = KubernetesResourceActions;
export default function (formValues) {
const action = formValues.Id ? UPDATE : CREATE;
if (formValues.Kind === KubernetesConfigurationKinds.CONFIGMAP) {
return [{ action, kind: KubernetesResourceTypes.CONFIGMAP, name: formValues.Name }];
} else if (formValues.Kind === KubernetesConfigurationKinds.SECRET) {
let type = formValues.Type;
if (formValues.customType) {
type = formValues.customType;
}
return [{ action, kind: KubernetesResourceTypes.SECRET, name: formValues.Name, type }];
}
}