-
Notifications
You must be signed in to change notification settings - Fork 18
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
(feat) PR for Installation outputs GRPC Service #245
(feat) PR for Installation outputs GRPC Service #245
Conversation
Codecov Report
@@ Coverage Diff @@
## main #245 +/- ##
==========================================
+ Coverage 67.67% 68.04% +0.37%
==========================================
Files 14 14
Lines 2147 2241 +94
==========================================
+ Hits 1453 1525 +72
- Misses 547 564 +17
- Partials 147 152 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
89cbda4
to
3f381f7
Compare
0aae39a
to
c175bc3
Compare
c175bc3
to
279f1c1
Compare
Signed-off-by: Troy Connor <[email protected]>
Signed-off-by: Troy Connor <[email protected]>
Signed-off-by: Troy Connor <[email protected]>
Signed-off-by: Troy Connor <[email protected]>
Signed-off-by: Troy Connor <[email protected]>
…p todos Signed-off-by: Troy Connor <[email protected]>
Signed-off-by: Troy Connor <[email protected]>
Signed-off-by: Troy Connor <[email protected]>
Signed-off-by: Troy Connor <[email protected]>
Signed-off-by: Troy Connor <[email protected]>
279f1c1
to
d771ea3
Compare
|
||
func (r *InstallationReconciler) CreateInstallationOutputsCR(ctx context.Context, install *v1.Installation, in *installationv1.ListInstallationLatestOutputResponse) (*v1.InstallationOutput, error) { | ||
if len(in.Outputs) < 1 { | ||
return nil, fmt.Errorf("no outputs for the installation %s", install.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.
Instead of error, maybe best to log?
Some installations may not have outputs
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.
Could the installationoutput cr have an owner ref to the installation?
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.
Instead of error, maybe best to log?
This only makes the CR if the outputs exist from the previous call.
Some installations may not have outputs
It errors only to requeue in the event that the output length being returned from the grpc server is less than 1 . I agree, I should probably still log. I have to short circuit in the event that the output doesn't exist or it'll make a CR with a blank output.
main.go
Outdated
@@ -62,11 +66,19 @@ func main() { | |||
setupLog.Error(err, "unable to start manager") | |||
os.Exit(1) | |||
} | |||
|
|||
// TODO: Set this with credentials on the server side | |||
// TODO: This needs to be set so we don't fail when instantiating client |
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 feel like this is most important todo, the other ones we can live with
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 was thinking tls and generate key/pair before creating the server, however that is done outside of this PR to manipulate the grpc server. (The GRPC service is a deployment outside of the controller-manager). The client setting up however, I can pass it credentials to interact with this. I can clean up the TODO but need more cycles to do the grpc server credentialing on the server side.
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.
Sounds good, we should separate this into it's own issue perhaps
I'm moving this out of draft :) |
|
||
// TODO: Set this with credentials on the server side | ||
// TODO: This needs to be set so we don't fail when instantiating client | ||
conn, err := grpc.DialContext(context.Background(), "porter-grpc-service:3001", grpc.WithTransportCredentials(insecure.NewCredentials())) |
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.
What I can do to not be dependent on the gRPC server being there is to only set this if the service is present.
Basically, don't error if this fails but pass an empty listener and log "no grpc client for installationoutputs" @schristoff
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.
Sgtm
Signed-off-by: Troy Connor <[email protected]>
27bee7a
to
6515752
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.
Looking through I see there's already an ownerref for instllation outputs in the installation_controller.go
- so we should be good to go.
What does this change
Create the installationoutputs custom resource definition via api/v1Create the intallationoutoutputs deep copy functionsAdd additional printer columnsAdd condition on installationoutputs custom resourceAdd the necessary rbac for installation controller to mess with installationoutputsAdd the roles (generated) with the installationoutputsAbove is now merged but leaving for visibility
Owns(&v1.InstallationOutput{}, builder.MatchEveryOwner)
getporter.org/installationoutput: "true"
Make sure outputs get updated when install updates(deferred until after v1.0.0)Waiting on a bundle for upgrade to test logicWhat issue does it fix
Closes #63
Notes for the reviewer
What is struck through is being handled by PR #246 to lessen the load when reviewing.
Checklist
api/v1
calledInstallationOuput
. No api documentation change is necessary.