// SPDX-License-Identifier: Apache-2.0
import { SoloError } from '../../../core/errors/solo-error.js';
const RFC_1123_POSTFIX = (prefix) => `${prefix} is invalid, must be a valid RFC-1123 DNS label.  \` +
    "A DNS 1123 label must consist of lower case alphanumeric characters, '-' " +
    "or '.', must not exceed 63 characters, and must start and end with an alphanumeric character.`;
export class InvalidResourceNameError extends SoloError {
    static RESOURCE_NAME_INVALID = (type, name) => RFC_1123_POSTFIX(`${type} name '${name}'`);
    /**
     * Instantiates a new error with a message and an optional cause.
     *
     * @param name - the invalid pod name.
     * @param type - the type of the resource.
     * @param cause - optional underlying cause of the error.
     * @param meta - optional metadata to be reported.
     */
    constructor(name, type, cause = {}, meta = {}) {
        super(InvalidResourceNameError.RESOURCE_NAME_INVALID(type, name), cause, meta);
    }
}
//# sourceMappingURL=invalid-resource-name-error.js.map