12d2ee6f26
This patch supports to create function version. - Versioning feature is only allowed for package type function for now - New version creation code should be wrapped in lock to avoid any race condition - New version number is calculated by Qinling and no need to be provided by end users - Version creation is not allowed if no change happened to function package. - Only function owner can create version. - Maximum version number is 10 by default, we will make it configurable as needed in future. - All function versions will be deleted when function itself is deleted This patch only focuses on version creation, the other version operations and related function operations will be handled in the following patches. Story: #2001829 Task: #14305 Change-Id: I62bb344da237766fc11cce2ffda65945313136b1
29 lines
959 B
Python
29 lines
959 B
Python
# Copyright 2017 Catalyst IT Limited
|
|
#
|
|
# 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.
|
|
CURRENT_VERSION = 'v1'
|
|
|
|
EXECUTION_BY_JOB = 'Created by Job %s'
|
|
EXECUTION_BY_WEBHOOK = 'Created by Webhook %s'
|
|
|
|
PERIODIC_JOB_HANDLER = 'job_handler'
|
|
PERIODIC_FUNC_MAPPING_HANDLER = 'function_mapping_handler'
|
|
|
|
PACKAGE_FUNCTION = 'package'
|
|
SWIFT_FUNCTION = 'swift'
|
|
IMAGE_FUNCTION = 'image'
|
|
|
|
MAX_PACKAGE_SIZE = 51 * 1024 * 1024
|
|
|
|
MAX_VERSION_NUMBER = 10
|