mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-02 17:57:33 +00:00
plumb service account token down to csi driver
This commit is contained in:
@@ -520,6 +520,12 @@ func AddHandlers(h printers.PrintHandler) {
|
||||
Name: "StorageCapacity", Type: "boolean", Description: storagev1.CSIDriverSpec{}.SwaggerDoc()["storageCapacity"],
|
||||
})
|
||||
}
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.CSIServiceAccountToken) {
|
||||
csiDriverColumnDefinitions = append(csiDriverColumnDefinitions, []metav1.TableColumnDefinition{
|
||||
{Name: "TokenRequests", Type: "string", Description: storagev1.CSIDriverSpec{}.SwaggerDoc()["tokenRequests"]},
|
||||
{Name: "RequiresRepublish", Type: "boolean", Description: storagev1.CSIDriverSpec{}.SwaggerDoc()["requiresRepublish"]},
|
||||
}...)
|
||||
}
|
||||
csiDriverColumnDefinitions = append(csiDriverColumnDefinitions, []metav1.TableColumnDefinition{
|
||||
{Name: "Modes", Type: "string", Description: storagev1.CSIDriverSpec{}.SwaggerDoc()["volumeLifecycleModes"]},
|
||||
{Name: "Age", Type: "string", Description: metav1.ObjectMeta{}.SwaggerDoc()["creationTimestamp"]},
|
||||
@@ -1395,6 +1401,21 @@ func printCSIDriver(obj *storage.CSIDriver, options printers.GenerateOptions) ([
|
||||
}
|
||||
row.Cells = append(row.Cells, storageCapacity)
|
||||
}
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.CSIServiceAccountToken) {
|
||||
tokenRequests := "<unset>"
|
||||
if obj.Spec.TokenRequests != nil {
|
||||
audiences := []string{}
|
||||
for _, t := range obj.Spec.TokenRequests {
|
||||
audiences = append(audiences, t.Audience)
|
||||
}
|
||||
tokenRequests = strings.Join(audiences, ",")
|
||||
}
|
||||
requiresRepublish := false
|
||||
if obj.Spec.RequiresRepublish != nil {
|
||||
requiresRepublish = *obj.Spec.RequiresRepublish
|
||||
}
|
||||
row.Cells = append(row.Cells, tokenRequests, requiresRepublish)
|
||||
}
|
||||
row.Cells = append(row.Cells, modes, translateTimestampSince(obj.CreationTimestamp))
|
||||
return []metav1.TableRow{row}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user