Skip to content

Commit 7d23f71

Browse files
committed
Update from PR comments
1 parent fc97e0d commit 7d23f71

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

contributors/design-proposals/sig-cli/kubectl_apply_getsetdiff_last_applied_config.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,27 @@ manner.
2626
## Use Cases
2727

2828
1. As a user, I want to be able to diff the last-applied-configuration
29-
against the current local configuration to see which changes the command is seeing
29+
against the current local configuration to see which changes the command is seeing
3030
2. As a user, I want to remove fields from being managed by the local
31-
object configuration by removing them from the local object configuration
32-
and setting the last-applied-configuration to match.
33-
3. As a user, I want to be able to view the the base
34-
last-applied-configuration that will be used to merge changes
31+
object configuration by removing them from the local object configuration
32+
and setting the last-applied-configuration to match.
33+
3. As a user, I want to be able to view the last-applied-configuration
34+
on the live object that will be used to calculate the diff patch
35+
to update the live object from the configuration file.
3536

3637
## Naming and Format possibilities
3738

3839
### Naming
3940

4041
1. last-applied
41-
2. last-config
42-
3. last-applied-config
43-
4. last-configuration
44-
5. last-applied-configuration
45-
6. last
42+
43+
Rejected alternatives:
44+
45+
2. ~~last-config~~
46+
3. ~~last-applied-config~~
47+
4. ~~last-configuration~~
48+
5. ~~last-applied-configuration~~
49+
6. ~~last~~
4650

4751
### Formats
4852

@@ -98,24 +102,32 @@ Same as above, but in json
98102

99103
## diff last-applied
100104

101-
Porcelain command that retrieves the object and displays a diff against the local configuration
105+
Porcelain command that retrieves the object and displays a diff against
106+
the local configuration
102107

103108
1. Diff the last-applied
104109

105110
```sh
106111
kubectl apply diff last-applied -f deployment_nginx.yaml
107112
```
108113

109-
Opens up a 2-way diff in the default diff viewer. last-applied is old, local configuration is new.
114+
Opens up a 2-way diff in the default diff viewer. This should
115+
follow the same semantics as `git diff`. It should accept either a
116+
flag `--diff-viewer=meld` or check the environment variable
117+
`KUBECTL_EXTERNAL_DIFF=meld`. If neither is specified, the `diff`
118+
command should be used.
119+
110120
This is meant to show the user what they changed in the configuration,
111121
since it was last applied, but not show what has changed in the server.
112122

123+
The supported output formats should be `yaml` and `json`, as specified
124+
by the `-o` flag.
125+
113126
A future goal is to provide a 3-way diff with `kubectl apply diff -f deployment_nginx.yaml`.
114127
Together these tools would give the user the ability to see what is going
115128
on and compare changes made to the configuration file vs other
116129
changes made to the server independent of the configuration file:
117130

118-
119131
## set last-applied
120132

121133
Porcelain command that sets the last-applied-config annotation to as

0 commit comments

Comments
 (0)