-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #359 from vmware/add-support-for-aks-managed-ident…
…ities Add support for aks managed identities
- Loading branch information
Showing
10 changed files
with
284 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
Copyright 2023 VMware, Inc. All Rights Reserved. | ||
SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
|
||
package models | ||
|
||
import "github.com/go-openapi/swag" | ||
|
||
// VmwareTanzuManageV1alpha1AksclusterManagedIdentityConfig The managed identity config. | ||
// | ||
// swagger:model vmware.tanzu.manage.v1alpha1.akscluster.ManagedIdentityConfig | ||
type VmwareTanzuManageV1alpha1AksclusterManagedIdentityConfig struct { | ||
Type *VmwareTanzuManageV1alpha1AksclusterManagedIdentityType `json:"type,omitempty"` | ||
|
||
UserAssignedIdentityType *VmwareTanzuManageV1alpha1AksclusterUserAssignedIdentityTypeConfig `json:"userAssigned,omitempty"` | ||
} | ||
|
||
// MarshalBinary interface implementation. | ||
func (m *VmwareTanzuManageV1alpha1AksclusterManagedIdentityConfig) MarshalBinary() ([]byte, error) { | ||
if m == nil { | ||
return nil, nil | ||
} | ||
|
||
return swag.WriteJSON(m) | ||
} | ||
|
||
// UnmarshalBinary interface implementation. | ||
func (m *VmwareTanzuManageV1alpha1AksclusterManagedIdentityConfig) UnmarshalBinary(b []byte) error { | ||
var res VmwareTanzuManageV1alpha1AksclusterManagedIdentityConfig | ||
if err := swag.ReadJSON(b, &res); err != nil { | ||
return err | ||
} | ||
|
||
*m = res | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
Copyright 2023 VMware, Inc. All Rights Reserved. | ||
SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
|
||
package models | ||
|
||
import ( | ||
"encoding/json" | ||
) | ||
|
||
// VmwareTanzuManageV1alpha1AksclusterManagedIdentityType Managed identity type options of identity config. | ||
// | ||
// - IDENTITY_TYPE_SYSTEM_ASSIGNED: Indicates that a system assigned managed identity should be used by the cluster. | ||
// - IDENTITY_TYPE_USER_ASSIGNED: Indicates that a user assigned managed identity should be used by the cluster. | ||
// | ||
// swagger:model vmware.tanzu.manage.v1alpha1.akscluster.ManagedIdentityType | ||
type VmwareTanzuManageV1alpha1AksclusterManagedIdentityType string | ||
|
||
func NewVmwareTanzuManageV1alpha1AksclusterManagedIdentityType(value VmwareTanzuManageV1alpha1AksclusterManagedIdentityType) *VmwareTanzuManageV1alpha1AksclusterManagedIdentityType { | ||
return &value | ||
} | ||
|
||
// Pointer returns a pointer to a freshly-allocated VmwareTanzuManageV1alpha1AksclusterManagedIdentityType. | ||
func (m VmwareTanzuManageV1alpha1AksclusterManagedIdentityType) Pointer() *VmwareTanzuManageV1alpha1AksclusterManagedIdentityType { | ||
return &m | ||
} | ||
|
||
const ( | ||
|
||
// VmwareTanzuManageV1alpha1AksclusterManagedIdentityTypeSYSTEMASSIGNED captures enum value "IDENTITY_TYPE_SYSTEM_ASSIGNED". | ||
VmwareTanzuManageV1alpha1AksclusterManagedIdentityTypeSYSTEMASSIGNED VmwareTanzuManageV1alpha1AksclusterManagedIdentityType = "IDENTITY_TYPE_SYSTEM_ASSIGNED" | ||
|
||
// VmwareTanzuManageV1alpha1AksclusterManagedIdentityTypeUSERASSIGNED captures enum value "IDENTITY_TYPE_USER_ASSIGNED". | ||
VmwareTanzuManageV1alpha1AksclusterManagedIdentityTypeUSERASSIGNED VmwareTanzuManageV1alpha1AksclusterManagedIdentityType = "IDENTITY_TYPE_USER_ASSIGNED" | ||
) | ||
|
||
// for schema. | ||
var vmwareTanzuManageV1alpha1AksclusterManagedIdentityTypeEnum []interface{} | ||
|
||
func init() { | ||
var res []VmwareTanzuManageV1alpha1AksclusterManagedIdentityType | ||
if err := json.Unmarshal([]byte(`["IDENTITY_TYPE_SYSTEM_ASSIGNED","IDENTITY_TYPE_USER_ASSIGNED"]`), &res); err != nil { | ||
panic(err) | ||
} | ||
|
||
for _, v := range res { | ||
vmwareTanzuManageV1alpha1AksclusterManagedIdentityTypeEnum = append(vmwareTanzuManageV1alpha1AksclusterManagedIdentityTypeEnum, v) | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
internal/models/akscluster/user_assigned_identity_config.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
Copyright 2023 VMware, Inc. All Rights Reserved. | ||
SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
|
||
package models | ||
|
||
import "github.com/go-openapi/swag" | ||
|
||
// VmwareTanzuManageV1alpha1AksclusterUserAssignedIdentityTypeConfig The managed identity config. | ||
// | ||
// swagger:model vmware.tanzu.manage.v1alpha1.akscluster.UserAssignedIdentityTypeConfig | ||
|
||
type VmwareTanzuManageV1alpha1AksclusterUserAssignedIdentityTypeConfig struct { | ||
ManagedResourceID string `json:"resourceId,omitempty"` | ||
} | ||
|
||
// MarshalBinary interface implementation. | ||
func (m *VmwareTanzuManageV1alpha1AksclusterUserAssignedIdentityTypeConfig) MarshalBinary() ([]byte, error) { | ||
if m == nil { | ||
return nil, nil | ||
} | ||
|
||
return swag.WriteJSON(m) | ||
} | ||
|
||
// UnmarshalBinary interface implementation. | ||
func (m *VmwareTanzuManageV1alpha1AksclusterUserAssignedIdentityTypeConfig) UnmarshalBinary(b []byte) error { | ||
var res VmwareTanzuManageV1alpha1AksclusterUserAssignedIdentityTypeConfig | ||
if err := swag.ReadJSON(b, &res); err != nil { | ||
return err | ||
} | ||
|
||
*m = res | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters