Merge pull request #11791 from olemarkus/discovery-is-wellknown

Delete all files in the provided discoveryStore on cluster deletion
This commit is contained in:
Kubernetes Prow Robot 2021-06-18 01:14:04 -07:00 committed by GitHub
commit 451f47fd4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

View File

@ -201,6 +201,25 @@ func deleteAllPaths(basePath vfs.Path) error {
return nil
}
func (c *VFSClientset) DeleteCluster(ctx context.Context, cluster *kops.Cluster) error {
if cluster.Spec.ServiceAccountIssuerDiscovery != nil {
discoveryStore := cluster.Spec.ServiceAccountIssuerDiscovery.DiscoveryStore
if discoveryStore != "" {
path, err := vfs.Context.BuildVfsPath(discoveryStore)
if err != nil {
return err
}
err = path.Join("openid/v1/jwks").Remove()
if err != nil {
return err
}
err = path.Join(".well-known/openid-configuration").Remove()
if err != nil {
return err
}
}
}
secretStore := cluster.Spec.SecretStore
if secretStore != "" {
path, err := vfs.Context.BuildVfsPath(secretStore)