aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin/internal
AgeCommit message (Collapse)AuthorFilesLines
2019-04-16Replace Kind with GroupVersionKindKiran Kamineni9-221/+384
Kind is not unique to track resources in Kubernetes GroupVersionKind is unique. We are just using that to track our data. It is abstracted behind a couple of new types for templates and resources. This change makes a lot of the old kind based operations redundant and simplified. Issue-ID: MULTICLOUD-573 Change-Id: I8f4ded2ba6a0821a8fbd679dc99ce3a44d805524 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-04-16Rename plugin reference interfaceKiran Kamineni1-7/+8
Rename the plugin interface to something more relevant. KubernetesResource will be used to describe resources for creation. Issue-ID: MULTICLOUD-557 Change-Id: I2fff5363b897b968e95b26257d8f26509fb567fd Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-04-12Merge "Add Connectivity Info API"Bin Yang2-0/+247
2019-04-12Merge "Day 2 Configuration API's"Bin Yang7-0/+1578
2019-04-11Add Connectivity Info APIrsood2-0/+247
API to add connectivity information for Cloud Regions to K8s Plugin https://wiki.onap.org/display/DW/MultiCloud+K8s-Plugin-service+API%27s Change-Id: I0a9166df9b076a7fdacf0b2f9e51a9cdebe4b621 Signed-off-by: rsood <ritu.sood@intel.com> Issue-ID: MULTICLOUD-292 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-04-11Merge "Add option to start https listener"Bin Yang2-0/+154
2019-04-10Add option to start https listenerKiran Kamineni2-0/+154
Added support for tls connection for k8splugin. It will load the certificates from its current folder. Any installer needs to just put these files in the same folder as the executable and it will pick them up and start in https mode. Issue-ID: MULTICLOUD-570 Change-Id: I505135daa3933b76023c941e7bee54be65fa791f Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-04-11Day 2 Configuration API'srsood7-0/+1578
This patch adds Configuration API's https://wiki.onap.org/display/DW/MultiCloud+K8s-Plugin-service+API%27s Change-Id: I52ebfc5aa980ec8af4a31569d569216e9a2a760c Issue-ID: MULTICLOUD-464 Signed-off-by: rsood <ritu.sood@intel.com>
2019-04-10Add support for generic pluginKiran Kamineni1-4/+128
Add support for generic kinds We are currently using a known map to find the group version resource for a kind. Issue-ID: MULTICLOUD-350 Change-Id: I5a64f73760b73cf92b9a3fab8c22ad54e0a5f84f Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-04-10Export kubernetesClientKiran Kamineni3-12/+12
Export kubernetesClient. There are situations where this will need to be accessed in the plugins and we need the definition to be exported for that. Issue-ID: MULTICLOUD-350 Change-Id: I9eee03ea77e390effd33ed96cbbc25dc4cd09cdd Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-04-04Use consistent naming for Name and VersionKiran Kamineni4-38/+39
Definition Name and Definition Version are now using the consistent naming similar to the Profile and instance structure. Name becomes RBName Version becomes RBVersion Issue-ID: MULTICLOUD-350 Change-Id: Ifc329d4979a06cb017c6f9d916c227c696b664e0 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-04-03Refactor instance codeKiran Kamineni5-288/+613
Issue-ID: MULTICLOUD-350 Change-Id: I2574d94e4ebada1e138913b2a03549dd90906d7b Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-04-02Merge "Make profile key explicit"Victor Morales4-37/+37
2019-04-01Remove build tagsKiran Kamineni11-22/+0
Remove build tags as this is causing issues where mock plugins need to be loaded into files that do unit testing as well. Full integration testing is being done in the CSIT. Issue-ID: MULTICLOUD-559 Change-Id: Icd147dac80d16a6fb8f33048c76d4083158cecd2 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-03-29Make profile key explicitKiran Kamineni4-37/+37
Using profilename instead of name in the db key protects it from getting overwritten by anything else that might use name as a key. Using explicit key names makes sure that we don't have to add bson structure tags in the code. Issue-ID: MULTICLOUD-558 Change-Id: I9bd6f757496af22d8662b0d114f0ef7d33a5784a Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-03-29Fix merge issueKiran Kamineni1-2/+2
The TestUpdate method was updated properly with the merge on to master. This fixes that issue. Issue-ID: MULTICLOUD-553 Change-Id: I97c95b628fade37304590de59bb4bb6faaeb4450 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-03-29Merge "Add update method to db interface"Bin Yang5-1/+132
2019-03-27Add update method to db interfaceKiran Kamineni5-1/+132
Add update interface to the db. This will allow us to support PUT http methods in the future. Issue-ID: MULTICLOUD-553 Change-Id: I7263d42e893734eadbdaf78022005d6004601772 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-03-26Update definition and profile to latest specKiran Kamineni9-420/+435
Bringing all the definition and profile code upto the latest spec. Integrated the end to end instance code changes that were made. P9: Added updated plugin.sh with updated uri paths based on spec Issue-ID: MULTICLOUD-291 Change-Id: Id6e3c6bc2cd02cfb7005e203ccf03e0793b97e95 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-03-26Merge "Fix namespace creation"Bin Yang1-4/+1
2019-03-25Fix namespace creationRitu Sood1-4/+1
Namespace is being created by k8splugin if it doesn't exist. This is done before other resources are created in kubernetes. This patch removes check that failed if namespace didn't exist Change-Id: I8c5b2409ad1cf77d5f529f601870fcf87e8e8760 Signed-off-by: Ritu Sood <ritu.sood@intel.com> Issue-ID: MULTICLOUD-462
2019-03-25Add support for composite keysKiran Kamineni8-154/+224
Composite keys help us store objects which are unique for a given set of pre-existing objects. Eg: Many profiles can exist for a definition and its key will have a definition name as a part of the composite key. P2: Use a predefined interface for keys instead of generic interfaceP{} P3: Add check for empty strings in stringer interface P5: Add appropriate keys in other packages. Issue-ID: MULTICLOUD-531 Change-Id: I314b1fbd718489ae8a45f0f38915c08ca32f9f43 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-03-19Bring in all the other helper codeKiran Kamineni5-25/+357
Bring in all the helper functions added for end to end integration. This allows the api level upload of helm charts, profiles and also instantiation of said helm charts. P3: Plugin index is based on lowercase kind name whereas the map contains the correct case for kind. Convert to lower case before loading the plugin. Changes after rebasing on the new folder structure. Rebasing over the new folder structure P8: Add unit tests for Resolve function Fix the integration tests for createvnf I had to add a huge blob of base64 encoded data based on the profile and sample helm chart to test the flow. P12: Update the integration test with the rb_profile_id parameter Issue-ID: MULTICLOUD-291 Change-Id: If04c41cb185074989ab6c96557958140c43e456d Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-03-14Upgrade mongo driver to 1.0Kiran Kamineni2-52/+52
Mongo driver 1.0 was released recently Upgrading from 0.2.0 which we were on right now. Issue-ID: MULTICLOUD-530 Change-Id: I6d968e99b129d4307414ec31410505200b7bd47d Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-03-12Add support for helm templatesKiran Kamineni2-0/+454
Add support for evaluating helm templates The interface provides a way to get a map which contains a mapping from kubernetes kind to the corresponding yaml file that defines a resource of that kind. This map is then provided to the instantiation code at instantiation time to create in the kubernetes cluster. P5: Use filepath.join instead of strings.join P9: rebase with new folder structure P10: moved the helm code into its own package. P12: Add unit tests update the go.mod to use latest docker version Issue-ID: MULTICLOUD-291 Change-Id: Ie75f5c616cc0cdc3e0ace49ff2c2f6c356a4c0d1 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-03-12Merge "Add support for parsing profile yaml files"Victor Morales3-3/+253
2019-03-11Add support for parsing profile yaml filesKiran Kamineni3-3/+253
Add code to parse profile configuration yaml The parsing function is global and returns a client which can then be used to get or apply specific parts of the configuration on top of an extracted helm chart. P14: Add unit test that covers both ProcessProfileYaml and CopyConfigurationOverrides P15: Adding mock_charts and mock_profiles We expect to reuse these files for other unit tests Issue-ID: ONAPARC-348 Change-Id: I4504d0b158fdfef476b8c2a461d33306926545d7 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-03-11Detect chart nameKiran Kamineni2-4/+128
ChartName should not be mandatory field If not provided it will be detected by inspection of the tar.gz archive. Issue-ID: MULTICLOUD-525 Change-Id: Idaf9672f2cbbb882d78b1987467472ce73c651da Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-01-28Add support for downloading contentKiran Kamineni6-2/+400
Add support for downloading content for creating the merged helm charts. This api will be used mainly by the profile api to create a converged chart which will then be created by the instantiation code P2: Add unit tests for archive.go Add download method for profile.go Update comments for download method P3: Add unit test for empty files P4: Add unit tests for Download functions P5: Rebase against new folder structure Issue-ID: MULTICLOUD-291 Change-Id: I9779eaf95366f527f0360eaddea663722c13b196 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-01-25Move api.go functionsVictor Morales1-0/+72
CheckEnvVariables, CheckDatabaseConnection, LoadPlugins and CheckInitialSettings functions are utility functions which are not related with the API. These functions need to be moved to utils.go file. Change-Id: Ie6dfbafe8909962fba31534916a7e0f07ded116b Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-ID: MULTICLOUD-301
2019-01-25Use a standard Go project layoutVictor Morales19-0/+3473
This project wasn't following some Standard Go Project Layout guidelines(https://github.com/golang-standards/project-layout). This change pretends to organize the source code and following those guidelines. Change-Id: I61085ac20f28069cede013f83034bed06892d87c Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-ID: MULTICLOUD-301