-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support role bootstrapping in OSS #7130
Conversation
2e9ceed
to
bb676af
Compare
@fspmarshall I had a play around with this and it does not appear to be working with roles and the GH provider defined in the bootstrap files. I am seeing a similar problem to #7134 where it creates the migrated |
@fspmarshall Is this ready to review? |
@@ -418,6 +418,25 @@ func init() { | |||
return rsc, nil | |||
}) | |||
|
|||
RegisterResourceMarshaler(KindRole, func(r Resource, opts ...MarshalOption) ([]byte, error) { | |||
rsc, ok := r.(Role) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe:
rsc, ok := r.(Role) | |
role, ok := r.(Role) |
return raw, nil | ||
}) | ||
RegisterResourceUnmarshaler(KindRole, func(b []byte, opts ...MarshalOption) (Resource, error) { | ||
rsc, err := UnmarshalRole(b, opts...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe (as above):
rsc, err := UnmarshalRole(b, opts...) | |
role, err := UnmarshalRole(b, opts...) |
err = ioutil.WriteFile(bootstrapFile, []byte(YAMLBootstrap), 0660) | ||
require.NoError(t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err = ioutil.WriteFile(bootstrapFile, []byte(YAMLBootstrap), 0660) | |
require.NoError(t, err) | |
require.NoError(t, ioutil.WriteFile(bootstrapFile, []byte(YAMLBootstrap), 0660)) |
require.Equal(t, "start", cmd) | ||
require.Equal(t, 2, len(conf.Auth.Resources)) | ||
require.Equal(t, "github", conf.Auth.Resources[0].GetKind()) | ||
require.Equal(t, "role", conf.Auth.Resources[1].GetKind()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do a deeper assertion at the resources or is this enough? (If yes, please leave a comment stating why.)
Replaced by #11175. |
Adds support for roles in the OSS variant of the
--bootstrap
flag. Supersedes #7036.