internal/*: drop merging authorized_keys.d into authorized_keys#751
Conversation
|
Can one of the admins verify this patch? |
594b5ff to
0fba9d2
Compare
Hmm - finding it a bit tricky to add a test for this as writing to I think since Ignition v3 will support |
|
Ready for a review |
bgilbert
left a comment
There was a problem hiding this comment.
I think we should delete the authorized_keys_d code entirely. Ignition should be running before anything else has written keys to disk, so we should be able to completely clobber .ssh/authorized_keys if usedAuthorizedKeysFile is true.
|
For the blackbox tests we could expose the option via an environment variable, the same as for |
0d927a0 to
6a6b24d
Compare
|
Made some edits:
To do:
|
6a6b24d to
1abddeb
Compare
This allows individual tests to configure environment variables by setting the IgnitionEnv member of types.Test. The TestIgnitionBlackBox and TestIgnitionBlackBoxNegative functions may then append additional environment variables during setup that apply to all tests. Preparatory commit for adding a blackbox test in coreos#751.
1abddeb to
2a2461e
Compare
This allows individual tests to configure environment variables by setting the IgnitionEnv member of types.Test. The TestIgnitionBlackBox and TestIgnitionBlackBoxNegative functions may then append additional environment variables during setup that apply to all tests. Preparatory commit for adding a blackbox test in coreos#751.
a0f3a1d to
46f711b
Compare
|
⬆ Pushed changes to add another blackbox test for Diff since the push yesterday: https://github.com/coreos/ignition/compare/6a6b24d5fffa0a957672c641a2361e730da11109..46f711b002e2ee7d988ccab6bac9ef1572477bef. |
|
ok to test |
|
I'm okay handling the additional docs in #649. |
46f711b to
4e06881
Compare
This allows individual tests to configure environment variables by setting the IgnitionEnv member of types.Test. The TestIgnitionBlackBox and TestIgnitionBlackBoxNegative functions may then append additional environment variables during setup that apply to all tests. Preparatory commit for adding a blackbox test in coreos#751.
4e06881 to
166a00c
Compare
This allows individual tests to configure environment variables by setting the Env member of types.Test. The TestIgnitionBlackBox and TestIgnitionBlackBoxNegative functions may then append additional environment variables during setup that apply to all tests. Preparatory commit for adding a blackbox test in coreos#751.
166a00c to
61eb130
Compare
This allows individual tests to configure environment variables by setting the Env member of types.Test. The TestIgnitionBlackBox and TestIgnitionBlackBoxNegative functions may then append additional environment variables during setup that apply to all tests. Preparatory commit for adding a blackbox test in coreos#751.
61eb130 to
57e19f7
Compare
This allows individual tests to configure environment variables by setting the Env member of types.Test. The TestIgnitionBlackBox and TestIgnitionBlackBoxNegative functions may then append additional environment variables during setup that apply to all tests. Preparatory commit for adding a blackbox test in coreos#751.
|
Updated! I split the added test into its own commit - which also updates the existing |
|
Hmm - failure just seems to be from the gofmt. Thinking it wants to indent the function due to the line length. Any way to disable/configure gofmt to not consider that a failure? Having the one-line function body is neater. https://travis-ci.org/coreos/ignition/jobs/502719646#L603 |
|
I'd say go with gofmt in this case, it is quite a long line otherwise. |
57e19f7 to
0460eb0
Compare
This allows individual tests to configure environment variables by setting the Env member of types.Test. The TestIgnitionBlackBox and TestIgnitionBlackBoxNegative functions may then append additional environment variables during setup that apply to all tests. Preparatory commit for adding a blackbox test in coreos#751.
This drops the authorized_keys_d code, having Ignition directly write SSH keys to a keyfile. By default, Ignition writes the fragment to .ssh/authorized_keys.d/ignition. Setting the flag distro.writeAuthorizedKeysFragment to "false" (through the environment variable IGNITION_WRITE_AUTHORIZED_KEYS_FRAGMENT) causes Ignition to write the SSH keys to .ssh/authorized_keys. Distributions that do not read fragments from .ssh/authorized_keys.d can then instead read from .ssh/authorized_keys. Fixes: coreos#716
This allows individual tests to configure environment variables by setting the Env member of types.Test. The TestIgnitionBlackBox and TestIgnitionBlackBoxNegative functions may then append additional environment variables during setup that apply to all tests. Preparatory commit for adding a blackbox test in coreos#751.
Add a blackbox test to verify that ~/.ssh/authorized_keys is written when IGNITION_WRITE_AUTHORIZED_KEYS_FRAGMENT=false. Also updates the existing test AddPasswdUsers to use the environment variable IGNITION_WRITE_AUTHORIZED_KEYS_FRAGMENT=true so that the test will pass consistently if the binary is built with a non-default writeAuthorizedKeysFragment flag.
0460eb0 to
f89ffe2
Compare
|
Fixed! (had committed but forgot to squash it into 6b434dd just then). Should be good now. |
|
@rfairley Good to merge? |
|
@bgilbert Good to merge! |
Will rebase this PR once #749 is merged.
So far I have verified that the blackbox test works, and that the old blackbox test fails with the build flag
GLDFLAGS+="-X github.com/coreos/ignition/internal/distro.useAuthorizedKeysFile=true "(in./build_blackbox_tests).Still to do:
useAuthorizedKeysFile=true)distro.useAuthorizedKeysFile=trueflag that checks thatauthorized_keysgets updatedFixes: #716