Skip to content

tiltfile2: make it more clear when k8s_yaml accepts a string#897

Merged
jazzdan merged 5 commits into
masterfrom
jazzdan/k8s_yaml_accepts_string
Jan 2, 2019
Merged

tiltfile2: make it more clear when k8s_yaml accepts a string#897
jazzdan merged 5 commits into
masterfrom
jazzdan/k8s_yaml_accepts_string

Conversation

@jazzdan

@jazzdan jazzdan commented Jan 2, 2019

Copy link
Copy Markdown
Contributor

No description provided.

@jazzdan
jazzdan requested review from dbentley and nicks January 2, 2019 15:52
@nicks

nicks commented Jan 2, 2019

Copy link
Copy Markdown
Contributor

I'm confused...the PR description is "k8s yaml accepts string", but the PR is "k8s yaml does not accept string"?

@jazzdan

jazzdan commented Jan 2, 2019

Copy link
Copy Markdown
Contributor Author

Whoops, sorry @nicks that was an old title. Re-titling.

@jazzdan jazzdan changed the title tiltfile2: k8s yaml accepts string tiltfile2: make it more clear when k8s_yaml accepts a string Jan 2, 2019
f.setupFoo()
f.WriteFile("bar.yaml", "im not yaml")
f.file("Tiltfile", `
k8s_yaml('bar.yaml')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you also add a test case for something like

k8s_yaml(str(read_file('foo.yaml')))

Comment thread internal/tiltfile2/k8s.go
return nil, err
}
return k8s.ParseYAMLFromString(string(bs))
entities, err := k8s.ParseYAMLFromString(string(bs))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would be slightly more idiomatic for the err != nil check to live here instead of the handle function

@jazzdan
jazzdan merged commit 211eb0c into master Jan 2, 2019
@nicks
nicks deleted the jazzdan/k8s_yaml_accepts_string branch March 31, 2021 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants