Skip to content

Conversation

@jhadvig
Copy link
Member

@jhadvig jhadvig commented Oct 3, 2019

https://jira.coreos.com/browse/CONSOLE-1423

Adding ConsoleCliDownloads controller that will take care of ConsoleCliDownloads oc binaries for different platforms.

/assign @benjaminapetersen

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 3, 2019
}
}

func GetOrCreate(consoleClient consolev1client.ConsoleCLIDownloadInterface, required *v1.ConsoleCLIDownload) (*v1.ConsoleCLIDownload, bool, error) {
Copy link
Contributor

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.

@jhadvig
Copy link
Member Author

jhadvig commented Oct 8, 2019

@benjaminapetersen updated the PR. The controller will make sure the ConsoleCliDownload CR will be created for oc and odo (@spadgett FYI)
Already started to work on the unit tests but need to align on the format of the controller.

Also I've seen #309 ... after it will land will update the PR with HandleDegraded as we spoke.

PTAL

@jhadvig jhadvig changed the title [WIP] Add ConsoleCliDownloads controller Add ConsoleCliDownloads controller Oct 9, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 9, 2019
resourceSyncer,
)

cliDownloadsController := clidownloads.NewCLIDownloadsSyncController(
Copy link
Contributor

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,
)

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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,

Copy link
Contributor

@benjaminapetersen benjaminapetersen Oct 10, 2019

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 changes

We have to be informed of changes AND get the route to use the host, my bad.

@jhadvig jhadvig force-pushed the cli_url_crd branch 2 times, most recently from f18dbdd to 1502751 Compare October 10, 2019 11:24
@jhadvig
Copy link
Member Author

jhadvig commented Oct 10, 2019

@benjaminapetersen Ive updated the PR based on comments also added comments.

Added a removeCLIDownloads() method for the Removed operator state.

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

@benjaminapetersen
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 15, 2019
@benjaminapetersen
Copy link
Contributor

/retest

Terraform failed.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@benjaminapetersen
Copy link
Contributor

And here is our test failure:

fail [github.com/openshift/origin/test/extended/authorization/rbac/groups_default_rules.go:221]: Oct 15 19:10:38.376: system:authenticated has extra permissions in namespace "":
{APIGroups:["console.openshift.io"], Resources:["consoleclidownloads"], Verbs:["create" "update" "delete"]}

@spadgett

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@benjaminapetersen
Copy link
Contributor

/retest

openshift/origin#23975 has merged so test should be unblocked.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@jhadvig
Copy link
Member Author

jhadvig commented Oct 16, 2019

/retest

3 similar comments
@jhadvig
Copy link
Member Author

jhadvig commented Oct 16, 2019

/retest

@jhadvig
Copy link
Member Author

jhadvig commented Oct 16, 2019

/retest

@jhadvig
Copy link
Member Author

jhadvig commented Oct 16, 2019

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

- get
- list
- watch
- create
Copy link
Member

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

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor

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".

@spadgett
Copy link
Member

/lgtm cancel
RBAC is incorrect

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2019
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Oct 17, 2019

@jhadvig: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws 598c5ad link /test e2e-aws

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.

Details

Instructions 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.

@jhadvig
Copy link
Member Author

jhadvig commented Oct 18, 2019

@benjaminapetersen PR updated. PTAL

@benjaminapetersen
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 18, 2019
@openshift-ci-robot
Copy link
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 8ffe751 into openshift:master Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants