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

Generating components #97

Merged

Conversation

Revolyssup
Copy link
Contributor

@Revolyssup Revolyssup commented Aug 6, 2021

Description
Adding component generation in meshkit.

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Ashish test <ashishjaitiwari15112000@gmail.com>
Signed-off-by: Ashish test <ashishjaitiwari15112000@gmail.com>
@welcome
Copy link

welcome bot commented Aug 6, 2021

Yay, your first pull request! 👍 A contributor will be by to give feedback soon. In the meantime, please review the Layer5 Community Welcome Guide and sure to join the community Slack.
Be sure to double-check that you have signed your commits. Here are instructions for making signing an implicit activity while peforming a commit.

@Revolyssup Revolyssup added the pr/draft WIP/Draft pull request label Aug 6, 2021
@leecalcote leecalcote requested a review from a team August 10, 2021 21:57
Copy link
Member

@leecalcote leecalcote left a comment

Choose a reason for hiding this comment

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

I don't think that we should be bundling copies of the kubeopenapi-jsonschema tool into this repo.

utils/manifests/generateComponent.go Show resolved Hide resolved

import (
"github.com/layer5io/meshkit/utils"
k8 "github.com/layer5io/meshkit/utils/kubernetes"
Copy link
Member

Choose a reason for hiding this comment

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

Please use "k8s"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, will do

Signed-off-by: Ashish test <ashishjaitiwari15112000@gmail.com>
Signed-off-by: Ashish test <ashishjaitiwari15112000@gmail.com>
@Revolyssup
Copy link
Contributor Author

Currently GetFromHelm is failing in some cases. That function has to be improved.
Also configuration is to be enhanced so that adpaters can pass custom json path.

Copy link
Member

@Aisuko Aisuko left a comment

Choose a reason for hiding this comment

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

There are some suggestions, please take a look. And please add the test cases for all the functions, thanks.

utils/manifests/utils.go Show resolved Hide resolved
utils/manifests/getComponents.go Show resolved Hide resolved
utils/manifests/definitions.go Outdated Show resolved Hide resolved
@Revolyssup
Copy link
Contributor Author

I don't think that we should be bundling copies of the kubeopenapi-jsonschema tool into this repo.

Where else do you suggest the binaries to be?

@leecalcote
Copy link
Member

I don't think that we should be bundling copies of the kubeopenapi-jsonschema tool into this repo.

Where else do you suggest the binaries to be?

Imported dynamically

Signed-off-by: Ashish test <ashishjaitiwari15112000@gmail.com>
Signed-off-by: Ashish test <ashishjaitiwari15112000@gmail.com>
Signed-off-by: Ashish test <ashishjaitiwari15112000@gmail.com>
@Revolyssup
Copy link
Contributor Author

Revolyssup commented Aug 14, 2021

test code
v := "v1.9.7"
m := manifests.Config{
Name: "Istio",
MeshVersion: v,
Filter: manifests.CrdFilter{
RootFilter: []string{"$[?(@.kind=="CustomResourceDefinition")]"},
NamFilter: []string{"$..["spec"]["names"]["kind"]"},
NamePath: "@.spec.names.kind",
VersionFilter: []string{"$..spec.versions[0]", " --o-filter", "$[0]"},
GroupFilter: []string{"$..spec", " --o-filter", "$[]"},
SpecFilter: []string{"$..openAPIV3Schema.properties.spec", " --o-filter", "$[]"},
},
}
url := "https://raw.githubusercontent.com/istio/istio/1.9.7/manifests/charts/base/crds/crd-all.gen.yaml"
comp, err := manifests.GetFromManifest(url, manifests.SERVICE_MESH, m)
if err != nil {
fmt.Printf("%s", err.Error())
}
fmt.Println("Printing stuff: ", comp.Definitions[1])

utils/manifests/definitions.go Outdated Show resolved Hide resolved
utils/manifests/generateComponent.go Outdated Show resolved Hide resolved
utils/manifests/getComponents.go Show resolved Hide resolved
Signed-off-by: ashish <ashishjaitiwari15112000@gmail.com>
Signed-off-by: ashish <ashishjaitiwari15112000@gmail.com>
utils/manifests/definitions.go Outdated Show resolved Hide resolved
utils/manifests/utils.go Show resolved Hide resolved
utils/manifests/utils.go Show resolved Hide resolved
utils/manifests/definitions.go Outdated Show resolved Hide resolved
Signed-off-by: ashish <ashishjaitiwari15112000@gmail.com>
@Revolyssup Revolyssup removed the pr/draft WIP/Draft pull request label Aug 24, 2021
Signed-off-by: ashish <ashishjaitiwari15112000@gmail.com>
Copy link
Contributor

@DelusionalOptimist DelusionalOptimist left a comment

Choose a reason for hiding this comment

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

Looks good to me.

utils/manifests/generateComponent.go Outdated Show resolved Hide resolved
utils/manifests/generateComponent.go Outdated Show resolved Hide resolved
utils/manifests/generateComponent.go Outdated Show resolved Hide resolved
utils/manifests/utils.go Outdated Show resolved Hide resolved
utils/manifests/utils.go Outdated Show resolved Hide resolved
Signed-off-by: ashish <ashishjaitiwari15112000@gmail.com>
Copy link
Member

@tangledbytes tangledbytes left a comment

Choose a reason for hiding this comment

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

LGTM

@tangledbytes tangledbytes merged commit cf815c2 into meshery:master Aug 25, 2021
@welcome
Copy link

welcome bot commented Aug 25, 2021

Thanks for your contribution to the Layer5 community! 🎉

Congrats!

@Revolyssup Revolyssup deleted the Revolyssup/generatingComponents branch August 25, 2021 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants