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

Commit

Permalink
pkg/platform/{aws,baremetal,packet}: remove charts extraction code
Browse files Browse the repository at this point in the history
This is now done in centralized place using Meta().ControlplaneCharts,
so this code becomes redundant and can be removed.

Signed-off-by: Mateusz Gozdek <[email protected]>
  • Loading branch information
invidian committed Dec 2, 2020
1 parent 984bc50 commit 45c0f6f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 46 deletions.
12 changes: 0 additions & 12 deletions pkg/platform/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/mitchellh/go-homedir"

"github.com/kinvolk/lokomotive/pkg/assets"
"github.com/kinvolk/lokomotive/pkg/oidc"
"github.com/kinvolk/lokomotive/pkg/platform"
"github.com/kinvolk/lokomotive/pkg/terraform"
Expand Down Expand Up @@ -156,17 +155,6 @@ func (c *config) Initialize(ex *terraform.Executor) error {
return err
}

// TODO: A transient change which shall be reverted in a follow up PR to handle
// https://github.com/kinvolk/lokomotive/issues/716.
// Extract control plane chart files to cluster assets directory.
for _, c := range platform.CommonControlPlaneCharts(!c.DisableSelfHostedKubelet) {
src := filepath.Join(assets.ControlPlaneSource, c.Name)
dst := filepath.Join(assetDir, "cluster-assets", "charts", c.Namespace, c.Name)
if err := assets.Extract(src, dst); err != nil {
return fmt.Errorf("extracting charts: %w", err)
}
}

terraformRootDir := terraform.GetTerraformRootDir(assetDir)

return createTerraformConfigFile(c, terraformRootDir)
Expand Down
12 changes: 0 additions & 12 deletions pkg/platform/baremetal/baremetal.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/mitchellh/go-homedir"

"github.com/kinvolk/lokomotive/pkg/assets"
"github.com/kinvolk/lokomotive/pkg/oidc"
"github.com/kinvolk/lokomotive/pkg/platform"
"github.com/kinvolk/lokomotive/pkg/terraform"
Expand Down Expand Up @@ -120,17 +119,6 @@ func (c *config) Initialize(ex *terraform.Executor) error {
return err
}

// TODO: A transient change which shall be reverted in a follow up PR to handle
// https://github.com/kinvolk/lokomotive/issues/716.
// Extract control plane chart files to cluster assets directory.
for _, c := range platform.CommonControlPlaneCharts(!c.DisableSelfHostedKubelet) {
src := filepath.Join(assets.ControlPlaneSource, c.Name)
dst := filepath.Join(assetDir, "cluster-assets", "charts", c.Namespace, c.Name)
if err := assets.Extract(src, dst); err != nil {
return fmt.Errorf("extracting charts: %w", err)
}
}

terraformRootDir := terraform.GetTerraformRootDir(assetDir)

return createTerraformConfigFile(c, terraformRootDir)
Expand Down
22 changes: 0 additions & 22 deletions pkg/platform/packet/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/mitchellh/go-homedir"

"github.com/kinvolk/lokomotive/pkg/assets"
"github.com/kinvolk/lokomotive/pkg/dns"
"github.com/kinvolk/lokomotive/pkg/helm"
"github.com/kinvolk/lokomotive/pkg/oidc"
Expand Down Expand Up @@ -172,27 +171,6 @@ func (c *config) Initialize(ex *terraform.Executor) error {
return err
}

// TODO: A transient change which shall be reverted in a follow up PR to handle
// https://github.com/kinvolk/lokomotive/issues/716.
// Extract control plane chart files to cluster assets directory.
for _, c := range platform.CommonControlPlaneCharts(!c.DisableSelfHostedKubelet) {
src := filepath.Join(assets.ControlPlaneSource, c.Name)
dst := filepath.Join(assetDir, "cluster-assets", "charts", c.Namespace, c.Name)
if err := assets.Extract(src, dst); err != nil {
return fmt.Errorf("extracting charts: %w", err)
}
}

// TODO: A transient change which shall be reverted in a follow up PR to handle
// https://github.com/kinvolk/lokomotive/issues/716.
// Extract host protection chart.
src := filepath.Join(assets.ControlPlaneSource, "calico-host-protection")
dst := filepath.Join(assetDir,
"cluster-assets", "charts", "kube-system", "calico-host-protection")
if err := assets.Extract(src, dst); err != nil {
return fmt.Errorf("extracting host protection chart: %w", err)
}

terraformRootDir := terraform.GetTerraformRootDir(assetDir)

return createTerraformConfigFile(c, terraformRootDir)
Expand Down

0 comments on commit 45c0f6f

Please sign in to comment.