aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin/internal
AgeCommit message (Collapse)AuthorFilesLines
2020-03-18Added the new plugin_collection_v2 script.Rajamohan Raj1-1/+1
The script calls the major creation APIs in v2 starting from project api, composite app, composite profile, generic placement intent & deployment intent. This should be used every time we need to test the Instantiation code. Also added the helm charts for composite app consisting of collectd and prometheus. Issue-ID: MULTICLOUD-1035 Signed-off-by: Rajamohan Raj <rajamohan.raj@intel.com> Change-Id: I95237c234cca674dd54f4ef7527083b5cf3e0a55
2020-03-10Handle uncommon format of proper tar archiveKonrad Bańka2-2/+46
Provide proper handling of tar archives containing "current directory", but stored in format: ``` . file2.txt dir1/ dir1/file1.txt ``` instead of typical: ``` ./ ./file2.txt ./dir1/ ./dir1/file1.txt ``` Issue-ID: MULTICLOUD-1025 Signed-off-by: Konrad Bańka <k.banka@samsung.com> Change-Id: Ideffd019255a9f2d029527066e5a6a03d45a2d7b
2020-02-20Provide OverrideParameters capability for infra_workload APIKonrad Bańka1-1/+10
Provide parameters provided in sdnc, oof and user directives as override parameters for instantiate call. Issue-ID: MULTICLOUD-838 Signed-off-by: Konrad Bańka <k.banka@samsung.com> Change-Id: I69c6dab82ee233b2365a656bfaf1c7d64e375c98
2020-01-17Merge "Add readme.md for database shim layer"Ritu Sood1-0/+123
2020-01-03Merge "Add support for override values"Ritu Sood1-9/+18
2019-12-31Add readme.md for database shim layerKiran Kamineni1-0/+123
Add some documentation related to how the mongo backend is implemented Issue-ID: MULTICLOUD-666 Change-Id: I9dae429b1da004fbaa7ea694e6e58fa2d337a042 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-12-30Add support for a default profileKiran Kamineni2-0/+76
Added support for a default profile A profile with the name "default" gets created automatically when a rb definition is uploaded. Issue-ID: MULTICLOUD-885 Change-Id: I2baab179ff119f3e6335643ff619f071f11b017a Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-12-20Update write to store dataKiran Kamineni1-0/+14
This is to support multiple calls that might hit the database such as creation of profile within another definition create. Issue-ID: MULTICLOUD-666 Change-Id: I2cb8e705eaa5f825936156d7c626f16f373e28c0 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-12-19Add support for override valuesKiran Kamineni1-9/+18
Add support for override values which are equivalent to HELM --set options. A typical JSON with this option would look like this: { "rb-name": "edgex", "rb-version": "v1", "profile-name": "profile1", "override-values": { "edgex-core-consul.enabled": "false", "edgex-core-data.enabled": "false" }, "cloud-region": "k8sregionone" } Issue-ID: MULTICLOUD-863 Change-Id: I050b4c1a2922bfe1206964a0135863448638e4ef Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-12-11Fix ensureNamespace behavior failing on missing nsKonrad Bańka1-1/+4
The behavior is now amended to ignore namespace not found errors. Signed-off-by: Konrad Bańka <k.banka@samsung.com> Issue-ID: MULTICLOUD-955 Change-Id: Ifc180eca9e8195c38f0b0f268dd142a329405d3d Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-12-09Use http when not using tlsKiran Kamineni1-1/+6
Issue-ID: MULTICLOUD-666 Change-Id: I8838fb2d312c841fd421d0a887bcfe181f6281e9 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-12-06Set proper defaults for etcd configurationKiran Kamineni1-3/+3
Issue-ID: MULTICLOUD-666 Change-Id: I662555822b0bcf7264b64bbee9ff3760913be873 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-11-08Update logutils to support multiple fieldsKiran Kamineni2-12/+44
Added support for multiple fields and updated instancehandler and app/client.go to use the new functions Issue-ID: MULTICLOUD-577 Change-Id: I7cc04f67e72448aa121d10cfd80d66d544981933 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-11-01Check for err when namespace plugin returnsKiran Kamineni1-1/+8
Check for err when a namespace GET is called. This will catch any errors related to the cluster GET operations before the subsequent call is made. Issue-ID: MULTICLOUD-666 Change-Id: I47de130f7ae9e6fea627f3a881ea84b2880db886 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-10-25Implementing suggested changessanjaymekhale1-0/+15
Renamed package from logs to logutils Issue-ID: MULTICLOUD-577 Change-Id: I05e2acbfbb5dd79bd26df73e0ad64c2068b9f6e5 Signed-off-by: sanjaymekhale <sm00557598@techmahindra.com>
2019-10-15Add unit testsKiran Kamineni1-0/+122
Add unit tests for the handler as well as backend status function Issue-ID: MULTICLOUD-675 Change-Id: I4c73e2c18f243702f3e791fec48d4bc5023cafd5 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-10-15Add a status getter api endpointKiran Kamineni1-4/+52
Add a status endpoint to get status of instances. Status information will be added to the database asynchronously. Issue-ID: MULTICLOUD-675 Change-Id: Ia7d79a6f18f01bf24f2690caf74a48c2a082bd73 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-09-13Update to kubernetes 1.14.1Kiran Kamineni2-4/+4
Updated package to use kubernetes 1.14.1 Also updated the other packages that no longer worked because of this change. Issue-ID: MULTICLOUD-666 Change-Id: Ibfdf7215d8d7beceabe1bf895a356017da0b7d9c Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-09-05Merge "Remove ovn4nfvk8s network plugin"Ritu Sood1-2/+0
2019-09-05Merge "Add a namegenerator package"Ritu Sood2-10/+151
2019-09-05Remove ovn4nfvk8s network pluginKonrad Bańka1-2/+0
As ovn4nfv networks are now handled on k8s side by created CRD, this plugin is no longer necessary. Removed all references to ovn Issue-ID: MULTICLOUD-733 Signed-off-by: Konrad Bańka <k.banka@samsung.com> Change-Id: I7ad6c6d9b3b4fd8f249796f437e69c7df4e701cc
2019-09-04Fix test failure in threaded testsKiran Kamineni1-4/+4
Fix bug in tests where they can fail in highly threaded environments where a file can be accessed by two test processes. Fixed it by duplicating the test case. Issue-ID: MULTICLOUD-689 Change-Id: I93b9862fac52eb307e52c355e3cb0d4332768b4f Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-08-26Add a namegenerator packageKiran Kamineni2-10/+151
Adds a namegenerator package which generates readable names for instances. This will go with a small change in the API where we expect instance names and will generate the names if they are not provided. Issue-ID: MULTICLOUD-716 Change-Id: I69d8b7fb62667b8b60f3e02eb26dc937961d26d2 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-08-19Merge "Add query parameters support to instance API"Ritu Sood2-155/+85
2019-08-13Add query parameters support to instance APIKiran Kamineni2-155/+85
Add support for query parameters to find instances with rb-name, rb-version, profile-name as query parameters eg: curl IP:PORT/v1/instance?rb-name=test&rb-version=v1 Issue-ID: MULTICLOUD-662 Change-Id: If68c87885c8b8dd097cbb3860e8c7320310a6ef7 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-08-13Fix bug in tagging podTemplatesKiran Kamineni1-24/+11
Fix a bug in tagging podTemplates Using the runtime converter to convert unstructured map data to podTemplateSpec now. Issue-ID: MULTICLOUD-675 Change-Id: I661d3c63ae39b3533bb9c0a9934fc507284c7074 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-08-07Add custom label to track created resourcesKiran Kamineni6-34/+108
Create a custom label on created resources Also, create it on pods where pods are being created. This will help us later for filtering and querying pods and resources. Issue-ID: MULTICLOUD-675 Change-Id: I4b4fce7b67f9f27559d99dcca94a9191b96cb7c6 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-08-05Merge "Minor improvement to log statements"Bin Yang2-5/+2
2019-07-23Merge "Add a listallhandler to definitions api"Bin Yang1-1/+4
2019-07-23Merge "Add port to ovn central ip"Bin Yang1-1/+1
2019-07-23Merge "Add a list api for instances"Bin Yang1-0/+42
2019-07-22Add port to ovn central ipKiran Kamineni1-1/+1
Add port to the default OVN central ip field. Issue-ID: MULTICLOUD-666 Change-Id: Ib1644aafc00472769422dffd48a83ed7e53b2910 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-07-22Minor improvement to log statementsKiran Kamineni2-5/+2
Removing some log statements that are cluttering the output. Added a log statement to print errors during instantiation. Issue-ID: MULTICLOUD-666 Change-Id: I76ad59c9cb36b5cb999573afec18e6f1adbed4ad Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-07-18Add list api for profilesKiran Kamineni2-1/+137
Add a list api for profiles for a specific definition and version. GET /v1/rb/definition/name/version/profile will list all the profiles. Issue-ID: MULTICLOUD-730 Change-Id: If1b8e6910c276a0f7139ab13340721c6ec8a49e8 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-07-18Add a listallhandler to definitions apiKiran Kamineni1-1/+4
GET calls to the v1/rb/definition will return all definitions and their versions Issue-ID: MULTICLOUD-715 Change-Id: Ia0951ac83283830e475bf727e7d5ced7aab3add2 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-07-18Make profile db tags specificKiran Kamineni3-13/+13
Tags used in profile such as metadata are too generic. Instead we are using specific ones with the type prefixed. Issue-ID: MULTICLOUD-730 Change-Id: I2f189d35bc202f4a71e0a92ca5b7188ebfd1cef2 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-07-18Make definition tags specificKiran Kamineni4-19/+19
Tags used in db such as metadata are too generic. Instead we are using specific ones with the type prefixed. Issue-ID: MULTICLOUD-730 Change-Id: Ice76cf743f0782a3d7e76747cde1f0e0b116b14e Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-07-18Add a list api for instancesKiran Kamineni1-0/+42
curl -X GET /v1/instance returns all the instances created. It returns abbreviated instances for improved readability. For details on what resources were created for each instance, use the ID with GET. Issue-ID: MULTICLOUD-715 Change-Id: I05afe0fd2c254acbca4329289c81545f95c9fac5 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-07-16Remove kubeconfigdir. Use a tempfile insteadKiran Kamineni3-11/+12
Kubeconfigdir does not need to be a configurable parameter. We just create a local file and use that to create the config after which it is not needed. Issue-ID: MULTICLOUD-614 Change-Id: I2df561d50b620e24c5ae5266b7200210e0c11caf Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-07-16Merge "Move connectionhandler.go into api package"Bin Yang1-144/+0
2019-07-16Merge "Add getconnectivityrecordbyname function"Bin Yang1-2/+43
2019-07-11Create dir before extracting archiveKiran Kamineni3-11/+22
Some archives don't include a directory entry. Eg: tgz archives generated by helm package. This bug fix checks that a directory exists before an extracted file is created there. Issue-ID: MULTICLOUD-705 Change-Id: If6720948d470b83786901574f5d8d3227835a047 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-06-26Move connectionhandler.go into api packageKiran Kamineni1-144/+0
Move connectionhandler.go into api package This brings it inline with the other API handlers Issue-ID: MULTICLOUD-666 Change-Id: Ia3b832159f537c6d8d8ecc93b56bc9b085649f7e Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-06-26Add getconnectivityrecordbyname functionKiran Kamineni1-2/+43
Plugins need this connectivity information Adding code to retrieve it Issue-ID: MULTICLOUD-688 Change-Id: I5fa1b69cdad754a432316edc4188c19b7fe10f84 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-06-24Change the import paths for go get accessKiran Kamineni17-34/+34
This allows other projects to do a go get and use this repo. go get github.com/multicloud-k8s/src/k8splugin will do the job. import github.com/multicloud-k8s/src/k8splugin will import the root package Issue-ID: MULTICLOUD-666 Change-Id: I2f41c88c5a7fb3305b78cce8a83a0e102baa444c Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-06-06Plugin code refactoringKiran Kamineni3-148/+127
The plugin code has been refactored to implement a common interface. This will allow us to do plugin validation at loadtime of the plugin instead of at runtime. This also makes the code calling the plugins cleaner and easier to read. Issue-ID: MULTICLOUD-557 Change-Id: Ice2bcc9b850d7c0e1707dcc42132c63dd77472a7 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-05-23Update broker responses to match spec and SOKiran Kamineni3-27/+63
The broker responses need to match the spec and what SO expects as responses. CREATE_COMPLETE instead of CREATED in both POST and GET DELETE now returns a response body GET by name is now supported Name is an alias for vf_module_id which is expected to be provided as an attribute in sdnc_directives in the original POST request Issue-ID: MULTICLOUD-645 Change-Id: Ifeca755a07298d0a858cbe9e80f9ce654d6d21b8 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-05-22Minor change to instance responseKiran Kamineni3-96/+117
Minor change to instance response. Now it includes the full request parameters in the response. Issue-ID: MULTICLOUD-649 Change-Id: Ia4a7e479f842dd580bcfb13aa91dc0b0a456cf25 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-05-20Print error message for etcd connection failureKiran Kamineni1-1/+1
Error message during client creation needs to be printed. Issue-ID: MULTICLOUD-637 Change-Id: Ic3929ae774235133673032e35a2388d2e0b98d36 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
2019-05-15Move config to app and connect to instanceKiran Kamineni3-12/+50
Move config instantiation to app and connect it to the instance to allow updates and so on. Issue-ID: MULTICLOUD-464 Change-Id: Ic994ef78a6e0d2db5e695e33b7b8a302c74c10da Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>