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

Fix: IAP cannot be disabled #2601

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

yfuruyama
Copy link
Contributor

@yfuruyama yfuruyama commented Jul 15, 2024

Issue Overview

Currently when disabling IAP with the following BackendConfig,

apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
  name: iap-backendconfig
spec:
  iap:
    enabled: false

it results with a following sync error:

Error syncing to GCP: error running backend syncing routine: Errored updating IAP Settings for service default/sample-svc: Cannot switch to default OAuth once IAP credentials have been set

Issue Details

This is because when spec.iap.enabled: false is applied, the validation is skipped and beConfig.Spec.Iap.OAuthClientCredentials won't be fulfilled properly (code), so switchingToDefault function always uses the blank OAuth client credentials and returns the error here.

This might be a regression that was introduced by this commit.

About this PR

This PR added the validation in switchingToDefault so that it can continue updating the IAP setting when it's disabled.

I tested this change with manual l7-lb-controller deployment and disabling IAP succeeded with the following logs.

[2024-07-15 21:10:39.058 JST] "Iap `enabled` setting changed: " logger="IngressController.SyncBackends.EnsureIAP" ingressKey="default/sample-ingress" syncId=750146048 backendServiceName="k8s1-f9080803-default-sample-svc-443-b069e533" backendVersion="ga" backendScope="global" port=0 service="default/sample-svc" from=true to=false 

[2024-07-15 21:10:39.058 JST] "Updated IAP settings" logger="IngressController.SyncBackends.EnsureIAP" ingressKey="default/sample-ingress" syncId=750146048 backendServiceName="k8s1-f9080803-default-sample-svc-443-b069e533" backendVersion="ga" backendScope="global" port=0 service="default/sample-svc" 

[2024-07-15 21:10:39.058 JST] "Updating ga BackendService" logger="IngressController.SyncBackends" ingressKey="default/sample-ingress" syncId=750146048 backendServiceName="k8s1-f9080803-default-sample-svc-443-b069e533" backendVersion="ga" backendScope="global" port=0 name="k8s1-f9080803-default-sample-svc-443-b069e533" 

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 15, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @yfuruyama. 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 15, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yfuruyama
Once this PR has been reviewed and has the lgtm label, please assign mrhohn for approval. 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

@swetharepakula
Copy link
Member

/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 Jul 18, 2024
@swetharepakula
Copy link
Member

/hold

After some offline discussion, we are waiting on changes on the underlying Arcus API before proceeding with this PR. We may be able to remove the validation completely.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 19, 2024
@k8s-triage-robot
Copy link

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

This bot triages 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 PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this 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 Oct 17, 2024
@k8s-triage-robot
Copy link

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

This bot triages 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 PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this 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 Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants