Skip to content

Conversation

@vrothberg
Copy link
Member

Allow specifying additional authentication files passed through
types.SystemContext. Those additional files are only used for reading
credentials. The AuthFilePath remains the center of auth management
and is the only authentication file used for storing new and removing
old credentials.

Having the ability to specify additional authentication files can come
in handy to unify multiple entities that have dedicated auth files, for
instance, the K8s kubelet. See the below bug for additional details.

Also add debug logs to findAuthentication() to ease debugging
potential future regressions.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1686556
Signed-off-by: Valentin Rothberg [email protected]

@vrothberg vrothberg force-pushed the additional-auth-file branch from 9fdf270 to 6daedce Compare March 8, 2019 12:37
@rhatdan
Copy link
Member

rhatdan commented Mar 8, 2019

Small nit, but LGTM

Allow specifying additional authentication files passed through
`types.SystemContext`.  Those additional files are only used for reading
credentials.  The `AuthFilePath` remains the center of auth management
and is the only authentication file used for storing new and removing
old credentials.

Having the ability to specify additional authentication files can come
in handy to unify multiple entities that have dedicated auth files, for
instance, the K8s kubelet.  See the below bug for additional details.

Also add debug logs to `findAuthentication()` to ease debugging
potential future regressions.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1686556
Signed-off-by: Valentin Rothberg <[email protected]>
@vrothberg vrothberg force-pushed the additional-auth-file branch from 6daedce to 9295a90 Compare March 8, 2019 13:46
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

The code is plausible, but the purpose of the code is a bit surprising to me.

The config file already supports multiple entries in one file; it’s counterintuitive that a single caller (with a single privilege level) would ever really need to / want to maintain two distinct config files.

More importantly, my initial impression of https://bugzilla.redhat.com/show_bug.cgi?id=1686556 (just skimming the discussions, without having read all the relevant code or reproduced it) is that in that case we are not passing any credentials, or that we are passing one incorrect set; not that there genuinely are two sets that need merging. Is that incorrect?

})
}

func additionalAuthFiles(sys *types.SystemContext) []string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don’t quite think there four lines are with a function… it’s three lines in the caller, which already has a paths variable, and we have ~5 lines of overhead with defining the function.

Rather, the full computation of all candidate paths should probably be unified between GetAuthentication and GetUserLoggedIn; it seems a bit unlikely that the existing divergence was intentional (OTOH I haven’t checked the past discussions.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don’t quite think there four lines are with a function

“are worth a function”… macOS autocorrection is infuriating sometimes.

@ashcrow
Copy link
Contributor

ashcrow commented Mar 8, 2019

Travis report:

 github.com/containers/image/storage
storage/storage_image.go:735:55: not enough arguments in call to s.imageRef.transport.store.SetImageBigData
	have (string, string, []byte)
	want (string, string, []byte, func([]byte) (digest.Digest, error))
storage/storage_image.go:768:54: not enough arguments in call to s.imageRef.transport.store.SetImageBigData
	have (string, string, []byte)
	want (string, string, []byte, func([]byte) (digest.Digest, error))
storage/storage_image.go:775:54: not enough arguments in call to s.imageRef.transport.store.SetImageBigData
	have (string, string, []byte)
	want (string, string, []byte, func([]byte) (digest.Digest, error))
storage/storage_image.go:784:55: not enough arguments in call to s.imageRef.transport.store.SetImageBigData
	have (string, string, []byte)
	want (string, string, []byte, func([]byte) (digest.Digest, error))
Makefile:39: recipe for target 'build-internal' failed

@vrothberg
Copy link
Member Author

Travis report:

 github.com/containers/image/storage
storage/storage_image.go:735:55: not enough arguments in call to s.imageRef.transport.store.SetImageBigData
	have (string, string, []byte)
	want (string, string, []byte, func([]byte) (digest.Digest, error))
storage/storage_image.go:768:54: not enough arguments in call to s.imageRef.transport.store.SetImageBigData
	have (string, string, []byte)
	want (string, string, []byte, func([]byte) (digest.Digest, error))
storage/storage_image.go:775:54: not enough arguments in call to s.imageRef.transport.store.SetImageBigData
	have (string, string, []byte)
	want (string, string, []byte, func([]byte) (digest.Digest, error))
storage/storage_image.go:784:55: not enough arguments in call to s.imageRef.transport.store.SetImageBigData
	have (string, string, []byte)
	want (string, string, []byte, func([]byte) (digest.Digest, error))
Makefile:39: recipe for target 'build-internal' failed

Thanks! That comes from containers/storage and containers/image not liking each other over at Skopeo. We need to fix this as well.

@mtrmac
Copy link
Collaborator

mtrmac commented Mar 8, 2019

Thanks! That comes from containers/storage and containers/image not liking each other over at Skopeo.

This is the fallout from containers/storage#299 .

@vrothberg
Copy link
Member Author

Closing as we found another solution for CRI-O :)

@vrothberg vrothberg closed this Mar 8, 2019
@vrothberg vrothberg deleted the additional-auth-file branch March 8, 2019 15:25
@wking
Copy link
Contributor

wking commented Mar 8, 2019

I think #588 would give an API that makes this sort of thing convenient, even if we may be going with openshift/machine-config-operator#535 in this particular case ;).

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.

5 participants