This patch adds methods and repository stucts that will allow easily
clone/pull/update repositories that are defined in config.manifests.
Change-Id: I3789acd79d2072a2b90ed3bbaff99767070334e5
For cluster names that contain underscore ('_') symbol config module
removed some part of the name due to hardcoded indexes after name split
Change-Id: Ibd1e9b3ef2fce7e43cbdf41f4b1852933a253868
This change replaces the usage of the clientcmd's PathOptions with a
simpler filepath approach. The handling of the kube config file
associated with airshipctl is now entirely managed by airshipctl.
This also introduces the environment variable AIRSHIP_KUBECONFIG, which
can be used to override the default location for airship's kube config.
It can in turn be overridden by the command line argument.
Prior to this change, the kube config object was created by creating a
kubernetes client, then stripping off that client's config object. As a
side effect, this change removes the middleman, and creates the kube
config object directly from file.
Change-Id: I99ba88d50a0f45c40597a58fe4b3fdfeb7d1467d
Fixes possible name collisions between variable names and package names
Remove redundant import naming
Use nil slices for slice declarations instead of empty slices
Use make for slices of fixed lengths
Remove redundant parentheses
Replace deprecated `SetOutput` method with `SetOut`
Fix swapped actual/expected arguments on assertEqualGolden
Change-Id: Ia39ef44372c3e44948e5440575125bdb470898df
to manage authentication information for clusters.
Includes username/password, certificate
and token options.
Change-Id: If95e5bbf5c3ddc4732465e81de407d5ad416e8f2
The EnsureComplete method needs to perform various validations on a
Config object. This commit adds the missing validations for Manifests.
Change-Id: Ib562a67eefbbf19eb64444c4a811d946a9c8e170
Config.Clusters should be indexed only by "simple" cluster names
(without _ephemeral or _target postfixes). This fixes an index
that indexed by the "full" cluster name defined in the kubeconfig,
in some cases resulting in a nil pointer dereference.
Change-Id: Ic7a4b46419354d5755ccea58ff73c5fbbc4d9658
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 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