Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ linters-settings:
# It's a comma-separated list of prefixes.
# Default: ""
local-prefixes: github.com/openshift
issues:
include:
- EXC0012 # EXC0012 revive: issue about not having a comment on exported.
- EXC0014 # EXC0014 revive: issue about not having a comment in the right format.
2 changes: 2 additions & 0 deletions pkg/asset/agent/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ func SupportedHivePlatforms() []string {
return platforms
}

// HivePlatformType returns the PlatformType for the ZTP Hive API corresponding
// to the given InstallConfig platform.
func HivePlatformType(platform types.Platform) hiveext.PlatformType {
switch platform.Name() {
case baremetal.Name:
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/agent/image/cpio.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (ca *CpioArchive) StoreFile(filename string, dstPath string) error {
return nil
}

// Save the content of the current archive and returns
// SaveBuffer saves the content of the current archive and returns
// the buffer content.
func (ca *CpioArchive) SaveBuffer() ([]byte, error) {
err := ca.cpioWriter.Close()
Expand Down
14 changes: 12 additions & 2 deletions pkg/asset/manifests/nutanix/cloudproviderconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,44 @@ import (
nutanixtypes "github.com/openshift/installer/pkg/types/nutanix"
)

// Config of Nutanix cloud provider
// CloudConfig is the config of Nutanix cloud provider
// ref: https://github.com/nutanix-cloud-native/cloud-provider-nutanix/blob/main/pkg/provider/config/config.go
type CloudConfig struct {
PrismCentral PrismEndpoint `json:"prismCentral"`
TopologyDiscovery TopologyDiscovery `json:"topologyDiscovery"`
EnableCustomLabeling bool `json:"enableCustomLabeling"`
}

// TopologyDiscovery of the cloud provider.
type TopologyDiscovery struct {
// Default type will be set to Prism via the newConfig function
Type TopologyDiscoveryType `json:"type"`
TopologyCategories *TopologyCategories `json:"topologyCategories"`
}

// TopologyDiscoveryType type alias.
type TopologyDiscoveryType string

const (
PrismTopologyDiscoveryType = TopologyDiscoveryType("Prism")
// PrismTopologyDiscoveryType is the DiscoveryType for Prism provider.
PrismTopologyDiscoveryType = TopologyDiscoveryType("Prism")
// CategoriesTopologyDiscoveryType is the DiscoveryType for Categories provider.
CategoriesTopologyDiscoveryType = TopologyDiscoveryType("Categories")
)

// TopologyInfo contains topology information.
type TopologyInfo struct {
Zone string `json:"zone"`
Region string `json:"region"`
}

// TopologyCategories contains topology categories.
type TopologyCategories struct {
ZoneCategory string `json:"zoneCategory"`
RegionCategory string `json:"regionCategory"`
}

// PrismEndpoint contains endpoint details for Prism provider.
type PrismEndpoint struct {
// address is the endpoint address (DNS name or IP address) of the Nutanix Prism Central or Element (cluster)
Address string `json:"address"`
Expand All @@ -51,10 +58,13 @@ type PrismEndpoint struct {
CredentialRef *CredentialReference `json:"credentialRef,omitempty"`
}

// CredentialKind type alias.
type CredentialKind string

// SecretKind a credential of type "Secret".
var SecretKind = CredentialKind("Secret")

// CredentialReference holds details of a credential.
type CredentialReference struct {
// Kind of the Nutanix credential
Kind CredentialKind `json:"kind"`
Expand Down
1 change: 1 addition & 0 deletions pkg/destroy/aws/iamhelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
)

const (
// ErrCodeAccessDeniedException is the access denied error code returned by IAM.
ErrCodeAccessDeniedException = "AccessDeniedException"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/types/vsphere/conversion/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

var localLogger = logrus.New()

// ConvertInstallConfig modifies a given platform spec for the new requirements.
func ConvertInstallConfig(config *types.InstallConfig) error {
platform := config.Platform.VSphere

Expand Down
2 changes: 2 additions & 0 deletions pkg/validate/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package validate

import "os"

// IsAgentBasedInstallation determines whether we are using the 'agent'
// subcommand to install.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will conflict with my PR that deletes this code altogether, but if that's the price of stopping the bleeding I am ok with it :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can also rebase this if you prefer that your PR gets merged first.

func IsAgentBasedInstallation() bool {
if len(os.Args) > 1 {
for _, arg := range os.Args {
Expand Down