You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2017/12/07 23:07:18 UTC

[GitHub] mrutkows closed pull request #666: Uncommenting managed deployment for rules, package, actions, and sequences

mrutkows closed pull request #666: Uncommenting managed deployment for rules, package, actions, and sequences
URL: https://github.com/apache/incubator-openwhisk-wskdeploy/pull/666
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/deployers/servicedeployer.go b/deployers/servicedeployer.go
index 183798a..9b33c8a 100644
--- a/deployers/servicedeployer.go
+++ b/deployers/servicedeployer.go
@@ -476,13 +476,13 @@ func (deployer *ServiceDeployer) RefreshManagedEntities(maValue whisk.KeyValue)
 		return err
 	}
 
-	//if err := deployer.RefreshManagedRules(ma); err != nil {
-	//	return err
-	//}
+	if err := deployer.RefreshManagedRules(ma); err != nil {
+		return err
+	}
 
-	//if err := deployer.RefreshManagedPackages(ma); err != nil {
-	//	return err
-	//}
+	if err := deployer.RefreshManagedPackages(ma); err != nil {
+		return err
+	}
 
 	return nil
 
diff --git a/parsers/manifest_parser.go b/parsers/manifest_parser.go
index 4cd2a26..4a651c5 100644
--- a/parsers/manifest_parser.go
+++ b/parsers/manifest_parser.go
@@ -439,7 +439,7 @@ func (dm *YAMLParser) ComposeActions(filePath string, actions map[string]Action,
 
 				switch ext {
 				case ".swift":
-					kind = "swift:3"
+					kind = "swift:3.1.1"
 				case ".js":
 					kind = "nodejs:6"
 				case ".py":
diff --git a/parsers/manifest_parser_test.go b/parsers/manifest_parser_test.go
index b9aca56..f31b55c 100644
--- a/parsers/manifest_parser_test.go
+++ b/parsers/manifest_parser_test.go
@@ -486,7 +486,7 @@ func TestComposeActionsForImplicitRuntimes(t *testing.T) {
                     } else if actions[i].Action.Name == "helloPython" {
                         expectedResult = "python"
                     } else if actions[i].Action.Name == "helloSwift" {
-                        expectedResult = "swift:3"
+                        expectedResult = "swift:3.1.1"
                     }
                     actualResult := actions[i].Action.Exec.Kind
                     assert.Equal(t, expectedResult, actualResult, "Expected " + expectedResult + " but got " + actualResult)
diff --git a/tests/src/integration/runtimetests/manifest.yaml b/tests/src/integration/runtimetests/manifest.yaml
index 1f179a8..922e7c4 100644
--- a/tests/src/integration/runtimetests/manifest.yaml
+++ b/tests/src/integration/runtimetests/manifest.yaml
@@ -94,7 +94,7 @@ packages:
           web-export: true
           version: 1.0
           function: src/hello.swift
-          runtime: swift:3
+          runtime: swift:3.1.1
           inputs:
             name: string
             place: string
diff --git a/utils/misc.go b/utils/misc.go
index b9d862e..246656e 100644
--- a/utils/misc.go
+++ b/utils/misc.go
@@ -441,105 +441,113 @@ func ConvertToMap(op OpenWhiskInfo) (rt map[string][]string) {
 }
 
 var runtimeInfo = []byte(`{
-  "support": {
-    "github": "https://github.com/apache/incubator-openwhisk/issues",
-    "slack": "http://slack.openwhisk.org"
-  },
-  "description": "OpenWhisk",
-  "api_paths": ["/api/v1"],
-  "runtimes": {
-    "nodejs": [{
-      "image": "openwhisk/nodejsaction:latest",
-      "deprecated": true,
-      "requireMain": false,
-      "default": false,
-      "attached": false,
-      "kind": "nodejs"
-    }, {
-      "image": "openwhisk/nodejs6action:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": true,
-      "attached": false,
-      "kind": "nodejs:6"
-    }],
-    "java": [{
-      "image": "openwhisk/java8action:latest",
-      "deprecated": false,
-      "requireMain": true,
-      "default": true,
-      "attached": true,
-      "kind": "java"
-    }],
-    "php": [{
-      "image": "openwhisk/action-php-v7.1:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": true,
-      "attached": false,
-      "kind": "php:7.1"
-    }],
-    "python": [{
-      "image": "openwhisk/python2action:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": false,
-      "attached": false,
-      "kind": "python"
-    }, {
-      "image": "openwhisk/python2action:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": true,
-      "attached": false,
-      "kind": "python:2"
-    }, {
-      "image": "openwhisk/python3action:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": false,
-      "attached": false,
-      "kind": "python:3"
-    }],
-    "swift": [{
-      "image": "openwhisk/swiftaction:latest",
-      "deprecated": true,
-      "requireMain": false,
-      "default": false,
-      "attached": false,
-      "kind": "swift"
-    }, {
-      "image": "openwhisk/swift3action:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": true,
-      "attached": false,
-      "kind": "swift:3"
-    }, {
-      "image": "openwhisk/action-swift-v3.1.1:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": false,
-      "attached": false,
-      "kind": "swift:3.1.1"
-    }]
-  },
-  "limits": {
-    "actions_per_minute": 5000,
-    "triggers_per_minute": 5000,
-    "concurrent_actions": 1000
-  }
-  }
+	"support":{
+		"github":"https://github.com/apache/incubator-openwhisk/issues",
+		"slack":"http://slack.openwhisk.org"
+	},
+	"description":"OpenWhisk",
+	"api_paths":["/api/v1"],
+	"runtimes":{
+		"nodejs":[{
+			"image":"openwhisk/nodejsaction:latest",
+			"deprecated":true,
+			"requireMain":false,
+			"default":false,
+			"attached":false,
+			"kind":"nodejs"
+		},{
+			"image":"openwhisk/nodejs6action:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":true,
+			"attached":false,
+			"kind":"nodejs:6"
+		},{
+			"image":"openwhisk/action-nodejs-v8:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":false,
+			"attached":false,
+			"kind":"nodejs:8"
+		}],
+		"java":[{
+			"image":"openwhisk/java8action:latest",
+			"deprecated":false,
+			"requireMain":true,
+			"default":true,
+			"attached":true,
+			"kind":"java"
+		}],
+		"php":[{
+			"image":"openwhisk/action-php-v7.1:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":true,
+			"attached":false,
+			"kind":"php:7.1"
+		}],
+		"python":[{
+			"image":"openwhisk/python2action:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":false,
+			"attached":false,
+			"kind":"python"
+		},{
+			"image":"openwhisk/python2action:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":true,
+			"attached":false,
+			"kind":"python:2"
+		},{
+			"image":"openwhisk/python3action:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":false,
+			"attached":false,
+			"kind":"python:3"
+		}],
+		"swift":[{
+			"image":"openwhisk/swiftaction:latest",
+			"deprecated":true,
+			"requireMain":false,
+			"default":false,
+			"attached":false,
+			"kind":"swift"
+		},{
+			"image":"openwhisk/swift3action:latest",
+			"deprecated":true,
+			"requireMain":false,
+			"default":false,
+			"attached":false,
+			"kind":"swift:3"
+		},{
+			"image":"openwhisk/action-swift-v3.1.1:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":true,
+			"attached":false,
+			"kind":"swift:3.1.1"
+		}]
+	},
+	"limits":{
+		"actions_per_minute":5000,
+		"triggers_per_minute":5000,
+		"concurrent_actions":1000
+	}
+	}
 `)
 
+
 var Rts map[string][]string
 
 var DefaultRts = map[string][]string{
-	"nodejs": {"nodejs", "nodejs:6"},
+	"nodejs": {"nodejs:6"},
 	"java":   {"java"},
 	"php":    {"php:7.1"},
-	"python": {"python", "python:2", "python:3"},
-	"swift":  {"swift", "swift:3", "swift:3.1.1"},
+	"python": {"python:2"},
+	"swift":  {"swift:3.1.1"},
 }
 
 func CheckExistRuntime(rtname string, rts map[string][]string) bool {
diff --git a/utils/misc_test.go b/utils/misc_test.go
index f7a1ade..07a799b 100644
--- a/utils/misc_test.go
+++ b/utils/misc_test.go
@@ -85,11 +85,11 @@ func TestParseOpenWhisk(t *testing.T) {
 	openwhisk, err := ParseOpenWhisk(openwhiskHost)
 	assert.Equal(t, nil, err, "parse openwhisk info error happened.")
 	converted := ConvertToMap(openwhisk)
-	assert.Equal(t, 1, len(converted["nodejs"]), "not expected length")
+	assert.Equal(t, 2, len(converted["nodejs"]), "not expected length")
 	assert.Equal(t, 1, len(converted["php"]),  "not expected length")
 	assert.Equal(t, 1, len(converted["java"]), "not expected length")
 	assert.Equal(t, 3, len(converted["python"]), "not expected length")
-	assert.Equal(t, 2, len(converted["swift"]), "not expected length")
+	assert.Equal(t, 1, len(converted["swift"]), "not expected length")
 }
 
 func TestNewZipWritter(t *testing.T) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services