Skip to content
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

Refactor the GSuite Reconciler #3407

Closed
wants to merge 6 commits into from

Conversation

upodroid
Copy link
Member

Fixes: #3356

There are a few prowjobs that need to be updated.

/cc @dims @evankanderson

@k8s-ci-robot
Copy link
Contributor

@upodroid: GitHub didn't allow me to request PR reviews from the following users: evankanderson.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Fixes: #3356

There are a few prowjobs that need to be updated.

/cc @dims @evankanderson

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.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 16, 2022

CLA Signed

The committers are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Feb 16, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @upodroid!

It looks like this is your first PR to kubernetes/k8s.io 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/k8s.io has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 16, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @upodroid. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. area/access Define who has access to what via IAM bindings, role bindings, policy, etc. area/groups Google Groups management, code in groups/ sig/k8s-infra Categorizes an issue or PR as relevant to SIG K8s Infra. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 16, 2022
@dims
Copy link
Member

dims commented Feb 16, 2022

/assign @cblecker

Copy link

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few cleanup comments -- a couple are musings on the code that should at most result in a TODO rather than any actual code changes.

I'm also suggesting you walk back a few of the code changes, because the validation seems Kubernetes-specific enough that it's not worth trying to make it generic right now (and we can always figure out how to do that in the future if someone ends up wanting something similar).

groups/main.go Outdated Show resolved Hide resolved
}

PrintConfig(config)
err = restrictionsConfig.Load(config.RestrictionsPath)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's odd that there is a restrictions-path flag, but it's not used here.

Should config be used to specify these values for the validate command, or should the plan and apply commands consider the restrictions-path flag?

I'm concerned that having two different ways to load this will cause someone to call validate with different settings that will actually be used for apply, and they will think that they are doing something valid and safe when they actually aren't.

log.Fatal(err)
}

err = groupsConfig.Load(config.GroupsPath, &restrictionsConfig)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto with groups-path.

groups/main.go Outdated Show resolved Hide resolved
groups/main.go Outdated Show resolved Hide resolved
groups/validate.go Outdated Show resolved Hide resolved
for _, g := range cfg.Groups {
if g.EmailId == "gke-security-groups@kubernetes.io" {
for _, g := range groupsConfig.Groups {
if g.EmailId == "gke-security-groups@"+primaryDomain {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure swapping this for primaryDomain helps much in terms of portability. I'd leave this as k8s-specific and just opt people out of this test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a useful for feature for anyone doing Google Groups RBAC for GKE. We'll be using this in Knative. In GSuite, there is a primary domain and secondary domains and key features are tied to the primary domain(item 0 in the list)

https://support.google.com/a/answer/7009324?hl=en

}
for email, found := range rbacEmails {
if !found {
t.Errorf("group '%s': must be a member of gke-security-groups@kubernetes.io", email)
log.Printf("group '%s': must be a member of gke-security-groups@"+primaryDomain, email)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A 👎 on combining log.Printf and string + -- but I'd switch these back to @kubernetes.io anyway.

groups/validate.go Outdated Show resolved Hide resolved
groups/validate.go Outdated Show resolved Hide resolved
@dims
Copy link
Member

dims commented Mar 9, 2022

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 9, 2022
@upodroid
Copy link
Member Author

upodroid commented Mar 9, 2022

Forgot about this, will address the remaining feedback from Evan by tomorrow.

@puerco
Copy link
Member

puerco commented Mar 10, 2022

CI failure fixed in #3495
/test pull-k8sio-verify

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 10, 2022
@upodroid
Copy link
Member Author

upodroid commented Mar 10, 2022

@puerco The CI is still broken. The yamllint error is for k8s.gcr.io/* files. Did rebase from main now.

nvm main.go has bad headers

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 8, 2022
Copy link

/remove-lifecycle-stale

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 14, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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.

@upodroid
Copy link
Member Author

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Aug 15, 2022
@k8s-ci-robot
Copy link
Contributor

@upodroid: Reopened this PR.

In response to this:

/reopen

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.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: upodroid
Once this PR has been reviewed and has the lgtm label, please ask for approval from cblecker by writing /assign @cblecker in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

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

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 23, 2022
@k8s-ci-robot
Copy link
Contributor

@upodroid: PR needs rebase.

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.

@dims
Copy link
Member

dims commented Aug 23, 2022

let's close this for now. it's not getting eyes and it needs a rebase anyway as many things have changed.

@dims dims closed this Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/access Define who has access to what via IAM bindings, role bindings, policy, etc. area/groups Google Groups management, code in groups/ cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/k8s-infra Categorizes an issue or PR as relevant to SIG K8s Infra. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor GSuite Groups Reconciler Application
7 participants