Merge pull request #11391 from johngmyers/no-public-jwks

Don't use PublicJWKS in TestAWSLBController
This commit is contained in:
Kubernetes Prow Robot 2021-05-06 01:05:15 -07:00 committed by GitHub
commit 3b719f3c8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 16 deletions

View File

@ -320,11 +320,11 @@ func TestVFSServiceAccountIssuerDiscovery(t *testing.T) {
} }
// TestAWSLBController runs a simple configuration, but with AWS LB controller, UseServiceAccountIAM and PublicJWKS enabled // TestAWSLBController runs a simple configuration, but with AWS LB controller and UseServiceAccountIAM enabled
func TestAWSLBController(t *testing.T) { func TestAWSLBController(t *testing.T) {
featureflag.ParseFlags("+UseServiceAccountIAM,+PublicJWKS") featureflag.ParseFlags("+UseServiceAccountIAM")
unsetFeatureFlags := func() { unsetFeatureFlags := func() {
featureflag.ParseFlags("-UseServiceAccountIAM,-PublicJWKS") featureflag.ParseFlags("-UseServiceAccountIAM")
} }
defer unsetFeatureFlags() defer unsetFeatureFlags()

View File

@ -17,8 +17,6 @@ limitations under the License.
package components package components
import ( import (
"strings"
"k8s.io/kops/pkg/apis/kops" "k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/featureflag" "k8s.io/kops/pkg/featureflag"
"k8s.io/kops/pkg/model/iam" "k8s.io/kops/pkg/model/iam"
@ -64,14 +62,9 @@ func (b *DiscoveryOptionsBuilder) BuildOptions(o interface{}) error {
kubeAPIServer.FeatureGates = make(map[string]string) kubeAPIServer.FeatureGates = make(map[string]string)
} }
kubeAPIServer.FeatureGates["ServiceAccountIssuerDiscovery"] = "true" kubeAPIServer.FeatureGates["ServiceAccountIssuerDiscovery"] = "true"
}
if kubeAPIServer.ServiceAccountJWKSURI == nil { if kubeAPIServer.ServiceAccountJWKSURI == nil {
jwksURL := *kubeAPIServer.ServiceAccountIssuer
jwksURL = strings.TrimSuffix(jwksURL, "/") + "/keys.json"
kubeAPIServer.ServiceAccountJWKSURI = &jwksURL
}
} else if kubeAPIServer.ServiceAccountJWKSURI == nil {
jwksURI, err := iam.ServiceAccountIssuer(clusterSpec) jwksURI, err := iam.ServiceAccountIssuer(clusterSpec)
if err != nil { if err != nil {
return err return err

View File

@ -190,8 +190,6 @@ kubeAPIServer:
- http://127.0.0.1:4001 - http://127.0.0.1:4001
etcdServersOverrides: etcdServersOverrides:
- /events#http://127.0.0.1:4002 - /events#http://127.0.0.1:4002
featureGates:
ServiceAccountIssuerDiscovery: "true"
image: k8s.gcr.io/kube-apiserver:v1.21.0 image: k8s.gcr.io/kube-apiserver:v1.21.0
kubeletPreferredAddressTypes: kubeletPreferredAddressTypes:
- InternalIP - InternalIP
@ -208,7 +206,7 @@ kubeAPIServer:
- X-Remote-User - X-Remote-User
securePort: 443 securePort: 443
serviceAccountIssuer: https://discovery.example.com/minimal.example.com/oidc serviceAccountIssuer: https://discovery.example.com/minimal.example.com/oidc
serviceAccountJWKSURI: https://discovery.example.com/minimal.example.com/oidc/keys.json serviceAccountJWKSURI: https://discovery.example.com/minimal.example.com/oidc/openid/v1/jwks
serviceClusterIPRange: 100.64.0.0/13 serviceClusterIPRange: 100.64.0.0/13
storageBackend: etcd3 storageBackend: etcd3
kubeControllerManager: kubeControllerManager:

View File

@ -208,7 +208,7 @@ kubeAPIServer:
- X-Remote-User - X-Remote-User
securePort: 443 securePort: 443
serviceAccountIssuer: https://discovery.example.com/minimal.example.com/oidc serviceAccountIssuer: https://discovery.example.com/minimal.example.com/oidc
serviceAccountJWKSURI: https://discovery.example.com/minimal.example.com/oidc/keys.json serviceAccountJWKSURI: https://discovery.example.com/minimal.example.com/oidc/openid/v1/jwks
serviceClusterIPRange: 100.64.0.0/13 serviceClusterIPRange: 100.64.0.0/13
storageBackend: etcd3 storageBackend: etcd3
kubeControllerManager: kubeControllerManager: