Skip to content
This repository has been 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

Fix typos and clean up #938

merged 6 commits into from
Nov 6, 2018

Conversation

dannyqiu
Copy link
Contributor

@dannyqiu dannyqiu commented Oct 30, 2018

Issue Ref: [Issue number related to this PR or None]

Description:

  • Fix documentation typos
  • Clean up old binaries
  • Standardize timestamp format (RFC3339 so that runtimes can more easily parse)

TODOs:

  • Ready to review
  • Automated Tests
  • Docs

@dannyqiu
Copy link
Contributor Author

I'm not quite sure why we test for TestEnsureDeploymentWithoutFuncNorHandler and TestEnsureDeploymentWithoutFunc, where functions would be deployed that do nothing. I think this leads to silent failures that users should actually be aware of?

Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

Hi @dannyqiu, thanks for this PR! I've sent a few comments.

@@ -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.

@@ -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

@@ -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.

Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

👍

@andresmgot
Copy link
Contributor

andresmgot commented Oct 31, 2018

BTW @dannyqiu to fix the CI you need to modify the tests that are looking for the old timestamp format. You need to modify the tests that looks for event-time.*UTC (post-python, post-nodejs, post-go, post-ruby (UTC is not printed anymore, you can substitute that with Z). Those are in the examples/Makefile file:

https://github.com/kubeless/kubeless/blob/366318ecd3a85e3acd21d46351ef084ff0cf6595/examples/Makefile#L308
https://github.com/kubeless/kubeless/blob/366318ecd3a85e3acd21d46351ef084ff0cf6595/examples/Makefile#L328

Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

You modified more examples than needed, please revert those changes for the cases that are not affected. Thanks for applying the changes!

@@ -407,7 +407,7 @@ python-nats-verify:
$$found
# Verify event context
logs=`kubectl logs -l function=python-nats`; \
echo $$logs | grep -q "event-time.*UTC" && \
echo $$logs | grep -q "event-time.*Z" && \
Copy link
Contributor

Choose a reason for hiding this comment

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

your changes doesn't affect to nats

@@ -441,7 +441,7 @@ python-kinesis-verify:
$$found
# Verify event context
logs=`kubectl logs -l function=python-kinesis`; \
echo $$logs | grep -q "event-time.*UTC" && \
echo $$logs | grep -q "event-time.*Z" && \
Copy link
Contributor

Choose a reason for hiding this comment

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

your changes doesn't affect to kinesis either

@@ -475,7 +475,7 @@ python-kinesis-multi-record-verify:
$$found
# Verify event context
logs=`kubectl logs -l function=python-kinesis-multi-record`; \
echo $$logs | grep -q "event-time.*UTC" && \
echo $$logs | grep -q "event-time.*Z" && \
Copy link
Contributor

Choose a reason for hiding this comment

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

the same for kinesis

@@ -519,7 +519,7 @@ nats-python-func1-topic-test-verify:
$$found
# Verify event context
logs=`kubectl logs -l function=nats-python-func1-topic-test`; \
echo $$logs | grep -q "event-time.*UTC" && \
echo $$logs | grep -q "event-time.*Z" && \
Copy link
Contributor

Choose a reason for hiding this comment

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

the same for nats

@@ -545,7 +545,7 @@ nats-python-func2-topic-test-verify:
$$found
# Verify event context
logs=`kubectl logs -l function=nats-python-func2-topic-test`; \
echo $$logs | grep -q "event-time.*UTC" && \
echo $$logs | grep -q "event-time.*Z" && \
Copy link
Contributor

Choose a reason for hiding this comment

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

the same for nats

@@ -571,7 +571,7 @@ nats-python-func-multi-topic-verify:
$$found
# Verify event context
logs=`kubectl logs -l function=nats-python-func-multi-topic`; \
echo $$logs | grep -q "event-time.*UTC" && \
echo $$logs | grep -q "event-time.*Z" && \
Copy link
Contributor

Choose a reason for hiding this comment

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

the same

@@ -593,7 +593,7 @@ nats-python-func-multi-topic-verify:
$$found
# Verify event context
logs=`kubectl logs -l function=nats-python-func-multi-topic`; \
echo $$logs | grep -q "event-time.*UTC" && \
echo $$logs | grep -q "event-time.*Z" && \
Copy link
Contributor

Choose a reason for hiding this comment

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

and the same

@andresmgot
Copy link
Contributor

Sorry, I didn't see the updated changes. Thanks for the patch!

@andresmgot andresmgot merged commit bf2871f into vmware-archive:master Nov 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants