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: 2 additions & 2 deletions azure/services/availabilitysets/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
// CreateOrUpdateAsync creates or updates an availability set asynchronously.
// It sends a PUT request to Azure and if accepted without error, the func will return a Poller which can be used to track the ongoing
// progress of the operation.
func (ac *AzureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, _resumeToken string, parameters interface{}) (result interface{}, poller *runtime.Poller[armcompute.AvailabilitySetsClientCreateOrUpdateResponse], err error) { //nolint:revive // keeping _resumeToken for understanding purposes
func (ac *AzureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, _ string, parameters interface{}) (result interface{}, poller *runtime.Poller[armcompute.AvailabilitySetsClientCreateOrUpdateResponse], err error) { // ignore the resumeToken (3rd arg) as availability sets do not support polling in the same way as other resources

Check warning on line 63 in azure/services/availabilitysets/client.go

View check run for this annotation

Codecov / codecov/patch

azure/services/availabilitysets/client.go#L63

Added line #L63 was not covered by tests
ctx, _, done := tele.StartSpanWithLogger(ctx, "availabilitySets.AzureClient.CreateOrUpdateAsync")
defer done()

Expand All @@ -82,7 +82,7 @@
// DeleteAsync deletes a availability set asynchronously. DeleteAsync sends a DELETE
// request to Azure and if accepted without error, the func will return a Poller which can be used to track the ongoing
// progress of the operation.
func (ac *AzureClient) DeleteAsync(ctx context.Context, spec azure.ResourceSpecGetter, _resumeToken string) (poller *runtime.Poller[armcompute.AvailabilitySetsClientDeleteResponse], err error) { //nolint:revive // keeping _resumeToken for understanding purposes
func (ac *AzureClient) DeleteAsync(ctx context.Context, spec azure.ResourceSpecGetter, _ string) (poller *runtime.Poller[armcompute.AvailabilitySetsClientDeleteResponse], err error) { // ignore the resumeToken (3rd arg) as availability sets do not support polling in the same way as other resources

Check warning on line 85 in azure/services/availabilitysets/client.go

View check run for this annotation

Codecov / codecov/patch

azure/services/availabilitysets/client.go#L85

Added line #L85 was not covered by tests
ctx, _, done := tele.StartSpanWithLogger(ctx, "availabilitysets.AzureClient.DeleteAsync")
defer done()

Expand Down
14 changes: 7 additions & 7 deletions azure/services/networkinterfaces/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
"sigs.k8s.io/cluster-api-provider-azure/util/tele"
)

// azureClient contains the Azure go-sdk Client.
type azureClient struct {
// AzureClient contains the Azure go-sdk Client.
type AzureClient struct {
interfaces *armnetwork.InterfacesClient
apiCallTimeout time.Duration
}

// NewClient creates a new network interfaces client from an authorizer.
func NewClient(auth azure.Authorizer, apiCallTimeout time.Duration) (*azureClient, error) { //nolint:revive // leave it as is
func NewClient(auth azure.Authorizer, apiCallTimeout time.Duration) (*AzureClient, error) {

Check warning on line 39 in azure/services/networkinterfaces/client.go

View check run for this annotation

Codecov / codecov/patch

azure/services/networkinterfaces/client.go#L39

Added line #L39 was not covered by tests
opts, err := azure.ARMClientOptions(auth.CloudEnvironment())
if err != nil {
return nil, errors.Wrap(err, "failed to create networkinterfaces client options")
Expand All @@ -45,11 +45,11 @@
if err != nil {
return nil, errors.Wrap(err, "failed to create armnetwork client factory")
}
return &azureClient{factory.NewInterfacesClient(), apiCallTimeout}, nil
return &AzureClient{factory.NewInterfacesClient(), apiCallTimeout}, nil

Check warning on line 48 in azure/services/networkinterfaces/client.go

View check run for this annotation

Codecov / codecov/patch

azure/services/networkinterfaces/client.go#L48

Added line #L48 was not covered by tests
}

// Get gets the specified network interface.
func (ac *azureClient) Get(ctx context.Context, spec azure.ResourceSpecGetter) (result interface{}, err error) {
func (ac *AzureClient) Get(ctx context.Context, spec azure.ResourceSpecGetter) (result interface{}, err error) {

Check warning on line 52 in azure/services/networkinterfaces/client.go

View check run for this annotation

Codecov / codecov/patch

azure/services/networkinterfaces/client.go#L52

Added line #L52 was not covered by tests
ctx, _, done := tele.StartSpanWithLogger(ctx, "networkinterfaces.AzureClient.Get")
defer done()

Expand All @@ -63,7 +63,7 @@
// CreateOrUpdateAsync creates or updates a network interface asynchronously.
// It sends a PUT request to Azure and if accepted without error, the func will return a poller which can be used to track the ongoing
// progress of the operation.
func (ac *azureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string, parameters interface{}) (result interface{}, poller *runtime.Poller[armnetwork.InterfacesClientCreateOrUpdateResponse], err error) {
func (ac *AzureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string, parameters interface{}) (result interface{}, poller *runtime.Poller[armnetwork.InterfacesClientCreateOrUpdateResponse], err error) {

Check warning on line 66 in azure/services/networkinterfaces/client.go

View check run for this annotation

Codecov / codecov/patch

azure/services/networkinterfaces/client.go#L66

Added line #L66 was not covered by tests
ctx, _, done := tele.StartSpanWithLogger(ctx, "networkinterfaces.AzureClient.CreateOrUpdateAsync")
defer done()

Expand Down Expand Up @@ -96,7 +96,7 @@
// DeleteAsync deletes a network interface asynchronously. DeleteAsync sends a DELETE
// request to Azure and if accepted without error, the func will return a poller which can be used to track the ongoing
// progress of the operation.
func (ac *azureClient) DeleteAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string) (poller *runtime.Poller[armnetwork.InterfacesClientDeleteResponse], err error) {
func (ac *AzureClient) DeleteAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string) (poller *runtime.Poller[armnetwork.InterfacesClientDeleteResponse], err error) {

Check warning on line 99 in azure/services/networkinterfaces/client.go

View check run for this annotation

Codecov / codecov/patch

azure/services/networkinterfaces/client.go#L99

Added line #L99 was not covered by tests
ctx, _, done := tele.StartSpanWithLogger(ctx, "networkinterfaces.AzureClient.DeleteAsync")
defer done()

Expand Down
2 changes: 1 addition & 1 deletion azure/services/roleassignments/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

// CreateOrUpdateAsync creates a roleassignment.
// Creating a roleassignment is not a long running operation, so we don't ever return a poller.
func (ac *azureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string, parameters interface{}) (result interface{}, poller *runtime.Poller[armauthorization.RoleAssignmentsClientCreateResponse], err error) { //nolint:revive // keeping resumeToken for readability
func (ac *azureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, _ string, parameters interface{}) (result interface{}, poller *runtime.Poller[armauthorization.RoleAssignmentsClientCreateResponse], err error) { // ignore resumeToken (3rd arg) since this is not a long-running operation

Check warning on line 62 in azure/services/roleassignments/client.go

View check run for this annotation

Codecov / codecov/patch

azure/services/roleassignments/client.go#L62

Added line #L62 was not covered by tests
ctx, _, done := tele.StartSpanWithLogger(ctx, "roleassignments.azureClient.CreateOrUpdateAsync")
defer done()

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ const (
// EnsureCNI installs the CNI plugin depending on the input.CNIManifestPath
func EnsureCNI(ctx context.Context, input clusterctl.ApplyCustomClusterTemplateAndWaitInput, installHelmChart bool, cidrBlocks []string, hasWindows bool) {
if input.CNIManifestPath != "" {
InstallCNIManifest(ctx, input, cidrBlocks, hasWindows)
InstallCNIManifest(ctx, input)
} else {
EnsureCalicoIsReady(ctx, input, installHelmChart, cidrBlocks, hasWindows)
}
}

// InstallCNIManifest installs the CNI manifest provided by the user
func InstallCNIManifest(ctx context.Context, input clusterctl.ApplyCustomClusterTemplateAndWaitInput, cidrBlocks []string, hasWindows bool) { //nolint:revive // leaving unused cidrBlocks and hasWindows for understanding
func InstallCNIManifest(ctx context.Context, input clusterctl.ApplyCustomClusterTemplateAndWaitInput) {
By("Installing a CNI plugin to the workload cluster")
workloadCluster := input.ClusterProxy.GetWorkloadCluster(ctx, input.Namespace, input.ClusterName)

Expand Down