-
Notifications
You must be signed in to change notification settings - Fork 14
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
Resource conversion, one solo-kit.json per project #214
Changes from all commits
8c2ee43
bf325a2
ce59e2f
c34db61
dab9a82
60b95e8
f86659b
7b570ae
6d83903
f2e706d
d590d90
dffee55
1b7e75e
095b0d4
fbce861
6e8b12e
48a812e
a948008
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,51 @@ | ||
{ | ||
"title": "solo-kit", | ||
"name": "kubernetes.solo.io", | ||
"version": "kubernetes", | ||
"go_package": "github.com/solo-io/solo-kit/pkg/api/v1/resources/common/kubernetes", | ||
"custom_resources": [ | ||
{ | ||
"package": "github.com/solo-io/solo-kit/api/external/kubernetes/pod", | ||
"type": "Pod", | ||
"plural_name": "pods", | ||
"short_name": "p" | ||
}, | ||
{ | ||
"package": "github.com/solo-io/solo-kit/api/external/kubernetes/namespace", | ||
"type": "KubeNamespace", | ||
"plural_name": "kubenamespaces", | ||
"short_name": "kn" | ||
}, | ||
{ | ||
"package": "github.com/solo-io/solo-kit/api/external/kubernetes/configmap", | ||
"type": "ConfigMap", | ||
"plural_name": "configmaps", | ||
"short_name": "cm" | ||
}, | ||
{ | ||
"package": "github.com/solo-io/solo-kit/api/external/kubernetes/service", | ||
"type": "Service", | ||
"plural_name": "services", | ||
"short_name": "svc" | ||
}, | ||
{ | ||
"package": "github.com/solo-io/solo-kit/api/external/kubernetes/deployment", | ||
"type": "Deployment", | ||
"plural_name": "deployments", | ||
"short_name": "dp " | ||
}, | ||
{ | ||
"package": "github.com/solo-io/solo-kit/api/external/kubernetes/customresourcedefinition", | ||
"type": "CustomResourceDefinition", | ||
"plural_name": "customresourcedefinition", | ||
"short_name": "crd " | ||
} | ||
] | ||
"api_group": { | ||
"name": "kubernetes.solo.io", | ||
"resource_group_go_package": "github.com/solo-io/solo-kit/api/external/kubernetes/group", | ||
"version_configs": [ | ||
{ | ||
"version": "kubernetes", | ||
"go_package": "github.com/solo-io/solo-kit/pkg/api/v1/resources/common/kubernetes", | ||
"custom_resources": [ | ||
{ | ||
"package": "github.com/solo-io/solo-kit/api/external/kubernetes/pod", | ||
"type": "Pod", | ||
"plural_name": "pods", | ||
"short_name": "p" | ||
}, | ||
{ | ||
"package": "github.com/solo-io/solo-kit/api/external/kubernetes/namespace", | ||
"type": "KubeNamespace", | ||
"plural_name": "kubenamespaces", | ||
"short_name": "kn" | ||
}, | ||
{ | ||
"package": "github.com/solo-io/solo-kit/api/external/kubernetes/configmap", | ||
"type": "ConfigMap", | ||
"plural_name": "configmaps", | ||
"short_name": "cm" | ||
}, | ||
{ | ||
"package": "github.com/solo-io/solo-kit/api/external/kubernetes/service", | ||
"type": "Service", | ||
"plural_name": "services", | ||
"short_name": "svc" | ||
}, | ||
{ | ||
"package": "github.com/solo-io/solo-kit/api/external/kubernetes/deployment", | ||
"type": "Deployment", | ||
"plural_name": "deployments", | ||
"short_name": "dp " | ||
}, | ||
{ | ||
"package": "github.com/solo-io/solo-kit/api/external/kubernetes/customresourcedefinition", | ||
"type": "CustomResourceDefinition", | ||
"plural_name": "customresourcedefinition", | ||
"short_name": "crd " | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
changelog: | ||
- type: NEW_FEATURE | ||
description: Generate converters for multi-version resources. | ||
issueLink: https://github.com/solo-io/solo-kit/issues/215 | ||
- type: BREAKING_CHANGE | ||
description: Redefine solo-kit project concept to better support multi-version resources. | ||
issueLink: https://github.com/solo-io/solo-kit/issues/215 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package crd | ||
|
||
import ( | ||
"github.com/solo-io/solo-kit/pkg/utils/protoutils" | ||
) | ||
|
||
func Copy(src, dst SoloKitCrd) error { | ||
srcBytes, err := protoutils.MarshalBytes(src) | ||
if err != nil { | ||
return err | ||
} | ||
err = protoutils.UnmarshalBytes(srcBytes, dst) | ||
if err != nil { | ||
return err | ||
} | ||
return nil | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are we doing this copy? there's a resources.Clone function There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The copy needs to happen in place onto |
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: