Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Fix typos and clean up #938

Merged
merged 6 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ binary-cross:

all-yaml: kubeless.yaml kubeless-non-rbac.yaml kubeless-openshift.yaml kafka-zookeeper.yaml

kubeless.yaml: kubeless.jsonnet
kubeless.yaml: kubeless.jsonnet kubeless-non-rbac.jsonnet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kubeless-non-rbac.jsonnet has its own task, why are you adding it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since kubeless.yaml is generated from kubeless-non-rbac.jsonnet, it should be a dependency when compiling.


kubeless-non-rbac.yaml: kubeless-non-rbac.jsonnet

Expand Down
2 changes: 1 addition & 1 deletion cmd/kubeless/function/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ var callCmd = &cobra.Command{
logrus.Fatalf("Unable to generate ID %v", err)
}
req.SetHeader("event-id", eventID)
req.SetHeader("event-time", timestamp.String())
req.SetHeader("event-time", timestamp.Format(time.RFC3339))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Agree with the format

req.SetHeader("event-namespace", "cli.kubeless.io")
res, err := req.Do().Raw()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubeless/trigger/kafka/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ var createCmd = &cobra.Command{
func init() {
createCmd.Flags().StringP("namespace", "n", "", "Specify namespace for the kafka trigger")
createCmd.Flags().StringP("trigger-topic", "", "", "Specify topic to listen to in Kafka broker")
createCmd.Flags().StringP("function-selector", "", "", "Selector (label query) to select function on (e.g. -function-selector key1=value1,key2=value2)")
createCmd.Flags().StringP("function-selector", "", "", "Selector (label query) to select function on (e.g. --function-selector key1=value1,key2=value2)")
createCmd.MarkFlagRequired("trigger-topic")
createCmd.MarkFlagRequired("function-selector")
createCmd.Flags().Bool("dryrun", false, "Output JSON manifest of the function without creating it")
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubeless/trigger/kafka/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ var updateCmd = &cobra.Command{
func init() {
updateCmd.Flags().StringP("namespace", "n", "", "Specify namespace for the function")
updateCmd.Flags().StringP("trigger-topic", "", "", "Specify topic to listen to in Kafka broker")
updateCmd.Flags().StringP("function-selector", "", "", "Selector (label query) to select function on (e.g. -function-selector key1=value1,key2=value2)")
updateCmd.Flags().StringP("function-selector", "", "", "Selector (label query) to select function on (e.g. --function-selector key1=value1,key2=value2)")
updateCmd.Flags().Bool("dryrun", false, "Output JSON manifest of the function without creating it")
updateCmd.Flags().StringP("output", "o", "yaml", "Output format")
}
2 changes: 1 addition & 1 deletion cmd/kubeless/trigger/nats/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ var createCmd = &cobra.Command{
func init() {
createCmd.Flags().StringP("namespace", "n", "", "Specify namespace for the NATS trigger")
createCmd.Flags().StringP("trigger-topic", "", "", "Specify topic to listen to in NATS")
createCmd.Flags().StringP("function-selector", "", "", "Selector (label query) to select function on (e.g. -function-selector key1=value1,key2=value2)")
createCmd.Flags().StringP("function-selector", "", "", "Selector (label query) to select function on (e.g. --function-selector key1=value1,key2=value2)")
createCmd.MarkFlagRequired("trigger-topic")
createCmd.MarkFlagRequired("function-selector")
createCmd.Flags().Bool("dryrun", false, "Output JSON manifest of the function without creating it")
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubeless/trigger/nats/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ var updateCmd = &cobra.Command{
func init() {
updateCmd.Flags().StringP("namespace", "n", "", "Specify namespace for the NATS trigger")
updateCmd.Flags().StringP("trigger-topic", "", "", "Specify topic to listen to in NATS")
updateCmd.Flags().StringP("function-selector", "", "", "Selector (label query) to select function on (e.g. -function-selector key1=value1,key2=value2)")
updateCmd.Flags().StringP("function-selector", "", "", "Selector (label query) to select function on (e.g. --function-selector key1=value1,key2=value2)")
updateCmd.Flags().Bool("dryrun", false, "Output JSON manifest of the function without creating it")
updateCmd.Flags().StringP("output", "o", "yaml", "Output format")
}
3 changes: 3 additions & 0 deletions docs/advanced-function-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ kind: Function
metadata:
name: get-python
namespace: default
label:
created-by: kubeless
function: get-python
spec:
runtime: python2.7
timeout: "180"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/function_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (c *FunctionController) processItem(key string) error {
c.logger.Errorf("Failed to remove function controller as finalizer to Function Obj: %s object due to: %v: ", key, err)
return err
}
c.logger.Infof("Function object %s has been successfully processed and marked for deleteion", key)
c.logger.Infof("Function object %s has been successfully processed and marked for deletion", key)
return nil
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/utils/kubelessutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,8 @@ func EnsureFuncDeployment(client kubernetes.Interface, funcObj *kubelessApi.Func
Value: dpm.Spec.Template.Spec.Containers[0].Resources.Limits.Memory().String(),
},
)
} else {
return fmt.Errorf("Expected non-empty handler and non-empty function content")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not return an error here because there is the case in which the user specifies an already built image (custom) that doesn't require a handler and function. For example: kubeless function deploy foo --runtime-image=nginx is a valid command. I am okay if we print something here in the logs though because probably something weird is happening.

}

dpm.Spec.Template.Spec.Containers[0].Env = append(dpm.Spec.Template.Spec.Containers[0].Env,
Expand Down
4 changes: 1 addition & 3 deletions script/binary
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ BUILD_FLAGS=(-ldflags="-w -X github.com/kubeless/kubeless/pkg/version.Version=${
# Get rid of existing binary
echo "Removing Old Kubeless binaries"
rm -f ${GOPATH%%:*}/bin/kubeless
rm -f ${GOPATH%%:*}/bin/kafka-trigger-controller
rm -f ${GOPATH%%:*}/bin/kubeless-controller-manager
rm -f ${GOPATH%%:*}/bin/nats-trigger-controller
rm -f ${GOPATH%%:*}/bin/function-controller

echo "Build Kubeless Components binaries"
# Build binary
Expand Down