This change causes the linter to be a bit more complainy. The hope is
that this will cut down on some of the more pedantic issues being caught
in code reviews, and thus reduce the overall time a change spends in the
review process.
This change includes various changes to the codebase to bring it up to
the new standards.
Change-Id: I570d304bca5554404354f972d8a2743279a0171b
Each of these include an option for --current-context that set or retrieves
the curret context
This patchset mainly creates the cmd/config and pkg/config require additions
Also includes a fync getCurrentContext(<CLUSTERTYPE>) in the config pkg
that other modules should rely on.
Introduces new ErrMissingConfig and ErrConfigFailed types been used by
set-context, will decimate through get/ and set/get cluster after this is
reviewed.
Change-Id: I501483a9db99f33f860eaf329a65bb0209b2aaff
This removes the SampleSystem testing variable and replaces it by a
function which generates the object. This guarantees that the test
system has the same initial configuration for each test regardless of
the order in which tests are run.
Change-Id: I9875723ac4194425674c2806cf099509f94ad771
This commit changes several unit tests to set a "workspace" in a temp
directory. This completely isolates them from other tests as well as the
developer's environment.
Change-Id: Ifa1048c427dc3d69e15dae04318c7d8463b8f8e1
* This removes unneeded variables and complexity from the
reconcileClusters function.
* It also adds a unit test for said function, slightly increasing overall
unit test coverage
* Finally, this also addresses an issue in the rmConfigClusterStragglers
function in which the clusters entry was not cleaned up in spite of
being empty.
Change-Id: I9e7535305840db5f2fb763452d5e4ef46be467c9
Prior to this commit, NewConfig was setting up a new Config object and
filling it with a new kubeconfig object. The process for creating a
kubeconfig object has the potential to return an error. This commit
removes the creation of that object from NewConfig, delegating creation
of kubeconfig objects to more appropriate functions, such as LoadConfig.
Change-Id: I57a040f2e76bbc003eb82171f382e80425b37870
This commit removes any assertion from Go's "testing" package,
preferring instead to use an assertion from the testify package. All
tests now have uniformity.
This also decrease the number of iterations in the password generation
test, decreasing test runtime tenfold
Change-Id: I8799110e93dfa19bebe9050528e865b4c991c3df
* This also makes some minor newline changes to output.
* This also changes the behavior of nil objects to compare equal to
other nil objects. This follows the pattern of builtin Go types.
Change-Id: I10d99bbd5251db594a302ca65cd21917804d6a20
This implementation creates named references between an airship
config file , and a user specified or system default kubeconfig file
airshipconfig location can be specified via an envirnment variable
or via
--airshipconf string Path to file for airshipctl configuration.
(default ".airship/config")
kubeconfig has to be explicitly stated using the argument below
--kubeconfig string Path to kubeconfig associated with airshipctl
configuration. (default ".airship/kubeconfig")
if the argument is not specified a default empty kubeconfig will be
used using the default ".airship/kubeconfig"
All subcommands exposed via airshipctl config will update airship
config and airship related kubeconfig
when appropriate.
This patchset adds :
- Config Struct (type)
- config cmd and pkg
- get_cluster : List a specific name cluster or
List all clusters if no name is provided.
- set-cluster : Create or Modify an existing cluster.
Review comment fixes as of Pathset 19
- Moved core functionality from cmd to pkg
- Encapsulate cmd needs in pck in nw files cmds, cmds_types and cmds_test .
Expectation is that other functions will need func an structs there.
- added test for GetCluster
- Added GetCluster method to config object to be used by get_cluster command
- Change ClusterNames func as per review suggestion
- Change TestEmpty Cluster to avoid pointing to non test kubecnfig by default
- Change constant AirshipConfigFilePath to AirshipConfigDir
- Renamed config_utils to utils
- Added config cmd output tests
- Changes to settings_test.go to clean after itself.
- Created new pkg/config/testdata/GoldenString for struct data comparison values to avoid confusion
- Fix small get_cluster no name issue when empty config
- Fix issue when reconciling a cluster info that only exists in airship config and not in kubeconfig
Increased coverage to: SUCCESS: Test coverage is at 84.2%,
Started to move all testdata to a single place under pkg/config for now.
Change-Id: I7aae1f15afaebc99407f7fabccecf86ab0923bc3
This commit adds small helper function in testutils module, that would
help with testing modules that relay on bundle interface. The function
will take directory with testdata as a parameter, and load all files in
it into its fakefile system, allowing bundle to get those files and
render required yaml/kustomize files storing them as airship documents
in the returned bundle.
Change-Id: Ib55180cc720c42cab77626601d9ec0d6151b8454
This commit implements redfish remote direct subcommand
under bootstrap.
Change-Id: Idf97445f6fa59a77145eae1edaa15b1d22723f19
Signed-off-by: Kanwar Saad Bin Liaqat <kanwar.sbl@gmail.com>
This commit moves Write function to separate yaml package, and makes
it available to anyone for dumping documents in single file, with
correct yaml separators '---', '...'.
This will allow, for example dumping of filtered from bundle documents
to disk or any writer, like Stdout, for debugging purposes. Specifically
it will be used as part of `airshipctl cluster initinfra` command as a
buffer for delivering resources to kubernetes cluster.
Change-Id: I780e3f2d2ff446b8787153f500d04d10487ed71b
This introduces two new interfaces to airshipctl:
* Bundle: represents a Kustomize rendered
collection of your documents that allows you to
iterate over or filter the documents in the bundle.
* Document: a thin wrapper around a rendered
document.
This commit also includes a proposal for a way to
represent YAML test fixtures as testdatafs.go
and a new testdata subfolder within the document
pkg.
Change-Id: I4282b27977617552c25c5ae2c3b7da44e67dd014
This commit adds a custom encapsulated Logger, which then has its
methods exposed in a controlled fashion. This prevents external
libraries from modifying things such as the flags passed to the logger,
or where it should output to.
Change-Id: Ide4321246b1277fcee51608aa95532b8696b9777
This fixes a bug where `make cover` was missing packages. The target now
covers all code except for code placed in the top level package (such as
main.go) and anything placed in the testutils directory.
This also fixes minor issues with the Dockerfile and the coverage_check
script
Note that this commit also strives to increase code coverage beyond the
80% margin
Change-Id: I9e1cbcf841cc869345a00f05e39774cb3da10065
This adds the "airshipctl document" tree of commands, as well as one of
its leaf commands, "generate masterpassphrase".
Change-Id: I2365ebe67b38ebbbe4873c6e1beb6407f0e000eb
This PS adds the skeleton for a set of zuul checks and gates for
airshipctl and removes the travis config.
This PS also removes some dead code from the util package. This change
is required to get unit tests passing.
Change-Id: Ifb1be49cb1bb82c62a0085b6da9b8ff1b261a95b
This is a drop-in of the argo cmd package, with some slight tweaks to
adhere to airshipctl's models and linter. It still needs to be combed
over and modified to meet airshipctl's needs, as well as requiring unit
tests