Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Kubeless 0.5.0 #245

Merged
merged 3 commits into from
Apr 17, 2018
Merged

Conversation

andresmgot
Copy link
Contributor

@andresmgot andresmgot commented Apr 13, 2018

Retrieve runtimes information from kubeless-config

closes #194
closes #191
closes #187

@@ -36,6 +36,9 @@ class FunctionEditor extends React.Component<IFunctionEditorProps> {
return "javascript";
} else if (runtime.match(/ruby/)) {
return "ruby";
} else if (runtime.match(/php/)) {
// Doesn't work: Uncaught SyntaxError: Unexpected token <
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I receive here:
screen shot 2018-04-13 at 18 13 37

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's because you're missing the import for php (see line 4)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that was it :)

@@ -0,0 +1,22 @@
import { Dispatch } from "redux";
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these actions should really be part of functions and the function state (e.g. the catalog actions/state holds all the state for brokers, instances, plans, etc.), unless there's any particular reason you wanted this to be separate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, they are different entities but it is true that runtimes are meaningless without functions.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree they're different entities, but they are part of the same component so I think it makes sense to group them - especially since that's what we're doing with Service Catalog (brokers, instances, plans are all separate entities).

@@ -36,6 +36,9 @@ class FunctionEditor extends React.Component<IFunctionEditorProps> {
return "javascript";
} else if (runtime.match(/ruby/)) {
return "ruby";
} else if (runtime.match(/php/)) {
// Doesn't work: Uncaught SyntaxError: Unexpected token <
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's because you're missing the import for php (see line 4)

import { RuntimesAction } from "../actions/runtimes";
import { IRuntime } from "../shared/types";

export interface IRuntimeState {
Copy link
Contributor

Choose a reason for hiding this comment

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

as suggested above, I think this could be part of the function reducer and state


export default class Config {
public static async get() {
const config = await axios.get<IKubelessConfigMap>(Config.SelfLink);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should return config.data, or better yet could be written as const { data: config } = .... There's not much point in returning the Axios request response.

@prydonius
Copy link
Contributor

Thanks a lot @andresmgot, this is awesome (especially since you also did the work to fetch the Kubeless config that I was too lazy to do earlier ;) )!

@@ -18,7 +18,11 @@ local labels = {
// the manifest key
local labelify(src) = if std.objectHas(src, "metadata") then src + labels else src;
local labelifyEach(src) = {
[k]: labelify(src[k]) for k in std.objectFields(src)
[k]: if std.isArray(src[k]) then
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this also fix #151?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If that issue refers to the kubeless-controller it was already setting the label created-by: kubeapps (and it keeps being that way). In case it was referring to the function pods that kubeless creates they won't include that tag.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought @sebgoa was referring to the kubeless-controller, but now that you say that maybe he was referring to the function pods, and of course they won't include that tag.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was referring to the controller and zk/kafka pods/deployments.

@prydonius
Copy link
Contributor

@andresmgot we also need to add the shasum to the function spec, since functions created by the CLI will not update if this is not correctly set.

@andresmgot
Copy link
Contributor Author

BTW, with this change we are not including Kafka and Zookeeper anymore. Should we keep it or leave Kubeapps with just HTTP triggered functions?

@prydonius
Copy link
Contributor

@andresmgot let's leave it and implement it with #189.

BTW, can you also update /~https://github.com/kubeapps/kubeapps/blob/master/docs/design-proposals/authentication-and-authorization.md#functions with the relevant ConfigMap role?

Copy link
Contributor

@prydonius prydonius left a comment

Choose a reason for hiding this comment

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

lgtm thanks @andresmgot!

@prydonius prydonius merged commit 463a82a into vmware-tanzu:master Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants