-
Notifications
You must be signed in to change notification settings - Fork 150
Add ConsoleCliDownloads controller #306
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
Conversation
| } | ||
| } | ||
|
|
||
| func GetOrCreate(consoleClient consolev1client.ConsoleCLIDownloadInterface, required *v1.ConsoleCLIDownload) (*v1.ConsoleCLIDownload, bool, error) { |
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.
Contemplating, do we want a full Apply for this? If it exists, but someone tampers with it, we probably want to stomp it back to the correct values.
227b26e to
5690834
Compare
|
@benjaminapetersen updated the PR. The controller will make sure the Also I've seen #309 ... after it will land will update the PR with PTAL |
| resourceSyncer, | ||
| ) | ||
|
|
||
| cliDownloadsController := clidownloads.NewCLIDownloadsSyncController( |
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.
Lets organize these with client/informer next to each other, client first like https://github.com/openshift/console-operator/pull/310/files#diff-69ecbb024dab972c8729678abdf9c0faR79.
I think it will help, granted . don't think there will be much added to this.
cliDownloadsController := clidownloads.NewCLIDownloadsSyncController(
// operator is to set status, correct?
operatorConfigClient.OperatorV1(),
operatorClient,
// client, informer pair for ConsoleCLIDownloads
consoleClient.ConsoleV1().ConsoleCLIDownloads(),
consoleInformers.Console().V1().ConsoleCLIDownloads(),
// route just to get route... but should we be informed of a route change?
routesClient.RouteV1(),
recorder,
)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 think we prob want the routeInformer. If the Host changes on the route, then we need to update the CLIDownloads.
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 don't think that we need the top-level console informer for this. I considered suggesting it, but nothing user configurable matters.
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.
Quick thoughts on this one:
// top level config (only needs informer, we don't manipulate, so no need to use client)
operatorClient,
// operator (just client, because we DO manipulate status, but we don't need to be informed of changes for this, however, it wouldn't hurt us to kick if the operatorconfig did change)
operatorConfigClient.OperatorV1(),
// cli download client (need both client and informer because we both need to know about changes and make changes)
consoleClient.ConsoleV1().ConsoleCLIDownloads(),
consoleInformers.Console().V1().ConsoleCLIDownloads(),
// routes (I believe we only need the informer, we aren't changing the route, we just need to know if something else changes)
routesInformersNamespaced.Route().V1().Routes(),
// recorder
recorder,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.
Check that, you'll need both for route:
routeClient // so we can GET the downloads route & pluck out the canonical host.
routeInformer // notify us of any route changesWe have to be informed of changes AND get the route to use the host, my bad.
f18dbdd to
1502751
Compare
|
@benjaminapetersen Ive updated the PR based on comments also added comments. Added a Only thing that is missing are the e2e tests that I've started to work on, but I think it would be better to address them as a separate PR, since this is already quite beefy 😄 Other thing is that we need to figure out #306 (comment) PTAL |
|
/lgtm |
|
/retest Terraform failed. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
And here is our test failure: |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest openshift/origin#23975 has merged so test should be unblocked. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest |
3 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
| - get | ||
| - list | ||
| - watch | ||
| - create |
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 should only be get/list/watch
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 think he needs full CRUD for this one, since the operator is creating 2 of this resource, or updating if tampered 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.
I updated the test incorrectly, added this resource to the same list as the rest of our resources. My mistake, I forgot this resource is more actively managed than our others.
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.
So you probably need to pull the consoleclidownloads out of ClusterRole console-extensions-reader file and put it in its own file. Name the role something like console-clidownloads-extension-manager and then create a ClusterRoleBinding for console-operator.
Then we can update the origin test to allow this.
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.
No, this is wrong. This is the role that gets assigned to system:authenticated. We cannot let all users edit these. The operator role is a different one.
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 updated the test incorrectly, added this resource to the same list as the rest of our resources. My mistake, I forgot this resource is more actively managed than our others.
Your origin test updates are correct.
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.
Right, intended to mean "console operator only" definitely not, "everyone".
|
/lgtm cancel |
|
@jhadvig: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
@benjaminapetersen PR updated. PTAL |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: benjaminapetersen, jhadvig The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
https://jira.coreos.com/browse/CONSOLE-1423
Adding ConsoleCliDownloads controller that will take care of ConsoleCliDownloads
ocbinaries for different platforms./assign @benjaminapetersen