Skip to content

Commit

Permalink
Added new fields for cluster access.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesten Herrild committed Mar 18, 2024
1 parent 102b2ad commit 2efa136
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 0 deletions.
49 changes: 49 additions & 0 deletions internal/models/ekscluster/access_entry.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
Copyright 2022 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: MPL-2.0
*/

package models

import (
"github.com/go-openapi/swag"
)

// VmwareTanzuManageV1alpha1EksclusterAccessEntry EKS cluster IAM Access Entry.
//
// swagger:model vmware.tanzu.manage.v1alpha1.ekscluster.AccessEntry
type VmwareTanzuManageV1alpha1EksclusterAccessEntry struct {

// The AccessEntry will be primary if the value is set to true.
IsPrimary bool `json:"isPrimary,omitempty"`

// The user name to which the access entry is associated.
UserName string `json:"userName,omitempty"`

// The group names to which the access entry is associated.
GroupNames []string `json:"groupNames,omitempty"`

// Tags applied to AccessEntry.
Tags map[string]string `json:"tags,omitempty"`
}

// MarshalBinary interface implementation.
func (m *VmwareTanzuManageV1alpha1EksclusterAccessEntry) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}

return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation.
func (m *VmwareTanzuManageV1alpha1EksclusterAccessEntry) UnmarshalBinary(b []byte) error {
var res VmwareTanzuManageV1alpha1EksclusterAccessEntry
if err := swag.ReadJSON(b, &res); err != nil {
return err
}

*m = res

return nil
}
38 changes: 38 additions & 0 deletions internal/models/ekscluster/authentication_mode.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
Copyright 2024 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: MPL-2.0
*/

package models

const ()

Check failure on line 8 in internal/models/ekscluster/authentication_mode.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofmt`-ed with `-s` (gofmt)

// VmwareTanzuManageV1alpha1EksclusterAuthenticationMode The EKS authentication mode.
//
// - API: Controlled only by API.
// - API_AND_CONFIG_MAP: Controlled by API and by config map.
// - CONFIG_MAP: Controlled only by config map.
//
// swagger:model vmware.tanzu.manage.v1alpha1.ekscluster.AuthenticationMode
type VmwareTanzuManageV1alpha1EksclusterAuthenticationMode string

func NewVmwareTanzuManageV1alpha1EksAuthenticationMode(value VmwareTanzuManageV1alpha1EksclusterPhase) *VmwareTanzuManageV1alpha1EksclusterPhase {
return &value
}

// Pointer returns a pointer to a freshly-allocated VmwareTanzuManageV1alpha1EksclusterAuthenticationMode.
func (m VmwareTanzuManageV1alpha1EksclusterAuthenticationMode) Pointer() *VmwareTanzuManageV1alpha1EksclusterAuthenticationMode {
return &m
}

const (

// VmwareTanzuManageV1alpha1EksclusterAuthenticationModeAPI captures enum value "API".
VmwareTanzuManageV1alpha1EksclusterAuthenticationModeAPI VmwareTanzuManageV1alpha1EksclusterPhase = "API"

// VmwareTanzuManageV1alpha1EksclusterAuthenticationModeAPIANDCONFIGMAP captures enum value "API_AND_CONFIG_MAP".
VmwareTanzuManageV1alpha1EksclusterAuthenticationModeAPIANDCONFIGMAP VmwareTanzuManageV1alpha1EksclusterPhase = "API_AND_CONFIG_MAP"

// VmwareTanzuManageV1alpha1EksclusterAuthenticationModeCONFIGMAP captures enum value "CONFIG_MAP".
VmwareTanzuManageV1alpha1EksclusterAuthenticationModeCONFIGMAP VmwareTanzuManageV1alpha1EksclusterPhase = "CONFIG_MAP"
)
3 changes: 3 additions & 0 deletions internal/models/ekscluster/control_plane_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ type VmwareTanzuManageV1alpha1EksclusterControlPlaneConfig struct {

// EKS addons configuration.
AddonsConfig *VmwareTanzuManageV1alpha1EksclusterAddonsConfig `json:"addonsConfig,omitempty"`

// Authentication mode for the cluster.
AuthenticationMode VmwareTanzuManageV1alpha1EksclusterAuthenticationMode `json:"authenticationMode,omitempty"`
}

// MarshalBinary interface implementation.
Expand Down
3 changes: 3 additions & 0 deletions internal/models/ekscluster/spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2efa136

Please sign in to comment.