-
Notifications
You must be signed in to change notification settings - Fork 7
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
Always configure anonymous token in primary DC #106
Conversation
Namespace: controller.DefaultPartition, | ||
Partition: controller.DefaultNamespace, | ||
} | ||
} |
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.
Forcing the default partition here seems to match the k8s behavior:
policyNames := []string{} | ||
for _, policy := range policies { | ||
policyNames = append(policyNames, policy.Name) | ||
} |
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.
I changed this bit to collect the policy names. Then we do a contains check and the order of policies doesn't matter.
partitionsEnabled: true, | ||
expPolicy: expEntAnonTokenPolicy, | ||
}, | ||
} |
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.
This I moved to the command_ent_test.go
so that it doesn't run for the OSS binary, since the controller now passes in an explicit partition=default
query option.
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.
Looks good Paul. I just left a couple of minor notes.
Config: Config{Datacenter: "dc1"}, | ||
DebugConfig: Config{ | ||
PrimaryDatacenter: "dc1", | ||
MeshGatewayWANFederationEnabled: true, |
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.
The MeshGatewayWANFederationEnabled
flag isn't needed for the test anymore.. maybe we should remove it, what do you think?
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.
Updated! I renamed some of the tests. See what you think!
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.
👍 for the renaming.
Sorry for any confusion, I wasn't very clear about my comment for the MeshGatewayWANFederationEnabled
field. I was trying to say that we don't actually use this field in the code anymore. And since we don't need it, maybe we should remove it from both the ACL controller and the tests. As you mentioned before it's in the DebugConfig
part of the agent/self response, so it's not "stable". So it may just be better to get rid of it.
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.
Oh, I meant to remove the field, too (forgot to git add
again before committing)
require.Len(t, policies, 2) | ||
require.Equal(t, policies[1].Name, "global-management") | ||
// Otherwise, we expect the global-management policy and anonymous-token-policy | ||
// in the default partition, or if partitions are not enabled. |
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.
This comment reads a bit awkwardly. It seems like the ", or if partitions are not enabled" at the end of the comment is not needed.
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.
Yeah, I can fix the wording. Basically, we hit this in the OSS case (no partitions) or in ENT but in the default partition (partitions disabled in the controller).
Changes proposed in this PR:
This changes the acl-controller to always configure the anonymous token in the primary datacenter, and in the default partition.
How I've tested this PR:
Unit tests
How I expect reviewers to test this PR:
👀
Checklist: