-
Notifications
You must be signed in to change notification settings - Fork 49
(WIP) Refactoring loading of configuration, cluster operations management. #359
Commits on Apr 27, 2020
-
Renaming RootConfig to ClusterConfig as part of refactoring
Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 415eb0a - Browse repository at this point
Copy the full SHA 415eb0aView commit details -
- This adds clarity to the name of the struct as this deals with hcl config. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 639640d - Browse repository at this point
Copy the full SHA 639640dView commit details -
Refactor LoadConfig into load and parse functions
- This commit has been done to make the loading and parsing of the hcl files more testable. LoadConfig currently performs the task of loading the HCL files from the given path and parsing them to HCLConfig go struct. To make the code testable and the function is broken into LoadHCLFiles and ParseHCLFiles. LoadHCLfiles is an exported function for now , because it is called in cmd/utils.go in getLokoConfig function and I want to keep the commit atomic in nature. In further commits in this PR when cmd package is refactored, the function will be made unexported. ParseHCLFiles is exported becuase this function is used to parse HCL files and will be used in tests where a hcl config is loaded from string. loadLokocfgPaths function signature is changed to take the path of the hclfiles as well as extension. This change allows the user to not only provide a directory containing multiple '*.lokocfg' files but also multiple '*.vars' files. LoadValuesFile is refactored and renamed to LoadValues. The change is done so that instead of taking the path to a single vars file. LoadValues now accepts a list of hcl.File objects which allows the ability to load values from multiple vars files. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 638b3a3 - Browse repository at this point
Copy the full SHA 638b3a3View commit details -
Remove usage of anonymous struct in Packet.
- To remove the usage of anonymous structs, three new fields are added to `config` struct with a "Raw" suffix to distinguish between the fields that are used as in and those used to save data after unmarshalling. Doing this removes the need to create anonymous struct which in turns makes the go template that it renders cleaner (i.e `.Config` is removed ) Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for c184dec - Browse repository at this point
Copy the full SHA c184decView commit details -
Remove usage of anonymous struct in AWS.
- To remove the usage of anonymous structs, four new fields are added to `config` struct with a "Raw" suffix to distinguish between the fields that are used as in and those used to save data after unmarshalling. Doing this removes the need to create anonymous struct which in turns makes the go template that it renders cleaner (i.e `.Config` is removed ) Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for c8f1603 - Browse repository at this point
Copy the full SHA c8f1603View commit details -
Remove usage of anonymous struct in Baremetal.
- To remove the usage of anonymous structs, seven new fields are added to `config` struct with a "Raw" suffix to distinguish between the fields that are used as in and those used to save data after unmarshalling. Doing this removes the need to create anonymous struct which in turns makes the go template that it renders cleaner (i.e `.Config` is removed) Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 581807c - Browse repository at this point
Copy the full SHA 581807cView commit details -
Move verify.go to lokomotive package.
- install package consists of two files: install.go: which deals with configuring terraform. verify.go: which deals with verification of Lokomotive cluster. install package by its name and contents of the files serve no purpose, hence its files should be moved around to correct packages. - This commit deals with moving the verify.go file to lokomotive package. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for f8d7a12 - Browse repository at this point
Copy the full SHA f8d7a12View commit details -
Move install.go to terraform package.
- install package now consists of one file: install.go: which deals with configuring terraform. install package by its name and contents of the files serve no purpose, hence its files should be moved around to correct packages. - This commit deals with moving install.go file to terraform package. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 15e4814 - Browse repository at this point
Copy the full SHA 15e4814View commit details -
Make unnecessary exported functions as unexported.
Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for c3cf386 - Browse repository at this point
Copy the full SHA c3cf386View commit details -
Move template.go to util package
- This commit moves the template.go from pkg/components/utl to pkg/util - Update package references for pkg/components to include new package location Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 82e1a55 - Browse repository at this point
Copy the full SHA 82e1a55View commit details -
Add Render and Validate to Platform interface.
- Add placeholder methods for Render and Validate in all the supported platforms. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 70c9f2f - Browse repository at this point
Copy the full SHA 70c9f2fView commit details -
LokomotiveConfig struct for managing configuration.
- LokomotiveConfig acts as main placeholder for Lokomotive configuration, once the user provided configuration in `*.lokocfg` files is loaded and parsed. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for faaf2d8 - Browse repository at this point
Copy the full SHA faaf2d8View commit details -
Centralize loading of HCL files in one place.
- HCLLoader loads and parses the Lokomotive HCL configuration files into LokomotiveConfig struct. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for d0652dc - Browse repository at this point
Copy the full SHA d0652dcView commit details -
Add InitializeExecutor for terraform.Executor
- InitializeExecutor method returns the terraform.Executor Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 1716379 - Browse repository at this point
Copy the full SHA 1716379View commit details -
Add Manager interface for Lokomotive operations.
- Manager interface manages the operations involved in the lifecycle of a Lokomotive cluster. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for e88b944 - Browse repository at this point
Copy the full SHA e88b944View commit details -
Add implmentation of Manager interface.
- lokomotive provides an implmentation of the Manager interface. - currently the interface methods are implemented as placeholders. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for cf17899 - Browse repository at this point
Copy the full SHA cf17899View commit details -
Add method to create terraform cluster file.
- createTerraformClusterfile creates the `cluster.tf` file from the data string. - Update Configure method to take additional parameter of renderedPlatform Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 6b2c9cc - Browse repository at this point
Copy the full SHA 6b2c9ccView commit details -
- This commit refactors GetComponentBody to LoadComponentsFromHCLString - This removes the duplication of parsing the componenet configuration from string. LoadcomponentsFromString uses existing methods to parse the component string to Component instance. - Updates the tests in components pkg to reflect the same Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 1c0aa96 - Browse repository at this point
Copy the full SHA 1c0aa96View commit details -
Move utility functions to lokomotive package.
- As part of the refactor, all Lokomotive cluster related utility functions are ported to lokomotive package. Lokomotive package holds all the code related to management of Lokomtive cluster. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for b51b5b5 - Browse repository at this point
Copy the full SHA b51b5b5View commit details -
- Adds implmentations to placeholder methods. - Moves logic around cluster operations from cmd package to here. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for fe5abb9 - Browse repository at this point
Copy the full SHA fe5abb9View commit details -
Remove not needed functions from cmd/cluster.go
- removing the functions that are not needed anymore as their implmentations are ported to pkg/lokomotive package. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 2e73fea - Browse repository at this point
Copy the full SHA 2e73feaView commit details -
Update initialize method to use new methods.
- intitialize now makes use of the new refactor structs and methods. Loads the LokomotiveConfig and returns an instance of Manager interface for performing cluster operations. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 11049a7 - Browse repository at this point
Copy the full SHA 11049a7View commit details -
Update cluster-apply to use new changes.
- cluster-apply.go now mkes use of the refactored initialize function. - cluster related checks and operations are encapsulated in Apply method of lokomotive instance. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for f2b5e3c - Browse repository at this point
Copy the full SHA f2b5e3cView commit details -
Update cluster-destroy to use new changes.
- cluster-destry.go now mkes use of the refactored initialize function. - cluster related checks and operations are encapsulated in Destroy method of lokomotive instance. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 4c2fea2 - Browse repository at this point
Copy the full SHA 4c2fea2View commit details -
Update component-apply to use new changes.
- component-apply now mkes use of the refactored initialize function. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for aa48e04 - Browse repository at this point
Copy the full SHA aa48e04View commit details -
Update component-render-manifest to use new changes.
- component-render-manifest now mkes use of the refactored initialize function Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 4ead062 - Browse repository at this point
Copy the full SHA 4ead062View commit details -
Update health to use new changes.
- health now mkes use of the refactored initialize function. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 4ec3146 - Browse repository at this point
Copy the full SHA 4ec3146View commit details -
Change const to reflect consistency
- This commit changes the const `componentName` to `name` to reflect consistency across const across all components Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for bbf785d - Browse repository at this point
Copy the full SHA bbf785dView commit details -
Update component-delete to use new changes.
- Update Manager interface to include ComponentDelete - Add implementation of ComponentDelete to lokotive struct - Port component-delete functionality from cmd package to lokomotive package Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 064f9d0 - Browse repository at this point
Copy the full SHA 064f9d0View commit details -
Rename ContextLogger to Logger.
Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 5ddfb39 - Browse repository at this point
Copy the full SHA 5ddfb39View commit details -
Move verifyCluster to utils.go
Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for a397c04 - Browse repository at this point
Copy the full SHA a397c04View commit details -
Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 0020b44 - Browse repository at this point
Copy the full SHA 0020b44View commit details -
Update Platform interface to remove LoadConfig
- Since loading and parsing of the confguration is done in config/hcl_loader.go. This method is redundant and hence removed. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 9e4687c - Browse repository at this point
Copy the full SHA 9e4687cView commit details -
Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 5e38dce - Browse repository at this point
Copy the full SHA 5e38dceView commit details -
Remove Initialize method from Platform interface.
- The purpose of Initialize method was to create the terraform file for Terraform to execute. However with the refactor Render method renders the terraform template and passes the rendered string for further processing. The creation of the terraform file happens in the terraform package. Hnce removing the Initialize method from the interface. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for de469e4 - Browse repository at this point
Copy the full SHA de469e4View commit details -
Add validation of LokomotiveConfig
Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for e19d449 - Browse repository at this point
Copy the full SHA e19d449View commit details -
Make methods unexported if they are not needed
Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 3d14689 - Browse repository at this point
Copy the full SHA 3d14689View commit details -
Add validation to all platforms.
Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 09ba186 - Browse repository at this point
Copy the full SHA 09ba186View commit details -
Add unit tests for loading HCL configurations.
Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for b01bbac - Browse repository at this point
Copy the full SHA b01bbacView commit details -
Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 2377691 - Browse repository at this point
Copy the full SHA 2377691View commit details -
Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for 9dff2ce - Browse repository at this point
Copy the full SHA 9dff2ceView commit details -
- There are many tests which make using of a random number, which is then flagged as Magic Random number by linter. This causes to add '//nolint:gomnd' in a lot of places. Signed-off-by: Imran Pochi <imran@kinvolk.io>
Configuration menu - View commit details
-
Copy full SHA for e8a0019 - Browse repository at this point
Copy the full SHA e8a0019View commit details -
Configuration menu - View commit details
-
Copy full SHA for b13a203 - Browse repository at this point
Copy the full SHA b13a203View commit details