Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes 'kfctl apply fails to create k8s resources; tries to deploy to 127.0.0.1' #2813

Merged
merged 2 commits into from
Mar 27, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bootstrap/pkg/kfapp/ksonnet/ksonnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,16 @@ func (ksApp *ksApp) envSet(envName string, host string) error {
actions.OptionAppRoot: ksApp.ksRoot(),
actions.OptionEnvName: ksApp.KsEnvName,
actions.OptionServer: host,
actions.OptionOverride: true,
Copy link
Contributor

@jlewi jlewi Mar 26, 2019

Choose a reason for hiding this comment

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

What's this doing? Is this just an idiosyncrancy of ksonnet that they require you set the optionOverride to explicitly tell it that the host associated with the environment should be used as opposed to the one set during init?

})
if err != nil {
return fmt.Errorf("There was a problem setting ksonnet env: %v", err)
}
loadApp, loadErr := app.Load(afero.NewOsFs(), ksApp.KApp.HTTPClient(), ksApp.ksRoot())
Copy link
Contributor

Choose a reason for hiding this comment

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

I see. So I'm guessing RunEnvSet is just modifying the config files on disks and we need to explicitly load the app to pick up the changes.

if loadErr != nil {
return fmt.Errorf("could not reload the ksonnet env: %v", err)
}
ksApp.KApp = loadApp
return nil
}

Expand Down