Version Management in Openwhisk
In Openwhisk, version and version count are added, so whatever code has been written in the editor, the admin can have a copy of it and save it as a version.
The reason there is a version button in OpenWhisk is that code snippets are written to execute certain tasks. Suppose some changes are to be made to the code as per admin requirements. It is a very easy and convenient way. Those versions can be used later, if required.
- To create a version, the admin must click on the edit icon under the Action column on the Openwhisk page as shown in the following figure:

- The following page appears:

- To add a new version, click on the Version in the Edit Action page.

- The following page appears:

- Provide the Version Name and click on the "Create New Version" button at the top right corner of the Version page.

- The following confirmation message appears:

- Click OK. The success message appears as shown in the following figure:

- Click OK and the new version is created.

- When a version is added to the list of versions, the version count is updated on edit page as shown in the following figure:

- Click on the publish icon as shown in the following figure:

- The following confirmation message appears. Click OK to continue.

- On clicking the publish icon, it fetches the data from the saved thing and paste the code on the editor:

- If admin makes any changes to the code in the editor, he must save the code by clicking on the Save button.

- While creating a version, first code snippets must be saved, and then only a version can be created. In the case of failing to save the code, a failure message appears:

- Version management is only applicable in the case of the editing an existing Openwhisk function and not in the case of adding a new Openwhisk function.
- Clicking the publish button does not save the code it just copies and paste the code in the editor field. User must click save to make the code executable.