diff --git a/hack/go-fmt.sh b/hack/go-fmt.sh index 2bb3b45d25..8bba626422 100755 --- a/hack/go-fmt.sh +++ b/hack/go-fmt.sh @@ -9,6 +9,6 @@ else --env IS_CONTAINER=TRUE \ --volume "${PWD}:/go/src/github.com/openshift/installer:z" \ --workdir /go/src/github.com/openshift/installer \ - docker.io/golang:1.18 \ + docker.io/golang:1.19 \ ./hack/go-fmt.sh "${@}" fi diff --git a/pkg/asset/agent/manifests/network-scripts.go b/pkg/asset/agent/manifests/network-scripts.go index 2f066cdf38..867e47731d 100644 --- a/pkg/asset/agent/manifests/network-scripts.go +++ b/pkg/asset/agent/manifests/network-scripts.go @@ -8,27 +8,28 @@ package manifests // If the user provides static network configuration, the network config files will be stored in directory // /etc/assisted/network in the following structure: // /etc/assisted/network/ -// +-- host1 -// | +--- *.nmconnection -// | +--- mac_interface.ini -// +-- host2 -// +--- *.nmconnection -// +--- mac_interface.ini -// 1. *.nmconnections - files generated by nmstate based on yaml files provided by the user -// 2. mac_interface.ini - the file contains mapping of mac-address to logical interface name. -// There are two usages for the file: -// 1. Map logical interface name to MAC Address of the host. The logical interface name is a +// +// +-- host1 +// | +--- *.nmconnection +// | +--- mac_interface.ini +// +-- host2 +// +--- *.nmconnection +// +--- mac_interface.ini +// 1. *.nmconnections - files generated by nmstate based on yaml files provided by the user +// 2. mac_interface.ini - the file contains mapping of mac-address to logical interface name. +// There are two usages for the file: +// a. Map logical interface name to MAC Address of the host. The logical interface name is a // name provided by the user for the interface. It will be replaced by the script with the // actual network interface name. -// 2. Identify the host directory which belongs to the current host by matching a MAC Address +// b. Identify the host directory which belongs to the current host by matching a MAC Address // from the mapping file with host network interfaces. // // Applying the network configuration of each host will be done by: -// 1. Associate the current host with its matching hostX directory. The association will be done by -// matching host's mac addresses with those in mac_interface.ini. -// 2. Replace logical interface name in nmconnection files with the interface name as set on the host -// 3. Rename nmconnection files to start with the interface name (instead of the logical interface name) -// 4. Copy the nmconnection files to /NetworkManager/system-connections/ +// 1. Associate the current host with its matching hostX directory. The association will be done by +// matching host's mac addresses with those in mac_interface.ini. +// 2. Replace logical interface name in nmconnection files with the interface name as set on the host +// 3. Rename nmconnection files to start with the interface name (instead of the logical interface name) +// 4. Copy the nmconnection files to /NetworkManager/system-connections/ const PreNetworkConfigScript = `#!/bin/bash # The directory that contains nmconnection files of all nodes diff --git a/pkg/asset/installconfig/aws/session.go b/pkg/asset/installconfig/aws/session.go index 92a94a09da..c0be78ce09 100644 --- a/pkg/asset/installconfig/aws/session.go +++ b/pkg/asset/installconfig/aws/session.go @@ -153,8 +153,8 @@ func IsStaticCredentials(credsValue credentials.Value) bool { } // errCodeEquals returns true if the error matches all these conditions: -// * err is of type awserr.Error -// * Error.Code() equals code +// - err is of type awserr.Error +// - Error.Code() equals code func errCodeEquals(err error, code string) bool { var awsErr awserr.Error if errors.As(err, &awsErr) { diff --git a/pkg/asset/installconfig/azure/dns.go b/pkg/asset/installconfig/azure/dns.go index 73fcbbd7be..2982c6e6ce 100644 --- a/pkg/asset/installconfig/azure/dns.go +++ b/pkg/asset/installconfig/azure/dns.go @@ -11,27 +11,27 @@ import ( "github.com/pkg/errors" ) -//DNSConfig exposes functions to choose the DNS settings +// DNSConfig exposes functions to choose the DNS settings type DNSConfig struct { session *Session } -//ZonesGetter fetches the DNS zones available for the installer +// ZonesGetter fetches the DNS zones available for the installer type ZonesGetter interface { GetAllPublicZones() (map[string]string, error) } -//ZonesClient wraps the azure ZonesClient internal +// ZonesClient wraps the azure ZonesClient internal type ZonesClient struct { azureClient azdns.ZonesClient } -//RecordSetsClient wraps the azure RecordSetsClient internal +// RecordSetsClient wraps the azure RecordSetsClient internal type RecordSetsClient struct { azureClient azdns.RecordSetsClient } -//Zone represents an Azure DNS Zone +// Zone represents an Azure DNS Zone type Zone struct { ID string Name string @@ -41,8 +41,8 @@ func (z Zone) String() string { return z.Name } -//GetDNSZoneID returns the Azure DNS zone resourceID -//by interpolating the subscriptionID, the resource group and the zone name +// GetDNSZoneID returns the Azure DNS zone resourceID +// by interpolating the subscriptionID, the resource group and the zone name func (config DNSConfig) GetDNSZoneID(rgName string, zoneName string) string { return fmt.Sprintf( "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/dnszones/%s", @@ -51,8 +51,8 @@ func (config DNSConfig) GetDNSZoneID(rgName string, zoneName string) string { zoneName) } -//GetPrivateDNSZoneID returns the Azure Private DNS zone resourceID -//by interpolating the subscriptionID, the resource group and the zone name +// GetPrivateDNSZoneID returns the Azure Private DNS zone resourceID +// by interpolating the subscriptionID, the resource group and the zone name func (config DNSConfig) GetPrivateDNSZoneID(rgName string, zoneName string) string { return fmt.Sprintf( "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateDnsZones/%s", @@ -61,7 +61,7 @@ func (config DNSConfig) GetPrivateDNSZoneID(rgName string, zoneName string) stri zoneName) } -//GetDNSZone returns a DNS zone selected by survey +// GetDNSZone returns a DNS zone selected by survey func (config DNSConfig) GetDNSZone() (*Zone, error) { //call azure api using the session to retrieve available base domain zonesClient := newZonesClient(config.session) @@ -95,15 +95,15 @@ func (config DNSConfig) GetDNSZone() (*Zone, error) { } -//GetDNSRecordSet gets a record set for the zone identified by publicZoneID +// GetDNSRecordSet gets a record set for the zone identified by publicZoneID func (config DNSConfig) GetDNSRecordSet(rgName string, zoneName string, relativeRecordSetName string, recordType azdns.RecordType) (*azdns.RecordSet, error) { recordsetsClient := newRecordSetsClient(config.session) return recordsetsClient.GetRecordSet(rgName, zoneName, relativeRecordSetName, recordType) } -//NewDNSConfig returns a new DNSConfig struct that helps configuring the DNS -//by querying your subscription and letting you choose -//which domain you wish to use for the cluster +// NewDNSConfig returns a new DNSConfig struct that helps configuring the DNS +// by querying your subscription and letting you choose +// which domain you wish to use for the cluster func NewDNSConfig(ssn *Session) *DNSConfig { return &DNSConfig{session: ssn} } @@ -120,7 +120,7 @@ func newRecordSetsClient(session *Session) *RecordSetsClient { return &RecordSetsClient{azureClient: azureClient} } -//GetAllPublicZones get all public zones from the current subscription +// GetAllPublicZones get all public zones from the current subscription func (client *ZonesClient) GetAllPublicZones() (map[string]string, error) { ctx, cancel := context.WithTimeout(context.TODO(), 30*time.Second) defer cancel() @@ -139,7 +139,7 @@ func (client *ZonesClient) GetAllPublicZones() (map[string]string, error) { return allZones, nil } -//GetRecordSet gets an Azure DNS recordset by zone, name and recordset type +// GetRecordSet gets an Azure DNS recordset by zone, name and recordset type func (client *RecordSetsClient) GetRecordSet(rgName string, zoneName string, relativeRecordSetName string, recordType azdns.RecordType) (*azdns.RecordSet, error) { ctx, cancel := context.WithTimeout(context.TODO(), 30*time.Second) defer cancel() diff --git a/pkg/asset/installconfig/azure/session.go b/pkg/asset/installconfig/azure/session.go index 632cd9ad1a..f3632a5182 100644 --- a/pkg/asset/installconfig/azure/session.go +++ b/pkg/asset/installconfig/azure/session.go @@ -24,7 +24,7 @@ var ( onceLoggers = map[string]*sync.Once{} ) -//Session is an object representing session for subscription +// Session is an object representing session for subscription type Session struct { GraphAuthorizer autorest.Authorizer Authorizer autorest.Authorizer @@ -32,7 +32,7 @@ type Session struct { Environment azureenv.Environment } -//Credentials is the data type for credentials as understood by the azure sdk +// Credentials is the data type for credentials as understood by the azure sdk type Credentials struct { SubscriptionID string `json:"subscriptionId,omitempty"` ClientID string `json:"clientId,omitempty"` diff --git a/pkg/asset/installconfig/powervs/session.go b/pkg/asset/installconfig/powervs/session.go index 0c4f253408..7f37cda12c 100644 --- a/pkg/asset/installconfig/powervs/session.go +++ b/pkg/asset/installconfig/powervs/session.go @@ -35,7 +35,7 @@ var ( defaultAuthFilePath = filepath.Join(os.Getenv("HOME"), ".powervs", "config.json") ) -//BxClient is struct which provides bluemix session details +// BxClient is struct which provides bluemix session details type BxClient struct { *bxsession.Session APIKey string @@ -44,7 +44,7 @@ type BxClient struct { AccountAPIV2 accountv2.Accounts } -//User is struct with user details +// User is struct with user details type User struct { ID string Email string @@ -100,7 +100,7 @@ func fetchUserDetails(sess *bxsession.Session) (*User, error) { return &user, nil } -//NewBxClient func returns bluemix client +// NewBxClient func returns bluemix client func NewBxClient() (*BxClient, error) { c := &BxClient{} @@ -162,7 +162,7 @@ func NewBxClient() (*BxClient, error) { return c, nil } -//GetAccountType func return the type of account TRAIL/PAID +// GetAccountType func return the type of account TRAIL/PAID func (c *BxClient) GetAccountType() (string, error) { myAccount, err := c.AccountAPIV2.Get((*c.User).Account) if err != nil { @@ -172,7 +172,7 @@ func (c *BxClient) GetAccountType() (string, error) { return myAccount.Type, nil } -//ValidateAccountPermissions Checks permission for provisioning Power VS resources +// ValidateAccountPermissions Checks permission for provisioning Power VS resources func (c *BxClient) ValidateAccountPermissions() error { accType, err := c.GetAccountType() if err != nil { @@ -184,7 +184,7 @@ func (c *BxClient) ValidateAccountPermissions() error { return nil } -//ValidateDhcpService checks for existing Dhcp service for the provided PowerVS cloud instance +// ValidateDhcpService checks for existing Dhcp service for the provided PowerVS cloud instance func (c *BxClient) ValidateDhcpService(ctx context.Context, svcInsID string) error { ctx, cancel := context.WithTimeout(ctx, 2*time.Minute) defer cancel() @@ -202,7 +202,7 @@ func (c *BxClient) ValidateDhcpService(ctx context.Context, svcInsID string) err return nil } -//ValidateCloudConnectionInPowerVSRegion counts cloud connection in PowerVS Region +// ValidateCloudConnectionInPowerVSRegion counts cloud connection in PowerVS Region func (c *BxClient) ValidateCloudConnectionInPowerVSRegion(ctx context.Context, svcInsID string) error { ctx, cancel := context.WithTimeout(ctx, 2*time.Minute) defer cancel() diff --git a/pkg/asset/installconfig/vsphere/mock/vsphere_sim.go b/pkg/asset/installconfig/vsphere/mock/vsphere_sim.go index 6d5584cf3d..d461332e17 100644 --- a/pkg/asset/installconfig/vsphere/mock/vsphere_sim.go +++ b/pkg/asset/installconfig/vsphere/mock/vsphere_sim.go @@ -15,8 +15,9 @@ import ( "github.com/vmware/govmomi/vim25/soap" ) -// StartSimulator starts an instance of the simulator which listens on 127.0.0.1. Call GetClient -// to retrieve a vim25.client which will connect to and trust this simulator +// StartSimulator starts an instance of the simulator which listens on 127.0.0.1. +// Call GetClient to retrieve a vim25.client which will connect to and trust this +// simulator func StartSimulator() *simulator.Server { model := simulator.VPX() model.Folder = 1 diff --git a/pkg/asset/machines/nutanix/machinesets.go b/pkg/asset/machines/nutanix/machinesets.go index 6502fd0af6..a0c9dbd18d 100644 --- a/pkg/asset/machines/nutanix/machinesets.go +++ b/pkg/asset/machines/nutanix/machinesets.go @@ -1,4 +1,4 @@ -//Package nutanix generates Machine objects for nutanix.package nutanix +// Package nutanix generates Machine objects for nutanix.package nutanix package nutanix import ( diff --git a/pkg/asset/machines/vsphere/machinesets.go b/pkg/asset/machines/vsphere/machinesets.go index 6ae554b878..80d3c39de4 100644 --- a/pkg/asset/machines/vsphere/machinesets.go +++ b/pkg/asset/machines/vsphere/machinesets.go @@ -1,4 +1,4 @@ -//Package vsphere generates Machine objects for vsphere.package vsphere +// Package vsphere generates Machine objects for vsphere.package vsphere package vsphere import ( diff --git a/pkg/asset/manifests/azure/types.go b/pkg/asset/manifests/azure/types.go index c16ae0a36b..ba277cbf04 100644 --- a/pkg/asset/manifests/azure/types.go +++ b/pkg/asset/manifests/azure/types.go @@ -1,7 +1,7 @@ package azure -//authConfig is part of the CloudProviderConfig as defined in https://github.com/kubernetes/kubernetes/blob/v1.13.5/pkg/cloudprovider/providers/azure/auth/azure_auth.go#L32 -//resourceManagerEndpoint has been added based on https://github.com/kubernetes-sigs/cloud-provider-azure/blob/v1.0.3/pkg/auth/azure_auth.go +// authConfig is part of the CloudProviderConfig as defined in https://github.com/kubernetes/kubernetes/blob/v1.13.5/pkg/cloudprovider/providers/azure/auth/azure_auth.go#L32 +// resourceManagerEndpoint has been added based on https://github.com/kubernetes-sigs/cloud-provider-azure/blob/v1.0.3/pkg/auth/azure_auth.go type authConfig struct { // The cloud environment identifier. Takes values from https://github.com/Azure/go-autorest/blob/ec5f4903f77ed9927ac95b19ab8e44ada64c1356/autorest/azure/environments.go#L13 Cloud string `json:"cloud" yaml:"cloud"` @@ -28,7 +28,7 @@ type authConfig struct { ResourceManagerEndpoint string `json:"resourceManagerEndpoint,omitempty" yaml:"resourceManagerEndpoint,omitempty"` } -//config is the cloud provider config as defined in https://github.com/kubernetes/kubernetes/blob/v1.13.5/pkg/cloudprovider/providers/azure/azure.go#L81 +// config is the cloud provider config as defined in https://github.com/kubernetes/kubernetes/blob/v1.13.5/pkg/cloudprovider/providers/azure/azure.go#L81 type config struct { authConfig diff --git a/pkg/asset/tls/adminkubeconfig.go b/pkg/asset/tls/adminkubeconfig.go index 6aab611dc8..1cec5425cd 100644 --- a/pkg/asset/tls/adminkubeconfig.go +++ b/pkg/asset/tls/adminkubeconfig.go @@ -71,7 +71,7 @@ func (a *AdminKubeConfigCABundle) Name() string { return "Certificate (admin-kubeconfig-ca-bundle)" } -//AdminKubeConfigClientCertKey is the asset that generates the key/cert pair for admin client to apiserver. +// AdminKubeConfigClientCertKey is the asset that generates the key/cert pair for admin client to apiserver. type AdminKubeConfigClientCertKey struct { SignedCertKey } diff --git a/pkg/destroy/aws/aws.go b/pkg/destroy/aws/aws.go index 05ebce0e71..288a5c7543 100644 --- a/pkg/destroy/aws/aws.go +++ b/pkg/destroy/aws/aws.go @@ -258,8 +258,8 @@ func (o *ClusterUninstaller) RunWithContext(ctx context.Context) ([]string, erro } // findResourcesToDelete returns the resources that should be deleted. -// tagClients - clients of the tagging API to use to search for resources. -// deleted - the resources that have already been deleted. Any resources specified in this set will be ignored. +// tagClients - clients of the tagging API to use to search for resources. +// deleted - the resources that have already been deleted. Any resources specified in this set will be ignored. func (o *ClusterUninstaller) findResourcesToDelete( ctx context.Context, tagClients []*resourcegroupstaggingapi.ResourceGroupsTaggingAPI, @@ -313,8 +313,8 @@ func (o *ClusterUninstaller) findResourcesToDelete( } // findResourcesByTag returns the resources with tags that satisfy the filters. -// tagClients - clients of the tagging API to use to search for resources. -// deleted - the resources that have already been deleted. Any resources specified in this set will be ignored. +// tagClients - clients of the tagging API to use to search for resources. +// deleted - the resources that have already been deleted. Any resources specified in this set will be ignored. func (o *ClusterUninstaller) findResourcesByTag( ctx context.Context, tagClient *resourcegroupstaggingapi.ResourceGroupsTaggingAPI, @@ -353,7 +353,7 @@ func (o *ClusterUninstaller) findResourcesByTag( } // findUntaggableResources returns the resources for the cluster that cannot be tagged. -// deleted - the resources that have already been deleted. Any resources specified in this set will be ignored. +// deleted - the resources that have already been deleted. Any resources specified in this set will be ignored. func (o *ClusterUninstaller) findUntaggableResources(ctx context.Context, iamClient *iam.IAM, deleted sets.String) (sets.String, error) { resources := sets.NewString() o.Logger.Debug("search for IAM instance profiles") @@ -375,7 +375,7 @@ func (o *ClusterUninstaller) findUntaggableResources(ctx context.Context, iamCli } // deleteResources deletes the specified resources. -// resources - the resources to be deleted. +// resources - the resources to be deleted. // The first return is the ARNs of the resources that were successfully deleted func (o *ClusterUninstaller) deleteResources(ctx context.Context, awsSession *session.Session, resources []string, tracker *errorTracker) (sets.String, error) { deleted := sets.NewString() diff --git a/pkg/destroy/aws/ec2helpers.go b/pkg/destroy/aws/ec2helpers.go index 7916064fa6..83c73815c3 100644 --- a/pkg/destroy/aws/ec2helpers.go +++ b/pkg/destroy/aws/ec2helpers.go @@ -21,7 +21,7 @@ import ( // findEC2Instances returns the EC2 instances with tags that satisfy the filters. // returns two lists, first one is the list of all resources that are not terminated and are not in shutdown // stage and the second list is the list of resources that are not terminated. -// deleted - the resources that have already been deleted. Any resources specified in this set will be ignored. +// deleted - the resources that have already been deleted. Any resources specified in this set will be ignored. func findEC2Instances(ctx context.Context, ec2Client *ec2.EC2, deleted sets.String, filters []Filter, logger logrus.FieldLogger) ([]string, []string, error) { if ec2Client.Config.Region == nil { return nil, nil, errors.New("EC2 client does not have region configured") diff --git a/pkg/destroy/aws/iamhelpers.go b/pkg/destroy/aws/iamhelpers.go index 7e2183013f..3cb306e712 100644 --- a/pkg/destroy/aws/iamhelpers.go +++ b/pkg/destroy/aws/iamhelpers.go @@ -132,7 +132,7 @@ func (search *iamUserSearch) arns(ctx context.Context) ([]string, error) { } // findIAMRoles returns the IAM roles for the cluster. -// deleted - the resources that have already been deleted. Any resources specified in this set will be ignored. +// deleted - the resources that have already been deleted. Any resources specified in this set will be ignored. func findIAMRoles(ctx context.Context, search *iamRoleSearch, deleted sets.String, logger logrus.FieldLogger) (sets.String, error) { logger.Debug("search for IAM roles") resources, _, err := search.find(ctx) @@ -144,7 +144,7 @@ func findIAMRoles(ctx context.Context, search *iamRoleSearch, deleted sets.Strin } // findIAMUsers returns the IAM users for the cluster. -// deleted - the resources that have already been deleted. Any resources specified in this set will be ignored. +// deleted - the resources that have already been deleted. Any resources specified in this set will be ignored. func findIAMUsers(ctx context.Context, search *iamUserSearch, deleted sets.String, logger logrus.FieldLogger) (sets.String, error) { logger.Debug("search for IAM users") resources, err := search.arns(ctx) diff --git a/pkg/gather/service/analyze.go b/pkg/gather/service/analyze.go index 83e98dc278..fc1f00e2aa 100644 --- a/pkg/gather/service/analyze.go +++ b/pkg/gather/service/analyze.go @@ -17,7 +17,7 @@ import ( // For example, if the filename is "log-bundle-20210329190553/bootstrap/services/release-image.json", // then the name of the service is "release-image". // In case the log-bundle is from bootstrap-in-place installation the file name is: -//"log-bundle-20210329190553/log-bundle-bootstrap/bootstrap/services/release-image.json" +// "log-bundle-20210329190553/log-bundle-bootstrap/bootstrap/services/release-image.json" var serviceEntriesFilePathRegex = regexp.MustCompile(`^[^\/]+(?:\/log-bundle-bootstrap)?\/bootstrap\/services\/([^.]+)\.json$`) // AnalyzeGatherBundle will analyze the bootstrap gather bundle at the specified path. diff --git a/pkg/lineprinter/lineprinter.go b/pkg/lineprinter/lineprinter.go index 359a164c3c..c83cd12644 100644 --- a/pkg/lineprinter/lineprinter.go +++ b/pkg/lineprinter/lineprinter.go @@ -10,8 +10,8 @@ import ( // Print is a type that can hold fmt.Print and other implementations // which match that signature. For example, you can use: // -// trimmer := &lineprinter.Trimmer{WrappedPrint: logrus.StandardLogger().Debug} -// linePrinter := &linePrinter{Print: trimmer.Print} +// trimmer := &lineprinter.Trimmer{WrappedPrint: logrus.StandardLogger().Debug} +// linePrinter := &linePrinter{Print: trimmer.Print} // // to connect the line printer to logrus at the debug level. type Print func(args ...interface{}) @@ -24,12 +24,12 @@ type Print func(args ...interface{}) // One use-case is connecting a subprocess's standard streams to a // logger: // -// linePrinter := &linePrinter{ -// Print: &Trimmer{WrappedPrint: logrus.StandardLogger().Debug}.Print, -// } -// defer linePrinter.Close() -// cmd := exec.Command(...) -// cmd.Stdout = linePrinter +// linePrinter := &linePrinter{ +// Print: &Trimmer{WrappedPrint: logrus.StandardLogger().Debug}.Print, +// } +// defer linePrinter.Close() +// cmd := exec.Command(...) +// cmd.Stdout = linePrinter // // LinePrinter buffers the subcommand's byte stream and splits it into // lines for the logger. Sometimes we might have a partial line diff --git a/pkg/metrics/builder/builder_test.go b/pkg/metrics/builder/builder_test.go index 45b58f334f..858fdf4e29 100644 --- a/pkg/metrics/builder/builder_test.go +++ b/pkg/metrics/builder/builder_test.go @@ -32,7 +32,7 @@ func getCollectorDescription(collector prometheus.Collector) string { } } -//TestNewMetricBuilder tests the Metric Builder initializer. +// TestNewMetricBuilder tests the Metric Builder initializer. func TestMetricBuilder(t *testing.T) { cases := []struct { name string @@ -109,7 +109,7 @@ func TestMetricBuilder(t *testing.T) { } } -//TestMetricBuilderCollector tests the PromCollector function. +// TestMetricBuilderCollector tests the PromCollector function. func TestMetricBuilderCollector(t *testing.T) { cases := []struct { name string @@ -192,7 +192,7 @@ func TestMetricBuilderCollector(t *testing.T) { } } -//TestNewMetricBuilder tests the Metric Builder initializer. +// TestNewMetricBuilder tests the Metric Builder initializer. func TestNewMetricBuilder(t *testing.T) { opts := MetricOpts{ Labels: []string{"test1", "test2", "test3"}, diff --git a/pkg/quota/gcp/usage.go b/pkg/quota/gcp/usage.go index 8638bf19c5..531671bd8f 100644 --- a/pkg/quota/gcp/usage.go +++ b/pkg/quota/gcp/usage.go @@ -52,7 +52,7 @@ func loadUsage(ctx context.Context, client *monitoring.MetricClient, project str // Based on https://cloud.google.com/monitoring/api/ref_v3/rest/v3/TimeSeries and definition of the points API // "The data points of this time series. When listing time series, points are returned in reverse time order.", // The latestRecord returns the first element of the points as the usage value. In case the points list is empty it -/// returns 0 as the usage value. +// returns 0 as the usage value. func latestRecord(ts *monitoringpb.TimeSeries) (record, error) { service, ok := ts.GetResource().GetLabels()["service"] if !ok { diff --git a/pkg/terraform/stages/split.go b/pkg/terraform/stages/split.go index 0faedaef5a..b78649134f 100644 --- a/pkg/terraform/stages/split.go +++ b/pkg/terraform/stages/split.go @@ -20,10 +20,10 @@ type StageOption func(*SplitStage) // NewStage creates a new split stage. // The default behavior is the following. The behavior can be changed by providing StageOptions. -// - The resources of the stage will not be deleted as part of destroying the bootstrap. -// - The IP addresses for the bootstrap and control plane VMs will be output from the stage as bootstrap_ip and -// control_plane_ips, respectively. Only one stage for the platform should output a particular variable. This will -// likely be the same stage that creates the VM. +// - The resources of the stage will not be deleted as part of destroying the bootstrap. +// - The IP addresses for the bootstrap and control plane VMs will be output from the stage as bootstrap_ip and +// control_plane_ips, respectively. Only one stage for the platform should output a particular variable. This will +// likely be the same stage that creates the VM. func NewStage(platform, name string, providers []providers.Provider, opts ...StageOption) SplitStage { s := SplitStage{ platform: platform, diff --git a/pkg/tfvars/nutanix/nutanix.go b/pkg/tfvars/nutanix/nutanix.go index 8d9c1cb7e5..417fb124d4 100644 --- a/pkg/tfvars/nutanix/nutanix.go +++ b/pkg/tfvars/nutanix/nutanix.go @@ -38,7 +38,7 @@ type TFVarsSources struct { ControlPlaneConfigs []*machinev1.NutanixMachineProviderConfig } -//TFVars generate Nutanix-specific Terraform variables +// TFVars generate Nutanix-specific Terraform variables func TFVars(sources TFVarsSources) ([]byte, error) { bootstrapIgnitionImagePath, err := nutanixtypes.CreateBootstrapISO(sources.ClusterID, sources.BootstrapIgnitionData) if err != nil { diff --git a/pkg/types/azure/platform.go b/pkg/types/azure/platform.go index b32b10aa41..61377e8bff 100644 --- a/pkg/types/azure/platform.go +++ b/pkg/types/azure/platform.go @@ -115,7 +115,7 @@ func (e CloudEnvironment) Name() string { return string(e) } -//SetBaseDomain parses the baseDomainID and sets the related fields on azure.Platform +// SetBaseDomain parses the baseDomainID and sets the related fields on azure.Platform func (p *Platform) SetBaseDomain(baseDomainID string) error { parts := strings.Split(baseDomainID, "/") p.BaseDomainResourceGroupName = parts[4] diff --git a/pkg/types/openstack/validation/networkextensions/networkextensions.go b/pkg/types/openstack/validation/networkextensions/networkextensions.go index dd12f57eef..f0825868b1 100644 --- a/pkg/types/openstack/validation/networkextensions/networkextensions.go +++ b/pkg/types/openstack/validation/networkextensions/networkextensions.go @@ -35,17 +35,17 @@ func Get(networkClient *gophercloud.ServiceClient) ([]extensions.Extension, erro // the Installer requirements. // // Network resource tagging is a bit complex with OpenStack: -// - up until OpenStack Ocata / OSP 11, there were two extensions for -// tagging neutron resources, `tag` for network only and `tag-ext` -// for subnet, subnetpool, port, and router. -// - OpenStack Pike / OSP 12 introduced the `standard-attr-tag` -// extension for trunk, policy, security_group, and floatingip. -// - with OpenStack Rocky / OSP 14, everything went under the -// `standard-attr-tag` extension. +// - up until OpenStack Ocata / OSP 11, there were two extensions for +// tagging neutron resources, `tag` for network only and `tag-ext` +// for subnet, subnetpool, port, and router. +// - OpenStack Pike / OSP 12 introduced the `standard-attr-tag` +// extension for trunk, policy, security_group, and floatingip. +// - with OpenStack Rocky / OSP 14, everything went under the +// `standard-attr-tag` extension. // // We need to check that: -// 1. `standard-attr-tag` extension is enabled -// 2. `standard-attr-tag` covers all the necessary resources (from the +// 1. `standard-attr-tag` extension is enabled +// 2. `standard-attr-tag` covers all the necessary resources (from the // extension description) or that the `tag` and `tag-ext` // extensions are enabled as well func Validate(availableExtensions []extensions.Extension) error {