Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

provide a configurable namespace where to locate tiller #359

Merged
merged 1 commit into from
Oct 8, 2017

Conversation

karmab
Copy link
Contributor

@karmab karmab commented Sep 22, 2017

as of today, monocular wont be able to connect to a tiller-deploy running outside of the kube-system namespace.
so we provide the ability to use a specific namespace from the config file

TillerPortForward bool `yaml:"tillerPortForward"`
CacheRefreshInterval int64 `yaml:"cacheRefreshInterval"`
ReleasesEnabled bool `yaml:"releasesEnabled"`
TillerNameSpace string "kube-system"
Copy link
Member

Choose a reason for hiding this comment

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

We should rename this to TillerNamespace.

Go doesn't let you set defaults for a struct field (unfortunately), so the only way to do this would be to change GetConfig() to set TillerNamespace = "kube-system" if it's not set. The unset value for a string is simply empty string for Go, so a simple if statement such as works:

if conf.TillerNamespace == "" {
  conf.TillerNamespace = "kube-system"
}

This should be set in GetConfig() after reading in the config from the file.

You should update the field definition to:

TillerNamespace      string `yaml:"tillerNamespace"`

@karmab karmab force-pushed the configurable_tiller_namespace branch 2 times, most recently from b6fc864 to 06e30ce Compare September 25, 2017 14:55
@codecov-io
Copy link

codecov-io commented Sep 25, 2017

Codecov Report

Merging #359 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #359   +/-   ##
=======================================
  Coverage   90.77%   90.77%           
=======================================
  Files          18       18           
  Lines         748      748           
=======================================
  Hits          679      679           
  Misses         45       45           
  Partials       24       24

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd8ff9c...7186c33. Read the comment docs.

Copy link
Member

@prydonius prydonius left a comment

Choose a reason for hiding this comment

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

can you add a commented out example of this configu option to docs/config.example.yml?

@@ -39,6 +38,8 @@ func NewHelmClient() data.Client {
// InitializeClient returns a helm.client
func (c *helmClient) initialize() (*helm.Client, error) {
// From helm.setupConnection
conf, _ := config.GetConfig()
Copy link
Member

Choose a reason for hiding this comment

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

we should catch and return the error here

@prydonius
Copy link
Member

@karmab are you able to pick this back up? would be great to have this fix in :)

@karmab
Copy link
Contributor Author

karmab commented Oct 2, 2017 via email

@karmab karmab force-pushed the configurable_tiller_namespace branch from 06e30ce to a43c0a0 Compare October 2, 2017 12:01
@karmab
Copy link
Contributor Author

karmab commented Oct 2, 2017

addressed as per your comments

@karmab karmab force-pushed the configurable_tiller_namespace branch from a43c0a0 to e4fe714 Compare October 2, 2017 12:03
@@ -37,6 +37,7 @@ type Configuration struct {
OAuthConfig oauthConfig `yaml:"oauthConfig"`
SigningKey string `yaml:"signingKey"`
Initialized bool
TillerNamespace string `yaml:"tillerNamespace"`
Copy link
Member

Choose a reason for hiding this comment

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

Have you run gofmt on your code? It should correctly align this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was fixed

Copy link
Member

Choose a reason for hiding this comment

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

@karmab it still doesn't look properly aligned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually you were right but we're good now!

@karmab karmab force-pushed the configurable_tiller_namespace branch from e4fe714 to 7f8cd5d Compare October 2, 2017 13:34
@karmab
Copy link
Contributor Author

karmab commented Oct 6, 2017

anything more needed?

@karmab karmab force-pushed the configurable_tiller_namespace branch from 7f8cd5d to 7186c33 Compare October 8, 2017 18:41
Copy link
Member

@prydonius prydonius left a comment

Choose a reason for hiding this comment

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

lgtm! thanks @karmab

@prydonius prydonius merged commit f984ede into helm:master Oct 8, 2017
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