Skip to content

Commit

Permalink
Corrects usage of Trim Prefix/Suffix. (#748)
Browse files Browse the repository at this point in the history
* Corrects usage of Trim Prefix/Suffix. Resolves #747

Signed-off-by: Pete Lumbis <pete@upbound.io>

* Corrects usage of Trim Prefix/Suffix. Resolves #747

Signed-off-by: Pete Lumbis <pete@upbound.io>

* Fix TrimSuffix link

Signed-off-by: Pete Lumbis <pete@upbound.io>

* correct link formatting

Signed-off-by: Pete Lumbis <pete@upbound.io>

---------

Signed-off-by: Pete Lumbis <pete@upbound.io>
  • Loading branch information
plumbis authored Apr 11, 2024
1 parent c347076 commit 15ef84b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 24 deletions.
14 changes: 8 additions & 6 deletions content/master/concepts/patch-and-transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -1629,10 +1629,11 @@ patches:

#### Trim prefix

The {{<hover label="typeRegex" line="8">}}type: TrimPrefix{{</hover>}} removes
the matching string and all preceding characters.
The {{<hover label="typeTrimP" line="8">}}type: TrimPrefix{{</hover>}} uses
Go's [TrimPrefix](https://pkg.go.dev/strings#TrimPrefix) and removes characters
from the beginning of a line.

```yaml {label="typeRegex"}
```yaml {label="typeTrimP"}
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.desiredRegion
Expand All @@ -1646,10 +1647,11 @@ patches:

#### Trim suffix

The {{<hover label="typeRegex" line="8">}}type: TrimSuffix{{</hover>}} removes
the matching string and all proceeding characters.
The {{<hover label="typeTrimS" line="8">}}type: TrimSuffix{{</hover>}} uses
Go's [TrimSuffix](https://pkg.go.dev/strings#TrimSuffix) and removes characters
from the end of a line.

```yaml {label="typeRegex"}
```yaml {label="typeTrimS"}
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.desiredRegion
Expand Down
14 changes: 8 additions & 6 deletions content/v1.13/concepts/patch-and-transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -1554,10 +1554,11 @@ patches:

#### Trim prefix

The {{<hover label="typeRegex" line="8">}}type: TrimPrefix{{</hover>}} removes
the matching string and all preceding characters.
The {{<hover label="typeTrimP" line="8">}}type: TrimPrefix{{</hover>}} uses
Go's [TrimPrefix](https://pkg.go.dev/strings#TrimPrefix) and removes characters
from the beginning of a line.

```yaml {label="typeRegex"}
```yaml {label="typeTrimP"}
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.desiredRegion
Expand All @@ -1571,10 +1572,11 @@ patches:

#### Trim suffix

The {{<hover label="typeRegex" line="8">}}type: TrimSuffix{{</hover>}} removes
the matching string and all proceeding characters.
The {{<hover label="typeTrimS" line="8">}}type: TrimSuffix{{</hover>}} uses
Go's [TrimSuffix](https://pkg.go.dev/strings#TrimSuffix) and removes characters
from the end of a line.

```yaml {label="typeRegex"}
```yaml {label="typeTrimS"}
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.desiredRegion
Expand Down
14 changes: 8 additions & 6 deletions content/v1.14/concepts/patch-and-transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -1609,10 +1609,11 @@ patches:

#### Trim prefix

The {{<hover label="typeRegex" line="8">}}type: TrimPrefix{{</hover>}} removes
the matching string and all preceding characters.
The {{<hover label="typeTrimP" line="8">}}type: TrimPrefix{{</hover>}} uses
Go's [TrimPrefix](https://pkg.go.dev/strings#TrimPrefix) and removes characters
from the beginning of a line.

```yaml {label="typeRegex"}
```yaml {label="typeTrimP"}
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.desiredRegion
Expand All @@ -1626,10 +1627,11 @@ patches:

#### Trim suffix

The {{<hover label="typeRegex" line="8">}}type: TrimSuffix{{</hover>}} removes
the matching string and all proceeding characters.
The {{<hover label="typeTrimS" line="8">}}type: TrimSuffix{{</hover>}} uses
Go's [TrimSuffix](https://pkg.go.dev/strings#TrimSuffix) and removes characters
from the end of a line.

```yaml {label="typeRegex"}
```yaml {label="typeTrimS"}
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.desiredRegion
Expand Down
14 changes: 8 additions & 6 deletions content/v1.15/concepts/patch-and-transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -1629,10 +1629,11 @@ patches:

#### Trim prefix

The {{<hover label="typeRegex" line="8">}}type: TrimPrefix{{</hover>}} removes
the matching string and all preceding characters.
The {{<hover label="typeTrimP" line="8">}}type: TrimPrefix{{</hover>}} uses
Go's [TrimPrefix](https://pkg.go.dev/strings#TrimPrefix) and removes characters
from the beginning of a line.

```yaml {label="typeRegex"}
```yaml {label="typeTrimP"}
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.desiredRegion
Expand All @@ -1646,10 +1647,11 @@ patches:

#### Trim suffix

The {{<hover label="typeRegex" line="8">}}type: TrimSuffix{{</hover>}} removes
the matching string and all proceeding characters.
The {{<hover label="typeTrimS" line="8">}}type: TrimSuffix{{</hover>}} uses
Go's [TrimSuffix](https://pkg.go.dev/strings#TrimSuffix) and removes characters
from the end of a line.

```yaml {label="typeRegex"}
```yaml {label="typeTrimS"}
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.desiredRegion
Expand Down

0 comments on commit 15ef84b

Please sign in to comment.