Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

pkg/components/util: improvements #605

Merged
merged 4 commits into from
Jun 16, 2020
Merged

pkg/components/util: improvements #605

merged 4 commits into from
Jun 16, 2020

Conversation

invidian
Copy link
Member

@invidian invidian commented Jun 9, 2020

This PR removes dead code from pkg/k8sutil package and simplifies the code a bit in pkg/components/util package to make split of this package easier in the future.

This PR also addresses some improvement proposals from #266.

This PR starts untangling the dependencies across our code base, which include:

  • cli/cmd package should not need pkg/k8sutil, but should use some higher-level abstraction for it
  • pkg/components/util/helm.go code should live in either pkg/components or pkg/components/helm
  • LoadManifests from pkg/k8sutil package should live together with pkg/components/util/helm.go
  • k8sutil.NewClientset should be moved to internal/k8s package
  • test/component/util.CreateKubeClient duplicated functionality of k8sutil.NewClientset. CreateKubeClient should use NewClientset and only do error handling using testing.T

cli/cmd/component-apply.go Show resolved Hide resolved
pkg/components/util/install.go Show resolved Hide resolved
Part of #290

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Previously, we had InstallAsRelease and InstallManifests to be able to
conditionally install components using Helm and InstallComponent was a
wrapper on those 2 functions, controlling this functionality.

Now all components are being installed using Helm, so we no longer need
InstallAsRelease, so it can be merged into InstallComponent function.

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Now that we have component name available in metadata, we no longer need
to pass it explicitly to this function.

Part of #266

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
This commit moves ensuring that release namespace exists code into
separate function, so linter does not complain about function length and
potentially allows to test this bit of code independently.

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Copy link
Member

@knrt10 knrt10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 rest looks LGMT

Copy link
Member

@surajssd surajssd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok!

@invidian invidian merged commit b7da7fd into master Jun 16, 2020
@invidian invidian deleted the invidian/improvements branch June 16, 2020 15:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants