Skip to content

Commit

Permalink
add descriptions to all new API fields
Browse files Browse the repository at this point in the history
  • Loading branch information
cadenmarchese committed Aug 14, 2024
1 parent 27ea823 commit 74088f9
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 23 deletions.
31 changes: 24 additions & 7 deletions pkg/api/admin/openshiftcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,25 @@ type UpgradeableTo string

// PlatformWorkloadIdentity stores information representing a single workload identity.
type PlatformWorkloadIdentity struct {
// The name of the operator for which the PlatformWorkloadIdentity is used for
OperatorName string `json:"operatorName,omitempty"`
ResourceID string `json:"resourceId,omitempty"`
ClientID string `json:"clientId,omitempty" swagger:"readOnly"`
ObjectID string `json:"objectId,omitempty" swagger:"readOnly"`

// The resource ID of the PlatformWorkloadIdentity resource
ResourceID string `json:"resourceId,omitempty"`

// The ClientID of the PlatformWorkloadIdentity resource
ClientID string `json:"clientId,omitempty" swagger:"readOnly"`

// The ObjectID of the PlatformWorkloadIdentity resource
ObjectID string `json:"objectId,omitempty" swagger:"readOnly"`
}

// ClusterUserAssignedIdentity stores information about a user-assigned managed identity in a predefined format required by Microsoft's Managed Identity team.
type ClusterUserAssignedIdentity struct {
ClientID string `json:"clientId,omitempty"`
// The ClientID of the ClusterUserAssignedIdentity resource
ClientID string `json:"clientId,omitempty"`

// The PrincipalID of the ClusterUserAssignedIdentity resource
PrincipalID string `json:"principalId,omitempty"`
}

Expand All @@ -451,9 +461,16 @@ const (

// Identity stores information about the cluster MSI(s) in a workload identity cluster.
type Identity struct {
Type ResourceIdentityType `json:"type,omitempty"`
PrincipalID string `json:"principalId,omitempty" swagger:"readOnly"`
TenantID string `json:"tenantId,omitempty" swagger:"readOnly"`
// The type of the Identity resource.
Type ResourceIdentityType `json:"type,omitempty"`

// The PrincipalID of the Identity resource.
PrincipalID string `json:"principalId,omitempty" swagger:"readOnly"`

// The TenantID provided by the MSI RP
TenantID string `json:"tenantId,omitempty" swagger:"readOnly"`

// A map of ClusterUserAssigned identities attached to the cluster, specified in a type required by Microsoft's Managed Identity team.
UserAssignedIdentities map[string]ClusterUserAssignedIdentity `json:"userAssignedIdentities,omitempty"`
}

Expand Down
35 changes: 27 additions & 8 deletions pkg/api/openshiftcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,17 +800,27 @@ type UpgradeableTo string
type PlatformWorkloadIdentity struct {
MissingFields

// The name of the operator for which the PlatformWorkloadIdentity is used for
OperatorName string `json:"operatorName,omitempty"`
ResourceID string `json:"resourceId,omitempty"`
ClientID string `json:"clientId,omitempty" swagger:"readOnly"`
ObjectID string `json:"objectId,omitempty" swagger:"readOnly"`

// The resource ID of the PlatformWorkloadIdentity resource
ResourceID string `json:"resourceId,omitempty"`

// The ClientID of the PlatformWorkloadIdentity resource
ClientID string `json:"clientId,omitempty" swagger:"readOnly"`

// The ObjectID of the PlatformWorkloadIdentity resource
ObjectID string `json:"objectId,omitempty" swagger:"readOnly"`
}

// ClusterUserAssignedIdentity stores information about a user-assigned managed identity in a predefined format required by Microsoft's Managed Identity team.
type ClusterUserAssignedIdentity struct {
MissingFields

ClientID string `json:"clientId,omitempty"`
// The ClientID of the ClusterUserAssignedIdentity resource
ClientID string `json:"clientId,omitempty"`

// The PrincipalID of the ClusterUserAssignedIdentity resource
PrincipalID string `json:"principalId,omitempty"`
}

Expand All @@ -827,9 +837,18 @@ const (
type Identity struct {
MissingFields

Type ResourceIdentityType `json:"type,omitempty"`
PrincipalID string `json:"principalId,omitempty" swagger:"readOnly"`
// The type of the Identity resource.
Type ResourceIdentityType `json:"type,omitempty"`

// The PrincipalID of the Identity resource.
PrincipalID string `json:"principalId,omitempty" swagger:"readOnly"`

// A map of ClusterUserAssigned identities attached to the cluster, specified in a type required by Microsoft's Managed Identity team.
UserAssignedIdentities map[string]ClusterUserAssignedIdentity `json:"userAssignedIdentities,omitempty"`
IdentityURL string `json:"identityURL,omitempty" mutable:"true"`
TenantID string `json:"tenantId,omitempty" swagger:"readOnly"`

// The IdentityURL provided by the MSI RP
IdentityURL string `json:"identityURL,omitempty" mutable:"true"`

// The TenantID provided by the MSI RP
TenantID string `json:"tenantId,omitempty" swagger:"readOnly"`
}
31 changes: 24 additions & 7 deletions pkg/api/v20240812preview/openshiftcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,25 @@ type UpgradeableTo string

// PlatformWorkloadIdentity stores information representing a single workload identity.
type PlatformWorkloadIdentity struct {
// The name of the operator for which the PlatformWorkloadIdentity is used for
OperatorName string `json:"operatorName,omitempty" mutable:"true"`
ResourceID string `json:"resourceId,omitempty" mutable:"true"`
ClientID string `json:"clientId,omitempty" swagger:"readOnly" mutable:"true"`
ObjectID string `json:"objectId,omitempty" swagger:"readOnly" mutable:"true"`

// The resource ID of the PlatformWorkloadIdentity resource
ResourceID string `json:"resourceId,omitempty" mutable:"true"`

// The ClientID of the PlatformWorkloadIdentity resource
ClientID string `json:"clientId,omitempty" swagger:"readOnly" mutable:"true"`

// The ObjectID of the PlatformWorkloadIdentity resource
ObjectID string `json:"objectId,omitempty" swagger:"readOnly" mutable:"true"`
}

// ClusterUserAssignedIdentity stores information about a user-assigned managed identity in a predefined format required by Microsoft's Managed Identity team.
type ClusterUserAssignedIdentity struct {
ClientID string `json:"clientId,omitempty"`
// The ClientID of the ClusterUserAssignedIdentity resource
ClientID string `json:"clientId,omitempty"`

// The PrincipalID of the ClusterUserAssignedIdentity resource
PrincipalID string `json:"principalId,omitempty"`
}

Expand All @@ -322,9 +332,16 @@ const (

// Identity stores information about the cluster MSI(s) in a workload identity cluster.
type Identity struct {
Type ResourceIdentityType `json:"type,omitempty"`
PrincipalID string `json:"principalId,omitempty" swagger:"readOnly"`
TenantID string `json:"tenantId,omitempty" swagger:"readOnly"`
// The type of the Identity resource.
Type ResourceIdentityType `json:"type,omitempty"`

// The PrincipalID of the Identity resource.
PrincipalID string `json:"principalId,omitempty" swagger:"readOnly"`

// The TenantID provided by the MSI RP
TenantID string `json:"tenantId,omitempty" swagger:"readOnly"`

// A map of ClusterUserAssigned identities attached to the cluster, specified in a type required by Microsoft's Managed Identity team.
UserAssignedIdentities map[string]ClusterUserAssignedIdentity `json:"userAssignedIdentities,omitempty"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1825,9 +1825,11 @@
"type": "object",
"properties": {
"clientId": {
"description": "The ClientID of the ClusterUserAssignedIdentity resource",
"type": "string"
},
"principalId": {
"description": "The PrincipalID of the ClusterUserAssignedIdentity resource",
"type": "string"
}
}
Expand Down Expand Up @@ -1904,17 +1906,21 @@
"type": "object",
"properties": {
"type": {
"$ref": "#/definitions/ResourceIdentityType"
"$ref": "#/definitions/ResourceIdentityType",
"description": "The type of the Identity resource."
},
"principalId": {
"description": "The PrincipalID of the Identity resource.",
"type": "string",
"readOnly": true
},
"tenantId": {
"description": "The TenantID provided by the MSI RP",
"type": "string",
"readOnly": true
},
"userAssignedIdentities": {
"description": "A map of ClusterUserAssigned identities attached to the cluster, specified in a type required by Microsoft's Managed Identity team.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/ClusterUserAssignedIdentity"
Expand Down Expand Up @@ -2345,16 +2351,20 @@
"type": "object",
"properties": {
"operatorName": {
"description": "The name of the operator for which the PlatformWorkloadIdentity is used for",
"type": "string"
},
"resourceId": {
"description": "The resource ID of the PlatformWorkloadIdentity resource",
"type": "string"
},
"clientId": {
"description": "The ClientID of the PlatformWorkloadIdentity resource",
"type": "string",
"readOnly": true
},
"objectId": {
"description": "The ObjectID of the PlatformWorkloadIdentity resource",
"type": "string",
"readOnly": true
}
Expand Down

0 comments on commit 74088f9

Please sign in to comment.