You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ho...@apache.org on 2018/02/02 22:01:41 UTC

[incubator-openwhisk-wskdeploy] branch master updated: Remove verifier.go to confirm no test impact. (#698)

This is an automated email from the ASF dual-hosted git repository.

houshengbo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git


The following commit(s) were added to refs/heads/master by this push:
     new 9c9f5f9  Remove verifier.go to confirm no test impact. (#698)
9c9f5f9 is described below

commit 9c9f5f9f0e94edb2ff9fb352042a56dafa7add42
Author: Matt Rutkowski <mr...@us.ibm.com>
AuthorDate: Fri Feb 2 16:01:39 2018 -0600

    Remove verifier.go to confirm no test impact. (#698)
    
    * Test: remove functions from verifier.go to confirm no test impact.
    
    * Test: remove functions from verifier.go to confirm no test impact.
    
    * Remove verifier.go to confirm no test impact.
---
 deployers/verifier.go | 80 ---------------------------------------------------
 1 file changed, 80 deletions(-)

diff --git a/deployers/verifier.go b/deployers/verifier.go
deleted file mode 100644
index 4743815..0000000
--- a/deployers/verifier.go
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-package deployers
-
-import (
-	"fmt"
-
-	"github.com/apache/incubator-openwhisk-client-go/whisk"
-)
-
-// The verifier will filter the deployer against the target DeploymentProject
-// the deployer will query the OpenWhisk platform for already deployed entities.
-// We assume the deployer and the manifest are targeted for the same namespace.
-type Verifier struct {
-}
-
-type Filter interface {
-	// Perform some filter.
-	Filter(deployer *ServiceDeployer, target *DeploymentProject) (filtered *DeploymentProject, err error)
-	// Perform some queries.
-	Query(deployer *ServiceDeployer) (da *DeploymentProject, err error)
-}
-
-func (vf *Verifier) Query(deployer *ServiceDeployer) (da *DeploymentProject, err error) {
-	pkgoptions := &whisk.PackageListOptions{false, 0, 0, 0, false}
-	packages, _, err := deployer.Client.Packages.List(pkgoptions)
-
-	da = NewDeploymentProject()
-	for _, pa := range packages {
-		deppack := NewDeploymentPackage()
-		deppack.Package, _ = convert(&pa)
-		da.Packages[pa.Name] = deppack
-	}
-	return da, nil
-}
-
-// TODO() function supposedly returns an error, but never does
-func (vf *Verifier) Filter(deployer *ServiceDeployer, target *DeploymentProject) (rs *DeploymentProject, err error) {
-	//substract
-	for _, pa := range target.Packages {
-		for _, dpa := range deployer.Deployment.Packages {
-			if pa.Package.Name == dpa.Package.Name {
-				delete(target.Packages, dpa.Package.Name)
-			}
-		}
-	}
-
-	depApp := NewDeploymentProject()
-	// TODO() i18n
-	fmt.Printf("Target Packages are %#v\n", target.Packages)
-	depApp.Packages = target.Packages
-	return depApp, nil
-}
-
-// Convert whisk.package to whisk.SentPackageNoPublish
-// TODO() function supposedly returns an error, but never does
-// TODO() return value named "sentpackage" is instead "sp"
-func convert(pa *whisk.Package) (sentpackage *whisk.Package, err error) {
-	sp := &whisk.Package{}
-	sp.Name = pa.Name
-	sp.Annotations = pa.Annotations
-	sp.Parameters = pa.Parameters
-	sp.Version = pa.Version
-	return sp, nil
-}

-- 
To stop receiving notification emails like this one, please contact
houshengbo@apache.org.