-
Notifications
You must be signed in to change notification settings - Fork 486
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
Fixed workload attestation when using AWS Node Resolver #327
Conversation
d9f240d
to
e8d611f
Compare
@@ -76,6 +78,8 @@ type manager struct { | |||
once sync.Once | |||
doneCh chan struct{} | |||
pipelineCnt int32 | |||
aliasSPIFFEID string | |||
magicSPIFFEID string |
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.
nit: serverSPIFFEID
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.
These should probably be URL type instead of string
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.
serverSPIFFEID
already exists here and it's a string, that's why I'm also using strings here. I can change it if you feel strongly about 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.
it's ok, we can fix it later. we'll probably need to refactor all this anyways once the workload api updates land.
pkg/agent/cache/manager.go
Outdated
entry := m.getBaseSVIDEntry() | ||
svid = entry.svid | ||
key = entry.key | ||
} else { | ||
m.log.Debug("Unknown parent ", parentId, "... ignoring") |
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.
An info or warn level may be more appropriate, since reaching this point means something is probably wrong. Also, you can use Infof
or Warnf
for proper string formatting
pkg/server/node.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
for combination := range selector.PowerSet(selector.NewSet(selectors)) { |
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.
Tests to capture this updated logic would be awesome... I feel we'll probably refactor this handler in the near future
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.
Added test.
functional/Makefile
Outdated
@@ -13,7 +13,7 @@ all: clean build server agent test | |||
build: | |||
docker-compose build runner | |||
docker-compose up -d runner | |||
docker-compose exec runner bash -c 'mkdir -p $(DOCKER_SPIRE) && cp -R /spire-orig/* $(DOCKER_SPIRE)' | |||
docker-compose exec runner bash -c 'mkdir -p $(DOCKER_SPIRE) $(DOCKER_SPIRE)/.data && cp -R /spire-orig/* $(DOCKER_SPIRE)' |
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.
Given that we are using mkdir -p, isn't doing
mkdir -p $(DOCKER_SPIRE)/.data
enough?
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.
Good catch.
e8d611f
to
c184012
Compare
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.
LGTM
c184012
to
109e9cb
Compare
Pull Request check list
Affected functionality
Workloads fail to receive identity when using AWS Node Resolver plugin.
Description of change
Which issue this PR fixes
Fixes #326