Skip to content
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

fix for Flux plugin requires an additional config getter #3560 #3582

Conversation

gfichtenholt
Copy link
Contributor

  • a few integration tests for flux v2 plug in were added/refactored

@gfichtenholt gfichtenholt self-assigned this Oct 12, 2021
@gfichtenholt gfichtenholt linked an issue Oct 12, 2021 that may be closed by this pull request
@gfichtenholt
Copy link
Contributor Author

gfichtenholt commented Oct 12, 2021

So there is quite a bit of "noise" in this PR, which for the most part feel free to ignore. The main things to double check is in utils.go, called newBackgroundClientGetter() and the changes I made to plugins.go extractToken() per agreement above

Copy link
Contributor

@absoludity absoludity left a comment

Choose a reason for hiding this comment

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

Excellent, thanks Greg.

@@ -228,7 +223,7 @@ func kubeGetPodNames(t *testing.T, namespace string) (names []string, err error)
// will create a service account with cluster-admin privs and return the associated
// Bearer token (base64-encoded)
func kubeCreateAdminServiceAccount(t *testing.T, name, namespace string) (string, error) {
t.Logf("+kubeCreateServiceAccount(%s,%s)", name, namespace)
t.Logf("+kubeCreateAdminServiceAccount(%s,%s)", name, namespace)
Copy link
Contributor

Choose a reason for hiding this comment

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

phew I got scared for a second before I realised this code is part of the integration test utilities :P

// it appears that if service account is deleted before the helmrelease object that uses it,
// when you try to delete the helmrelease, the "delete" operation gets stuck and the only
// way to get it "unstuck" is to edit the CRD and remove the finalizer.
// So we'll cleanup the service account only after the corresponding helmrelease has been deleted
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds painful.

@@ -71,7 +70,7 @@ func NewServer(configGetter server.KubernetesConfigGetter) (*Server, error) {
return nil, err
} else {
return &Server{
clientGetter: clientGetter,
clientGetter: newClientGetter(configGetter),
Copy link
Contributor

Choose a reason for hiding this comment

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

Great, so the cache is configured with the background client while the server (handling user requests) still always uses the provided config getter (that gets authz from the context).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct

md, ok := metadata.FromIncomingContext(ctx)
if !ok {
return "", nil
return "", fmt.Errorf("missing authorization metadata")
Copy link
Contributor

Choose a reason for hiding this comment

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

Excellent, thanks.

@gfichtenholt gfichtenholt merged commit ca3bad0 into vmware-tanzu:master Oct 13, 2021
@gfichtenholt gfichtenholt deleted the further-fluxv2-plugin-features-13 branch October 13, 2021 04:00
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.

Flux plugin requires an additional config getter
2 participants