Skip to content

Commit 6335ac4

Browse files
committed
rework
Signed-off-by: George Jenkins <[email protected]>
1 parent 1b89550 commit 6335ac4

File tree

1 file changed

+40
-33
lines changed

1 file changed

+40
-33
lines changed

hips/hip-XXXX.md

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,52 @@ status: "draft"
99

1010
## Abstract
1111

12-
[registries.conf][registries-conf] is a an alternative specification (to Docker's `docker/config.json`) for managing OCI registry configuration. That supports more advanced features, and has been standardized by other container ecosystem CLI tools (podman, buildah, skopeo, etc)
12+
[registries.conf][registries-conf] is an alternative specification for managing client OCI registry configuration that supports more advanced features, compared to Docker's `docker/config.json` that Helm currently uses today.
1313

14-
Support would extend Helm's flexilbity with respect to OCI configuration, including repository prefixes and aliases. This HIP focuces on the implementation of supporting `registries.conf`. Further HIPs to be created for exposing functionality based on utilzing `registries.conf`.
14+
This HIP focuses on the initial implementation of supporting `registries.conf` within Helm.
15+
Further HIPs will be created to expose additional functionality based on utilizing `registries.conf`.
1516

1617
[registries-conf]: <https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md> "registries.conf specification"
1718

1819
## Motivation
1920

20-
`registries.conf` provides much more flexibible support for OCI registry management than the current Docker CLI based configuration format that Helm uses today.
21+
Helm uses Docker's `docker/config.json` to store client OCI registry configuration today.
2122

22-
Including support for repository prefixes (allowing different credentials for different prefixes), registry mirrors, and registry "aliasing". Features Helm would like to introduce. But is currenly blocked by a lack of mechanism to store detail
23+
`registries.conf` provides much more advanced functionality for client OCI registry management than `docker/config.json`.
24+
Notably:
2325

24-
(in particular, the existing registry configuration Helm uses, Docker’s `$HOME/.docker/config.json`, etc do not support registry aliases nor prefixes)
26+
- support for repository prefixes (allowing different credentials for different prefixes)
27+
- registry mirrors
28+
- registry "aliasing"—features
29+
30+
Helm would like to introduce features depending on these functionalities. Supporting `registries.conf` would enable them without Helm having to create or implement its own mechanisms.
31+
With `registries.conf` having been standardized by other container ecosystem CLI tools (podman, buildah, skopeo, etc.).
2532

2633
## Rationale
2734

28-
Utilizing an existing specification / libraries enables Helm immediate build upon an existing standard.
29-
Rather than Helm inventing its own convention.
35+
Utilizing an existing specification and libraries enables Helm to immediately build upon an existing standard, rather than inventing its own convention.
3036

3137
`registries.conf` was picked as being a format intended for consumption beyond the Docker application container ecosystem.
3238

39+
ORAS (the library Helm uses for supporting OCI functionality) has planned support for `registries.conf` client-side OCI registry management.
40+
3341
## Specification
3442

35-
Helm will utilize the `registries.conf` specification when determinging OCI registry information (authentication credentials, etc):
43+
Helm will utilize the `registries.conf` specification when determining OCI registry information (authentication credentials, etc.):
3644
<https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md>
3745

38-
39-
`registries.conf` will be preferred, either when a `registries.conf` file already exists on the users system.
40-
Or when Helm supports and a user utilizes functionality that can not be supported by Docker's comnfigurtation file in the future.
46+
`registries.conf` will be preferred either when a `registries.conf` file already exists on the user's system, or when Helm supports and a user utilizes functionality that cannot be supported by Docker's configuration file in the future.
4147

4248
<!-- The usage of `registries.conf` will be forced, when in the future -->
4349

4450
For example, a registry login command:
51+
4552
```bash
4653
helm registry login "oci.example.com" --username foo --password bar
4754
```
4855

49-
Will result in the configration exerpt (if, and only if, `registries.conf` exists on the users local system):
56+
Will result in the configuration excerpt (if, and only if, `registries.conf` exists on the user's local system):
57+
5058
```toml
5159
# registries.conf
5260
[[registry]]
@@ -63,16 +71,13 @@ prefix = "oci.example.com"
6371
}
6472
```
6573

66-
Helm will use the package TBD for updating (and reading) `registries.conf`.
74+
Helm will use ORAS v3 for updating (and reading) `registries.conf` (TODO: link to ORAS v3 `registries.conf` implementation).
6775

68-
If when reading a registries configation from `registries.conf` results in known configuration Helm doesn't support, Helm must error.
69-
e.g. `location` or non-empty URI path in `prefix`.
76+
If reading a registry configuration from `registries.conf` results in a known configuration that Helm doesn't support, Helm must report a warning (e.g., `location` or non-empty URI path in `prefix`).
7077

71-
An error reading `registries.conf` must result in an error for the user.
72-
Otherwise, users who expect configration from `registries.conf` to be effected, will have a unspected fallback.
78+
An error reading `registries.conf` must result in an error for the user. Otherwise, users who expect configuration from `registries.conf` to be effective will have an unexpected fallback.
7379

74-
To account for existing configration in Docker’s registry configuration, Helm will prefer `registries.conf` when resolving OCI registries (including credentials).
75-
And fall back to the existing store mechanism if `registries.conf` does not contain an entry for the required OCI registry (including if `registries.conf` does not exist).
80+
To account for existing configuration in Docker’s registry configuration, Helm will prefer `registries.conf` when resolving OCI registries (including credentials), and fall back to the existing storage mechanism if `registries.conf` does not contain an entry for the required OCI registry (including if `registries.conf` does not exist).
7681

7782
Helm must expect (and even encourage) users to utilize other tooling to manage `registries.conf`.
7883

@@ -81,23 +86,24 @@ Helm must expect (and even encourage) users to utilize other tooling to manage `
8186
Helm's fallback to Docker's registry configuration ensures the vast majority of existing user workflows remain the same.
8287

8388
However, there are three potential incompatibility scenarios:
84-
2. A corrupt `registries.conf` will cause an error for existing workflows
85-
1. An invalid or incompatible with Helm `registries.conf` entry for the given OCI registry will cause the users workflow to fail
89+
90+
1. A corrupt `registries.conf` will cause an error for existing workflows
91+
2. An invalid or incompatible with Helm `registries.conf` entry for the given OCI registry will cause the user's workflow to fail
8692
3. Helm’s preference for `registries.conf` will break users who assume credentials are stored in Docker’s registry configuration
8793

88-
The first two can mitigated by users ensuring their systems `registries.conf` is valid, and only includes configuration options Helm supports for the registries they plan to use with Helm.
94+
The first two can be mitigated by users ensuring their system's `registries.conf` is valid, and only includes configuration options Helm supports for the registries they plan to use with Helm.
8995

90-
The last is mitigated by not using `registries.conf` initially unless it exists on the users system.
96+
The last is mitigated by not using `registries.conf` initially unless it exists on the user's system.
9197

9298
## Security implications
9399

94100
`registries.conf` introduces a new mechanism for storing OCI credentials, which may introduce credential management vulnerabilities specific to `registries.conf` / `auth.json`
95101

96-
Transitive dependencies of the TBD package for managing registries.conf may introduce security scanner noise (which tends to be a problem in the container library ecosystem)
102+
Transitive dependencies of the TBD package for managing `registries.conf` may introduce security scanner noise (which tends to be a problem in the container library ecosystem)
97103

98104
## How to teach this
99105

100-
Helm's documentation will need to be updated with details of Helm's `registries.conf` support, and fallback to Docker config.
106+
Helm's documentation will need to be updated with details of Helm's `registries.conf` support and fallback to Docker config.
101107

102108
## Reference implementation
103109

@@ -110,21 +116,22 @@ proof-of-concept.
110116

111117
### Falling back to Docker’s config upon error reading registries.conf
112118

113-
Falling back upon error means users who expect their configuration to be taken from `registries.conf` will unexpectedly have OCI configuration taken from Docker.
114-
Potentially resulting in difficult to diagnose failures authenticating to the repository.
119+
Falling back upon error means users who expect their configuration to be taken from `registries.conf` will unexpectedly have OCI configuration taken from Docker, potentially resulting in difficult to diagnose failures authenticating to the repository.
115120

116-
Rather than "failing fast" and requring users to ensure their configuration to be valid.
121+
Rather than "failing fast" and requiring users to ensure their configuration is valid.
117122

118123
## Open issues
119124

120-
- Support for registies.conf in ORAS
121-
- Disucss Helm's/ORAS's usage of registries.conf with owners
125+
- ORAS `registries.conf` support: <https://github.com/oras-project/oras-go/issues/918>
126+
- Is the release and backwards compatibility plan good enough?
127+
- <strike>Discuss Helm's/ORAS's potential usage of `registries.conf` with `registries.conf` owners</strike>
122128

123129
## References
124130

125-
### ORAS credential store (registry configuration) docs
131+
### ORAS credential store (Docker registry configuration) docs
126132

127-
https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#NewStoreFromDocker
133+
<https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#NewStoreFromDocker>
128134

129135
### registries.conf specification
130-
https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md
136+
137+
<https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md>

0 commit comments

Comments
 (0)