diff --git a/fission/function.go b/fission/function.go index b5f925e7..92c67ee3 100644 --- a/fission/function.go +++ b/fission/function.go @@ -647,50 +647,6 @@ func fnLogs(c *cli.Context) error { } } -func fnPods(c *cli.Context) error { - client := getClient(c.GlobalString("server")) - - fmt.Println("This subcommand is deprecated and will be removed in the next release. Please use `kubectl get pods -l functionName= --all-namespaces` instead.") - - fnName := c.String("name") - if len(fnName) == 0 { - fatal("Need name of function, use --name") - } - - dbType := c.String("dbtype") - if len(dbType) == 0 { - dbType = logdb.INFLUXDB - } - - m := &metav1.ObjectMeta{Name: fnName} - - f, err := client.FunctionGet(m) - checkErr(err, "get function") - - // client first sends db query to the controller, then the controller - // will establish a proxy server that bridges the client and the database. - logDB, err := logdb.GetLogDB(dbType, getServerUrl()) - if err != nil { - fatal("failed to connect log database") - } - - logFilter := logdb.LogFilter{ - Function: f.Metadata.Name, - FuncUid: string(f.Metadata.UID), - } - pods, err := logDB.GetPods(logFilter) - if err != nil { - fatal("failed to get pods of function") - return err - } - fmt.Printf("NAME\t\n") - for _, pod := range pods { - fmt.Println(pod) - } - - return err -} - func fnTest(c *cli.Context) error { fnName := c.String("name") if len(fnName) == 0 { diff --git a/fission/logdb/influxdb.go b/fission/logdb/influxdb.go index 4b4936e1..0dacf443 100644 --- a/fission/logdb/influxdb.go +++ b/fission/logdb/influxdb.go @@ -45,28 +45,6 @@ type InfluxDB struct { endpoint string } -func (influx InfluxDB) GetPods(filter LogFilter) ([]string, error) { - parameters := make(map[string]interface{}) - parameters["funcuid"] = filter.FuncUid - - queryCmd := "select * from \"log\" where \"funcuid\" = $funcuid group by \"pod\"" - query := influxdbClient.NewQueryWithParameters(queryCmd, INFLUXDB_DATABASE, "", parameters) - - response, err := influx.query(query) - if err != nil /*|| response.Err != ""*/ { - return []string{}, err - } - pods := []string{} - for _, r := range response.Results { - for _, series := range r.Series { - for _, pod := range series.Tags { - pods = append(pods, pod) - } - } - } - return pods, nil -} - func makeIndexMap(cols []string) map[string]int { indexMap := make(map[string]int, len(cols)) for i := range cols { diff --git a/fission/logdb/logdb.go b/fission/logdb/logdb.go index 1d37b5e2..71b90eec 100644 --- a/fission/logdb/logdb.go +++ b/fission/logdb/logdb.go @@ -27,7 +27,6 @@ const ( ) type LogDatabase interface { - GetPods(LogFilter) ([]string, error) GetLogs(LogFilter) ([]LogEntry, error) } diff --git a/fission/main.go b/fission/main.go index 651d4775..d3a68319 100644 --- a/fission/main.go +++ b/fission/main.go @@ -151,7 +151,6 @@ func main() { {Name: "delete", Usage: "Delete function", Flags: []cli.Flag{fnNameFlag}, Action: fnDelete}, {Name: "list", Usage: "List all functions", Flags: []cli.Flag{}, Action: fnList}, {Name: "logs", Usage: "Display function logs", Flags: []cli.Flag{fnNameFlag, fnPodFlag, fnFollowFlag, fnDetailFlag, fnLogDBTypeFlag, fnLogCountFlag}, Action: fnLogs}, - {Name: "pods", Usage: "(Deprecated) Display function pods", Flags: []cli.Flag{fnNameFlag, fnLogDBTypeFlag}, Action: fnPods}, {Name: "test", Usage: "Test a function", Flags: []cli.Flag{fnNameFlag, fnEnvNameFlag, fnCodeFlag, fnSrcArchiveFlag, htMethodFlag, fnBodyFlag, fnHeaderFlag}, Action: fnTest}, }