An application version rollback method, device, equipment and medium
By adding a new hook type to Kubernetes applications, resources can be hooked before and after a rollback in the current version. This solves the problem of low rollback success rate in package management tools, improves the rollback success rate, reduces the rollback difficulty, and is suitable for version management of Kubernetes applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-01
- Publication Date
- 2026-03-27
AI Technical Summary
In Kubernetes applications, existing package management tools have a low success rate when rolling back application versions, making it difficult to meet the customized rollback requirements in actual production.
By adding new hook types to the existing hook functionality, application version rollbacks can execute hook resources in the current version, including hook resources before and after the rollback, reducing the difficulty of rollbacks and increasing the success rate.
It enables environment cleanup and configuration operations in Kubernetes applications without having to anticipate future rollback needs, improving rollback success rate and reducing rollback difficulty, thus meeting the usage requirements of actual production environments.
Smart Images

Figure CN113495809B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and in particular, to an application version rollback method and device, an application version rollback apparatus, an application version rollback equipment, and a computer readable storage medium. BACKGROUND
[0002] A traditional application deployment method is to install an application through a plug-in or a script. This deployment method causes the running, configuration, and management of the application to be bound to the current operating system, which is not conducive to the upgrade or rollback of the application. The upgrade or rollback of the application can be achieved by creating a virtual machine, but the portability is poor.
[0003] Therefore, the industry proposes a new application deployment method, kubernetes, referred to as K8s. In K8s, each application is packaged into a container image. Compared with a virtual machine, a container can be quickly deployed. Moreover, the container is decoupled from the underlying facilities and file systems, and thus can be ported between different clouds and different versions of operating systems.
[0004] For K8s applications, the industry provides package management tools to simplify the deployment and management of applications. However, these package management tools often have some problems when performing application version rollback, resulting in a low success rate of rollback. SUMMARY
[0005] The present application provides an application version rollback method. The method provides the ability to execute hook resources of a current version, so that a developer does not need to insert resources required to be executed when rolling back to a version when designing the version, thereby solving the problem of a low success rate of application version rollback in the related art. The present application also provides an apparatus, an equipment, a computer readable storage medium, and a computer program product corresponding to the application version rollback method.
[0006] In a first aspect, the present application provides an application version rollback method. The method adds a new hook type on the basis of an existing hook function, so that hook resources of a current version can be executed when rolling back an application version, thereby solving the customization requirement of rollback in actual production and improving the success rate of rollback.
[0007] Specifically, a version rollback request for a target application is received, and then hook resources of the current version specified by the version rollback request are executed to implement rollback of the target application from the current version to a target version. In this way, when rolling back an application version, if it is necessary to perform operations such as environment cleaning or environment configuration on the current version, the corresponding hook resources are directly embedded in the current version, and the hook resources of the current version are executed when rolling back the application version, without the need for a developer to anticipate resources required to be executed when rolling back a certain version to the target version when designing the target version, thereby reducing the difficulty of rollback and improving the success rate of rollback.
[0008] In some possible implementations, the hook resource of the current version can include a pre-rollback hook resource of the current version. The pre-rollback hook resource of the current version is a resource identified by a pre-rollback-current field. Correspondingly, when the hook resource of the current version specified in the version rollback request is executed, the pre-rollback hook resource of the current version can be executed before the manifest of the main resource is rolled back.
[0009] The main resource is specifically a resource necessary for building an application. For example, in an Android application, the main resource includes all resources in the manifest.
[0010] In some possible implementations, the hook resource of the current version can include a post-rollback hook resource of the current version. The post-rollback hook resource of the current version is a resource identified by a post-rollback-current field. Correspondingly, when the hook resource of the current version specified in the version rollback request is executed, the post-rollback hook resource of the current version can be executed after the manifest of the main resource is rolled back.
[0011] In some possible implementations, the version rollback request can also specify a hook resource of a target version. For example, the version rollback request can specify a pre-rollback hook resource of the target version and / or a post-rollback hook resource of the target version. Correspondingly, when the application version is rolled back, the hook resource of the target version can also be executed after the hook resource of the current version is executed.
[0012] It should be noted that when the version rollback request specifies the pre-rollback hook resource of the target version, the pre-rollback hook resource of the target version is executed before the manifest of the main resource is executed after the pre-rollback hook resource of the current version is executed.
[0013] When the version rollback request specifies the post-rollback hook resource of the target version, the post-rollback hook resource of the target version is executed after the post-rollback hook resource of the current version is executed.
[0014] In some possible implementations, the hook resource can include any one or more of a job, a configuration map, and a secret. For example, an environment configuration job or an environment cleaning job can be specified as the pre-rollback hook resource of the current version or the post-rollback hook resource of the current version.
[0015] In some possible implementation manners, the hook resource of the current version can be identified by a specified field in an annotation. For example, the hook resource of the current version can be identified by a pre-rollback-current field and / or a post-rollback-current field in the annotation.
[0016] In a second aspect, the present application provides an application version rollback apparatus, the apparatus comprising:
[0017] a communication module configured to receive a version rollback request for a target application;
[0018] an execution module configured to execute a hook resource of a current version specified in the version rollback request, so as to implement rollback of the target application from the current version to a target version.
[0019] In some possible implementation manners, the execution module is specifically configured to:
[0020] execute a pre-rollback hook resource of the current version before executing rollback of a main resource, the pre-rollback hook resource of the current version being a resource identified by a pre-rollback-current field.
[0021] In some possible implementation manners, the execution module is specifically configured to:
[0022] execute a post-rollback hook resource of the current version after executing rollback of the main resource, the post-rollback hook resource of the current version being a resource identified by a post-rollback-current field.
[0023] In some possible implementation manners, the execution module is further configured to:
[0024] execute a hook resource of the target version after executing the hook resource of the current version.
[0025] In some possible implementation manners, the hook resource comprises any one or more of a job, a configuration graph and a key.
[0026] In some possible implementation manners, the hook resource of the current version is identified by a specified field in an annotation.
[0027] In a third aspect, the present application provides an apparatus. The apparatus can be a computer device, and the apparatus comprises a processor and a memory. The processor and the memory are in communication with each other. The processor is configured to execute instructions stored in the memory, so that the apparatus performs the application version rollback method in the first aspect or any implementation manner of the first aspect.
[0028] In a fourth aspect, the present application provides a computer readable storage medium. The computer readable storage medium comprises instructions, which instruct a computer to execute the application version rollback method in the first aspect or any implementation manner of the first aspect.
[0029] In a fifth aspect, the present application provides a computer program product comprising instructions which, when executed on a computer, cause the computer to execute the application version rollback method in the first aspect or any implementation manner of the first aspect.
[0030] On the basis of the implementation manners of the aspects provided by the present application, further combinations can be made to provide more implementation manners. BRIEF DESCRIPTION OF DRAWINGS
[0031] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required to be used in the embodiments will be briefly introduced as follows.
[0032] Figure 1 A system architecture diagram of an application version rollback method provided by an embodiment of the present application;
[0033] Figure 2 A flowchart of an application version rollback method provided by an embodiment of the present application;
[0034] Figure 3 A schematic diagram of a designated field provided by an embodiment of the present application;
[0035] Figure 4 A flowchart of an application version rollback method provided by an embodiment of the present application;
[0036] Figure 5 A structural schematic diagram of a device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0037] The schemes in the embodiments provided by the present application will be described below in combination with the drawings in the present application.
[0038] The terms "first", "second", etc. in the specification and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the terms thus used can be interchanged under appropriate circumstances, and this is only a distinguishing manner adopted in the description of the embodiments of the present application for the objects with the same attributes in the description.
[0039] In order to facilitate the understanding of the technical scheme of the present application, some technical terms related to the present application will be introduced as follows.
[0040] A package management tool refers to a tool for deploying, deleting, upgrading, or rolling back an application. Different types of applications have their respective package management tools. For example, a yum tool is provided for a community enterprise operating system (CentOS) application to deploy, delete, upgrade, or roll back the application. For another example, a Helm tool is provided for a Kubernetes application to deploy, delete, upgrade, or roll back the application.
[0041] For ease of understanding, the present application is exemplarily described by Helm. Helm manages an installation package (chart) of an application, where the chart includes resources required for deploying the application. Helm can deploy the chart in a Kubernetes cluster to obtain an instance (release). It should be noted that one chart can have multiple releases on one Kubernetes cluster, that is, the chart can be installed multiple times.
[0042] Helm includes a client and a server. The client is a command line tool, mainly used for creating, packaging, and publishing charts, and creating and managing local chart repositories, remote chart repositories, and the like. The server (tiller) is deployed in a Kubernetes cluster, mainly used for receiving requests from the client, and generating a Kubernetes deployment file (i.e., a release) according to a chart, and then submitting the Kubernetes deployment file to the Kubernetes to create an application. Tiller also provides a series of functions such as upgrading, deleting, and rolling back a release.
[0043] Helm also provides a hook mechanism. The hook mechanism allows chart developers to intervene at certain nodes in the life cycle of a release. Specifically, Helm defines the following hooks for developers or users to use:
[0044] Pre-installation (pre-install): executed before Kubernetes creates any resources after template rendering;
[0045] Post-installation (post-install): executed after all Kubernetes resources are installed to the cluster;
[0046] Pre-deletion (pre-delete): executed before deleting the request from Kubernetes;
[0047] Post-deletion (post-delete): executed after deleting all resources of the release;
[0048] pre-upgrade: executed after template rendering, but before any resource upgrade;
[0049] post-upgrade: executed after all resources are upgraded;
[0050] pre-rollback: executed after template rendering, but before any resource rollback;
[0051] post-rollback: executed after all resources are modified to fulfill the rollback request.
[0052] That is, the hook mechanism allows the hook resources (i.e., the resources marked by hooks, which are executed when the hook event, such as the rollback event, occurs) in the target release to be executed before or after installation, before or after upgrade, before or after rollback, or before or after deletion, thereby providing assistance for installing the target release, upgrading the current release to the target release, rolling back the current release to the target release, or deleting the current release.
[0053] The above hooks mainly act on the target release. For rollback operations, the target release is a historical release before the current release, such as the previous release of the current release, which causes the hook resources in the historical release to be executed when rolling back, that is, the above hook resources need to be embedded in the historical release in advance. However, in actual applications, chart developers cannot predict the resources that need to be executed for subsequent rollback. Therefore, there are often some problems when rolling back the application release, and the success rate of rollback is low.
[0054] Therefore, embodiments of the present application provide an application release rollback method. The method adds a new hook type on the basis of the existing hook function, so that the hook resources can be executed in the current release when rolling back the application release, thereby solving the rollback customization needs in actual production and improving the success rate of rollback. Specifically, the server receives a version rollback request for a target application, and then the server executes the hook resources of the current release specified by the version rollback request to implement rolling back the target application from the current release to a target release.
[0055] Therefore, when rolling back the application release, if it is necessary to perform environment cleaning or environment configuration operations on the current release, the corresponding hook resources are directly embedded in the current release, and the hook resources of the current release are executed, without the need for developers to anticipate in advance the resources that need to be executed when rolling back a certain release to the target release when designing the target release, thereby reducing the difficulty of rollback and improving the success rate of rollback.
[0056] To make the technical solution of this application clearer and easier to understand, the scenario architecture of the application version rollback method provided in the embodiments of this application is described below with reference to the accompanying drawings.
[0057] The application version rollback method provided in this application embodiment includes, but is not limited to, applications such as... Figure 1 In the application scenarios shown. For example... Figure 1 As shown, this application scenario includes device 102 and device 104. Device 102 has a Helm client deployed on it, while device 104 has a Helm server deployed on it. Device 102 can be a user device such as a desktop computer, laptop, or tablet, while device 104 can be a Kubernetes device, specifically a virtualized cloud device.
[0058] Users can trigger an application version rollback operation through the client. In response, the client generates a rollback request for the target application and sends it to the server. This rollback request instructs the target application to be rolled back from its current version to the target version. An application version rollback device 1040 is deployed on the server. This device includes a communication module 1042 and an execution module 1044. The communication module 1042 receives the rollback request, and the execution module 1044 executes the hook resources for the current version specified in the rollback request to roll back the target application from its current version to the target version.
[0059] Next, the application version rollback method provided in this application embodiment will be described in detail from the perspective of the server-side application version rollback device 1040.
[0060] See Figure 2 The flowchart shown illustrates the application version rollback method, which includes:
[0061] S202: Application version rollback device 1040 receives a version rollback request for the target application.
[0062] Specifically, when an application upgrade fails, the user can trigger an application version rollback operation, reverting the application from the current version to a previous version. The application to be rolled back is the target application. It should be noted that the target application can include at least one previous version. When the target application includes multiple previous versions, the user can specify one of those previous versions as the target version.
[0063] In response to the user-triggered application version rollback operation, the client generates a rollback request based on the target application and target version. This rollback request specifically instructs the target application to be rolled back from its current version to the target version.
[0064] It should be noted that the above is an example of application version rollback when application upgrade fails. In other scenarios, for example, to be compatible with some applications or some files, the user can also trigger the application version rollback operation. For another example, the user is not adapted to the use habit of the current version, and can also actively trigger the application version rollback operation.
[0065] S204: The application version rollback device 1040 executes the hook resource of the current version specified by the version rollback request to realize the rollback of the target application from the current version to the target version.
[0066] In order to meet the rollback customization requirements, the package management tool such as helm adds a hook type. The added hook type includes a pre-rollback (pre-rollback) type for the current version and / or a post-rollback type for the current version. Among them, the pre-rollback type for the current version can be identified by a specified field of a pre-rollback-current field, and the post-rollback type for the current version can be identified by a specified field of a post-rollback-current field.
[0067] Based on this, the application version rollback device 1040 can execute the hook resource of the current version according to the specified field in the version rollback request to realize the rollback of the target application from the current version to the target version. Among them, the hook resource can be any type of Kubernetes resource, including any one or more of job, configmap and secret.
[0068] Specifically, when the specified field includes the pre-rollback-current field, the application version rollback device 1040 executes the pre-rollback hook resource of the current version before executing the main resource (for example, manifest) rollback. The pre-rollback hook resource of the current version is the resource identified by the pre-rollback-current field.
[0069] When the specified field includes the post-rollback-current field, the application version rollback device 1040 executes the post-rollback hook resource of the current version after executing the main resource rollback. The post-rollback hook resource of the current version is the resource identified by the post-rollback-current field.
[0070] Among them, the above specified field can be added in the form of annotations (annotations) in the resource definition, which is used to identify that the resource is the corresponding hook resource. For details, see Figure 3For the resource configmap 9, an annotation 302 is added in the definition file of the resource, which indicates that the resource is executed before rollback for the current version; for the resource configmap 10, an annotation 304 is added in the definition file of the resource, which indicates that the resource is executed after rollback for the current version.
[0071] The pre-rollback-current field or the post-rollback-current field is included in the version rollback request in the embodiments of the present application, and in some possible implementation manners, the version rollback request can also include the pre-rollback-current field and the post-rollback-current field. Correspondingly, the application version rollback apparatus 1040 can first execute the hook resource identified by the pre-rollback-current field for the current version, then execute the main resource manifest, and then execute the hook resource identified by the post-rollback-current field for the current version. That is, the application version rollback apparatus 1040 can first execute the hook resource before rollback for the current version, then execute the main resource rollback, and then execute the hook resource after rollback for the current version.
[0072] In some possible implementation manners, the version rollback request can also include other hook fields, for example, a field indicating that the hook resource is executed for the target version. Based on this, the application version rollback apparatus 1040 can also execute the hook resource for the target version after executing the hook resource for the current version.
[0073] Specifically, when the target version rollback before field is included in the version rollback request, the application version rollback apparatus 1040 can execute the hook resource identified by the target version rollback before field before executing the main resource manifest after executing the hook resource identified by the pre-rollback-current field, that is, execute the hook resource before rollback for the target version.
[0074] When the target version rollback after field is included in the version rollback request, the application version rollback apparatus 1040 can execute the hook resource identified by the target version rollback after field after executing the hook resource identified by the post-rollback-current field (wherein the step is after executing the main resource manifest), that is, execute the hook resource before rollback for the target version.
[0075] Based on the above content description, the embodiment of the application provides an application version rollback method, which adds a new hook type on the basis of an existing hook function, and specifically includes a hook type for executing hook resources before rollback of a current version and / or a hook type for executing hook resources after rollback of the current version, so that the hook resources of the current version are executed when the application version is rolled back, thereby solving the rollback customization demand in actual production and improving the rollback success rate.
[0076] Next, the application version rollback method provided by the embodiment of the application is exemplarily described in combination with a process in which the release of an application is upgraded from version v1 to v2 and then rolled back from v2 to v1.
[0077] Referring to Figure 4 the flowchart of the application version rollback method is shown, as Figure 4 shown, the release of the application includes versions v1, v2 and v3. Since the version number of the helm application is increased by 1 regardless of upgrade or rollback, the release version number finally shows v3. The version v3 after rollback is equivalent to the version v1.
[0078] In this example, each version of the release specifically includes the following content:
[0079] The version v1 includes the hook resources before rollback of the target version (denoted as hook1) and the hook resources after rollback of the target version (denoted as hook2).
[0080] The version v2 includes the hook resources before rollback of the current version (denoted as hook3) and the hook resources after rollback of the current version (denoted as hook4).
[0081] The version v3 is actually equivalent to the version v1, and includes the same content as the version v1.
[0082] When a user triggers an application version rollback operation to roll back the application version from the current version v2 to the target version v1, the client generates a version rollback request in response to the application version rollback operation triggered by the user, and sends the version rollback request to the server. When the application version rollback device 1040 of the server receives the version rollback request, the hook resources before rollback of the current version, i.e., hook3, are executed according to the specified field of the version rollback request, i.e., the pre-rollback-current field, and then the hook resources before rollback of the target version, i.e., hook1, are executed.
[0083] Then the version rollback device 1040 executes the main resource manifest, then executes the post-rollback hook resource of the current version, that is, hook4, according to the specified field of the version rollback request, that is, the post-rollback-current field, and then executes the post-rollback hook resource of the target version, that is, hook2. When hook2 is executed, the release is rolled back from version v2 to v1 (that is, v3).
[0084] The embodiment of the application increases the ability to execute the hook resource of the current version. As long as the hook resource of the current version is added in the latest version v2, the hook resource of the current version can be executed when the latest version v2 is rolled back to the target version v1. Therefore, the developer does not need to embed the resource in advance. This scenario is more in line with the actual working condition, and does not require the developer to think in advance of the behavior that needs to be executed when a certain version is rolled back to the target version when designing the target version, thereby reducing the difficulty of rollback and improving the success rate of rollback.
[0085] Since the package management tool such as helm has the ability to execute the rollback hook resource of the current version, the user can perform environment cleaning, configuration and the like through the hook capability of the current version when rolling back the release. The application version rollback method provided by the embodiment of the application is more in line with the actual production environment, and its use is similar to the original hook resource, has low learning cost and high usability.
[0086] The above is combined Figures 1 to 4 The application version rollback method provided by the embodiment of the application is introduced, and next, the device and the equipment provided by the embodiment of the application are described with reference to the accompanying drawings.
[0087] Referring to Figure 1 The structure diagram of the application version rollback device 1040 is shown. The device 1040 comprises:
[0088] The communication module 1042 is configured to receive a version rollback request for a target application.
[0089] The execution module 1044 is configured to execute the hook resource of the current version specified by the version rollback request, so as to realize the rollback of the target application from the current version to the target version.
[0090] The specific implementation of the communication module 1042 can be referred to the description of S202 in the embodiment shown in Figure 2 The specific implementation of the execution module 1044 can be referred to the description of S204 in the embodiment shown in Figure 2 The specific implementation of the execution module 1044 can be referred to the description of S204 in the embodiment shown in
[0091] In some possible implementation manners, the execution module 1044 is specifically configured to:
[0092] before executing the main resource rollback, executing the rollback-before hook resource of the current version, the rollback-before hook resource of the current version being a resource identified by a current version rollback-before field.
[0093] The specific implementation of the execution module 1044 can be referred to the description of S204 in the embodiment shown in Figure 2 The related content of S204 in the embodiment shown in is described herein. Details are not described herein again.
[0094] In some possible implementation ways, the execution module 1044 is specifically configured to:
[0095] after executing the main resource rollback, executing the rollback-after hook resource of the current version, the rollback-after hook resource of the current version being a resource identified by a current version rollback-after field.
[0096] The specific implementation of the execution module 1044 can be referred to the description of S204 in the embodiment shown in Figure 2 The related content of S204 in the embodiment shown in is described herein. Details are not described herein again.
[0097] In some possible implementation ways, the execution module 1044 is further configured to:
[0098] after executing the hook resource of the current version, executing the hook resource of the target version.
[0099] The specific implementation of the execution module 1044 can be referred to the description of S204 in the embodiment shown in Figure 2 The related content of S204 in the embodiment shown in is described herein. Details are not described herein again.
[0100] In some possible implementation ways, the hook resource includes any one or more of a job, a configuration graph and a key.
[0101] In some possible implementation ways, the hook resource of the current version is identified by a specified field in an annotation.
[0102] The application version rollback apparatus 1040 according to the embodiments of the present application can correspond to executing the methods described in the embodiments of the present application, and the above and other operations and / or functions of each module / unit of the application version rollback apparatus 1040 are respectively to realize the corresponding flow of each method in the embodiments shown in Figure 2 The above and other operations and / or functions of each module / unit of the application version rollback apparatus 1040 are respectively to realize the corresponding flow of each method in the embodiments shown in
[0103] The embodiments of the present application further provide a device 104. The device 104 can be a notebook computer, a desktop computer or the like computer device. The device 104 is specifically configured to implement the functions of the application version rollback apparatus 1040 in the embodiments shown in Figure 1
[0104] Figure 5 A schematic diagram of the structure of device 104 is provided, as follows: Figure 5 As shown, device 104 includes a bus 501, a processor 502, a communication interface 503, and a memory 504. The processor 502, memory 504, and communication interface 503 communicate via bus 501. Bus 501 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 5 The symbol is represented by a single thick line, but this does not indicate that there is only one bus or one type of bus. Communication interface 503 is used for external communication. For example, it receives version rollback requests for a target application.
[0105] The processor 502 can be a central processing unit (CPU). The memory 504 can include volatile memory, such as random access memory (RAM). The memory 504 can also include non-volatile memory, such as read-only memory (ROM), flash memory, HDD, or SSD.
[0106] The memory 504 stores executable code, which the processor 502 executes to perform the aforementioned application version rollback method.
[0107] Specifically, in achieving Figure 1 In the case of the illustrated embodiment, and Figure 1 When the modules of the application version rollback device 1040 described in the embodiment are implemented in software, the execution... Figure 1 The execution module 1044 and the software or program code required for its functions are stored in the memory 504. The communication module 1042's functions are implemented through the communication interface 503. The communication interface 503 receives a version rollback request for the target application and transmits it to the processor 502 via the bus 501. The processor 502 executes the program code corresponding to each module stored in the memory 504, such as the program code corresponding to the execution module 1044, to execute the hook resources of the current version, thereby realizing the rollback of the target application from the current version to the target version (a version in the history).
[0108] Of course, the processor 502 can also execute the hook resource of the target version after executing the hook resource of the current version, so as to realize rolling back the target application from the current version to the target version.
[0109] The embodiment of the present application further provides a computer readable storage medium, which comprises instructions for instructing a computer to execute the application version rollback method applied to the application version rollback device 1040.
[0110] The embodiment of the present application further provides a computer readable storage medium, which comprises instructions for instructing a computer to execute the application version rollback method applied to the application version rollback device 1040.
[0111] The embodiment of the present application further provides a computer program product, which is executed by a computer, and the computer executes any one of the preceding application version rollback methods. The computer program product can be a software installation package, and when any one of the preceding application version rollback methods needs to be used, the computer program product can be downloaded and executed on the computer.
Claims
1. An application version rollback method, characterized by, The method comprises: receiving a version rollback request for a target application; executing a hook resource of a current version specified by the version rollback request to implement rollback of the target application from the current version to a target version, the hook resource of the current version comprising a pre-rollback hook resource of the current version and a post-rollback hook resource of the current version; the execution of the hook resource of the current version specified by the version rollback request comprises: before executing a main resource rollback, executing the pre-rollback hook resource of the current version, the pre-rollback hook resource of the current version being a resource identified by a pre-current version rollback field; after executing the main resource rollback, executing the post-rollback hook resource of the current version, the post-rollback hook resource of the current version being a resource identified by a post-current version rollback field.
2. The method of claim 1, wherein, The method further comprises: after executing the hook resource of the current version, executing a hook resource of the target version.
3. The method according to any one of claims 1 to 2, characterized in that, The hook resource comprises any one or more of a job, a configuration graph and a key.
4. The method according to any one of claims 1 to 2, characterized in that, The hook resource of the current version is identified by a specified field in an annotation.
5. An application version rollback apparatus characterized by comprising: The apparatus comprises: a communication module configured to receive a version rollback request for a target application; an execution module configured to execute a hook resource of a current version specified by the version rollback request to implement rollback of the target application from the current version to a target version, the hook resource of the current version comprising a pre-rollback hook resource of the current version and a post-rollback hook resource of the current version; the execution module is specifically configured to, before executing a main resource rollback, execute the pre-rollback hook resource of the current version, the pre-rollback hook resource of the current version being a resource identified by a pre-current version rollback field; and after executing the main resource rollback, execute the post-rollback hook resource of the current version, the post-rollback hook resource of the current version being a resource identified by a post-current version rollback field.
6. The apparatus of claim 5, wherein, The execution module is further configured to: after executing the hook resource of the current version, execute a hook resource of the target version.
7. The apparatus of any one of claims 5 to 6, wherein, The hook resource comprises any one or more of a job, a configuration graph and a key.
8. The apparatus of any one of claims 5 to 6, wherein, The hook resource of the current version is identified by a specified field in an annotation.
9. A computer device, comprising: The computer device comprises a processor and a memory; the processor is configured to execute instructions stored in the memory, so that the computer device executes the application version rollback method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises instructions for instructing a computer to execute the application version rollback method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Software management method and apparatus
CN105955740A