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

Fix typo #814

Merged
merged 2 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion cmd/ytt-lambda-website/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
// a protocol: http://my-custom.host.com
const CustomHostVariable = "GO_API_HOST"

// DefaultServerAddress is prepended to the path of each incoming reuqest
// DefaultServerAddress is prepended to the path of each incoming request
const DefaultServerAddress = "https://aws-serverless-go-api.com"

type RequestAccessor struct {
Expand Down
2 changes: 1 addition & 1 deletion examples/k8s-overlay-ingress/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This example shows how to use `ytt` overlaying in regards to accomplish the modi
Specifically the `apiVersion` is bumped to **networking.k8s.io/v1** from **networking.k8s.io/v1beta1**. This is done in order to get the Falco installation Helm post-rendered into a state that matches the version of the `networking` API on a specific `Kubernetes` version.
As a consequence of that we're required to `ytt overlay` **backend** and **paths** on the **Kubernetes Ingress Object**. In order for these to match the `apiVersion` that is overlayed to.

All of this stems from the Falco Helm chart having issues with the version tag that K3s uses. It's e.g `v1.22.3+k3s2`. This results in the **Falco** chart using the **v1beta1** of the **networking** API instead of the newest versio of the **networking** API that we want.
All of this stems from the Falco Helm chart having issues with the version tag that K3s uses. It's e.g `v1.22.3+k3s2`. This results in the **Falco** chart using the **v1beta1** of the **networking** API instead of the newest version of the **networking** API that we want.

The cmdline used:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ readme: |

Add a new value to `prod/values.yml`:
```
app_nmae: prometheus-operator-blue
app_name: prometheus-operator-blue
```

ytt error messages are information dense:

- lists the order in which data values are being applied;
- that in `prod/values.yml`, the problem is...
...in the YAML Document starting on line 2
...at the Map item named "app_nmae" on line 4
- where "app_nmae" was expected to be a node in the data
...at the Map item named "app_name" on line 4
- where "app_name" was expected to be a node in the data
value YAML tree, already, but it wasn't.

Consider: what would have happened if ytt had — instead —
Expand Down
8 changes: 4 additions & 4 deletions pkg/filepos/position.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ func (p *Position) DeepCopyWithLineOffset(offset int) *Position {
}

// IsNextTo compares the location of one position with another.
func (p *Position) IsNextTo(otherPostion *Position) bool {
if p.IsKnown() && otherPostion.IsKnown() {
if p.GetFile() == otherPostion.GetFile() {
diff := p.LineNum() - otherPostion.LineNum()
func (p *Position) IsNextTo(otherPosition *Position) bool {
if p.IsKnown() && otherPosition.IsKnown() {
if p.GetFile() == otherPosition.GetFile() {
diff := p.LineNum() - otherPosition.LineNum()
if -1 <= diff && 1 >= diff {
return true
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/texttemplate/metas.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ type NodeCodeMeta struct {
*NodeCode
}

jtigger marked this conversation as resolved.
Show resolved Hide resolved
func (p NodeCodeMeta) ShoudTrimSpaceLeft() bool {
// ShouldTrimSpaceLeft indicates whether leading spaces should be removed (because the left-trim token, `-`, was present)
func (p NodeCodeMeta) ShouldTrimSpaceLeft() bool {
return strings.HasPrefix(p.Content, "-")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/texttemplate/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (e *Template) compile(rootNode *NodeRoot,
meta := NodeCodeMeta{typedNode}
trimSpaceRight = meta.ShouldTrimSpaceRight()

if meta.ShoudTrimSpaceLeft() && i != 0 {
if meta.ShouldTrimSpaceLeft() && i != 0 {
if typedLastNode, ok := rootNode.Items[i-1].(*NodeText); ok {
typedLastNode.Content = strings.TrimRightFunc(
typedLastNode.Content, unicode.IsSpace)
Expand Down
4 changes: 2 additions & 2 deletions pkg/yamlmeta/internal/yaml.v2/scannerc.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import (
// %TAG !yaml! tag:yaml.org,2002:
// ---
//
// The correspoding sequence of tokens:
// The corresponding sequence of tokens:
//
// STREAM-START(utf-8)
// VERSION-DIRECTIVE(1,1)
Expand Down Expand Up @@ -1233,7 +1233,7 @@ func yamlParserFetchKey(parser *yamlParserT) bool {

// In the block context, additional checks are required.
if parser.flowLevel == 0 {
// Check if we are allowed to start a new key (not nessesary simple).
// Check if we are allowed to start a new key (not necessary simple).
if !parser.simpleKeyAllowed {
return yamlParserSetScannerError(parser, "", parser.mark,
"mapping keys are not allowed in this context")
Expand Down
2 changes: 1 addition & 1 deletion pkg/yamlmeta/internal/yaml.v2/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func UnmarshalWithComments(in []byte, out interface{}) ([]Comment, error) {
return unmarshal(in, out, true)
}

// A Decorder reads and decodes YAML values from an input stream.
// Decoder reads and decodes YAML values from an input stream.
type Decoder struct {
strict bool
useMapSlice bool
Expand Down
2 changes: 1 addition & 1 deletion pkg/yamlmeta/internal/yaml.v2/yamlh.go
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ type yamlEmitterT struct {
scalarData struct {
value []byte // The scalar value.
multiline bool // Does the scalar contain line breaks?
flowPlainAllowed bool // Can the scalar be expessed in the flow plain style?
flowPlainAllowed bool // Can the scalar be expressed in the flow plain style?
blockPlainAllowed bool // Can the scalar be expressed in the block plain style?
singleQuotedAllowed bool // Can the scalar be expressed in the single quoted style?
blockAllowed bool // Can the scalar be expressed in the literal or folded styles?
Expand Down