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

Commit

Permalink
Merge pull request #935 from kinvolk/invidian/fluo-chart
Browse files Browse the repository at this point in the history
FLUO: convert to Helm chart
  • Loading branch information
invidian authored Sep 11, 2020
2 parents ee24a63 + f6a637c commit 99b250d
Show file tree
Hide file tree
Showing 17 changed files with 145 additions and 211 deletions.
23 changes: 23 additions & 0 deletions assets/charts/components/flatcar-linux-update-operator/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
23 changes: 23 additions & 0 deletions assets/charts/components/flatcar-linux-update-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v2
name: flatcar-linux-update-operator
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 0.7.3
Empty file.
5 changes: 0 additions & 5 deletions assets/components/README.md

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions pkg/assets/assets_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ func main() {
assets.TerraformModulesSource: "../../assets/terraform-modules",
assets.ControlPlaneSource: "../../assets/charts/control-plane",
assets.ComponentsSource: "../../assets/charts/components",
// This assets path is deprecated and should not be used for new components. It contains
// manifests for components which haven't yet been converted to Helm charts.
"/components": "../../assets/components",
}
err := assets.Generate("generated_assets.go", "assets", "vfsgenAssets", dirs)
if err != nil {
Expand Down
190 changes: 94 additions & 96 deletions pkg/assets/generated_assets.go

Large diffs are not rendered by default.

13 changes: 5 additions & 8 deletions pkg/components/flatcar-linux-update-operator/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ package flatcarlinuxupdateoperator

import (
"fmt"
"path/filepath"

"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/gohcl"

"github.com/kinvolk/lokomotive/pkg/assets"
"github.com/kinvolk/lokomotive/pkg/components"
"github.com/kinvolk/lokomotive/pkg/components/util"
"github.com/kinvolk/lokomotive/pkg/k8sutil"
)

Expand All @@ -43,14 +42,12 @@ func (c *component) LoadConfig(configBody *hcl.Body, evalContext *hcl.EvalContex
}

func (c *component) RenderManifests() (map[string]string, error) {
ret := make(map[string]string)
walk := assets.DumpingWalker(ret, ".yaml")
p := filepath.Join("/components", name)
if err := assets.Assets.WalkFiles(p, walk); err != nil {
return nil, fmt.Errorf("traversing assets: %w", err)
helmChart, err := components.Chart(name)
if err != nil {
return nil, fmt.Errorf("loading chart from assets: %w", err)
}

return ret, nil
return util.RenderChart(helmChart, name, c.Metadata().Namespace.Name, "")
}

func (c *component) Metadata() components.Metadata {
Expand Down

0 comments on commit 99b250d

Please sign in to comment.