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

[AutoPR containerservice/resource-manager] Add identity property in managedCluster definition and add an example #2390

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export {
ManagedClusterAddonProfile,
ContainerServiceNetworkProfile,
ManagedClusterAADProfile,
ManagedClusterIdentity,
ManagedClusterAccessProfile
} from "../models/mappers";

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export {
ManagedClusterAddonProfile,
ContainerServiceNetworkProfile,
ManagedClusterAADProfile,
ManagedClusterIdentity,
ManagedClusterAccessProfile
} from "../models/mappers";

45 changes: 45 additions & 0 deletions packages/@azure/arm-containerservice/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,38 @@ export interface ManagedClusterAADProfile {
tenantID?: string;
}

/**
* @interface
* An interface representing ManagedClusterIdentity.
* Identity for the managed cluster.
*
*/
export interface ManagedClusterIdentity {
/**
* @member {string} [principalId] The principal id of the system assigned
* identity which is used by master components.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly principalId?: string;
/**
* @member {string} [tenantId] The tenant id of the system assigned identity
* which is used by master components.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly tenantId?: string;
/**
* @member {ResourceIdentityType} [type] The type of identity used for the
* managed cluster. Type 'SystemAssigned' will use an implicitly created
* identity in master components and an auto-created user assigned identity
* in MC_ resource group in agent nodes. Type 'None' will not use MSI for the
* managed cluster, service principal will be used instead. Possible values
* include: 'SystemAssigned', 'None'
*/
type?: ResourceIdentityType;
}

/**
* @interface
* An interface representing ManagedCluster.
Expand Down Expand Up @@ -1404,6 +1436,11 @@ export interface ManagedCluster extends Resource {
* Ranges to kubernetes API server.
*/
apiServerAuthorizedIPRanges?: string[];
/**
* @member {ManagedClusterIdentity} [identity] The identity of the managed
* cluster, if configured.
*/
identity?: ManagedClusterIdentity;
}

/**
Expand Down Expand Up @@ -1834,6 +1871,14 @@ export type NetworkPolicy = 'calico' | 'azure';
*/
export type LoadBalancerSku = 'standard' | 'basic';

/**
* Defines values for ResourceIdentityType.
* Possible values include: 'SystemAssigned', 'None'
* @readonly
* @enum {string}
*/
export type ResourceIdentityType = 'SystemAssigned' | 'None';

/**
* Contains response data for the list operation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export {
ManagedClusterAddonProfile,
ContainerServiceNetworkProfile,
ManagedClusterAADProfile,
ManagedClusterIdentity,
CloudError,
ManagedClusterUpgradeProfile,
ManagedClusterPoolUpgradeProfile,
Expand Down
41 changes: 41 additions & 0 deletions packages/@azure/arm-containerservice/lib/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,40 @@ export const ManagedClusterAADProfile: msRest.CompositeMapper = {
}
};

export const ManagedClusterIdentity: msRest.CompositeMapper = {
serializedName: "ManagedClusterIdentity",
type: {
name: "Composite",
className: "ManagedClusterIdentity",
modelProperties: {
principalId: {
readOnly: true,
serializedName: "principalId",
type: {
name: "String"
}
},
tenantId: {
readOnly: true,
serializedName: "tenantId",
type: {
name: "String"
}
},
type: {
serializedName: "type",
type: {
name: "Enum",
allowedValues: [
"SystemAssigned",
"None"
]
}
}
}
}
};

export const ManagedCluster: msRest.CompositeMapper = {
serializedName: "ManagedCluster",
type: {
Expand Down Expand Up @@ -1542,6 +1576,13 @@ export const ManagedCluster: msRest.CompositeMapper = {
}
}
}
},
identity: {
serializedName: "identity",
type: {
name: "Composite",
className: "ManagedClusterIdentity"
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export {
ManagedClusterAddonProfile,
ContainerServiceNetworkProfile,
ManagedClusterAADProfile,
ManagedClusterIdentity,
ManagedClusterAccessProfile
} from "../models/mappers";