Skip to content

Commit

Permalink
Merge pull request #587 from lucastt/master
Browse files Browse the repository at this point in the history
Add goldenfile tests to ingress controller
  • Loading branch information
lucastt committed Apr 18, 2023
2 parents 488442f + b0e651b commit e80384e
Show file tree
Hide file tree
Showing 26 changed files with 1,660 additions and 819 deletions.
39 changes: 39 additions & 0 deletions aws/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,17 @@ func NewAdapter(clusterID, newControllerID, vpcID string, debug, disableInstrume
return
}

// UpdateManifest generates a manifest again based on cluster and VPC information.
// This method is useful when using custom AWS clients.
func (a *Adapter) UpdateManifest(clusterID, vpcID string) (*Adapter, error) {
m, err := buildManifest(a, clusterID, vpcID)
if err != nil {
return nil, err
}
a.manifest = m
return a, err
}

func (a *Adapter) NewACMCertificateProvider() certs.CertificatesProvider {
return newACMCertProvider(a.acm)
}
Expand Down Expand Up @@ -494,6 +505,34 @@ func (a *Adapter) WithInternalDomainsDenyResponseContenType(contentType string)
return a
}

// WithCustomEc2Client returns an Adapter that will use the provided
// EC2 client, instead of the EC2 client provided by AWS.
func (a *Adapter) WithCustomEc2Client(c ec2iface.EC2API) *Adapter {
a.ec2 = c
return a
}

// WithCustomAutoScalingClient returns an Adapter that will use the provided
// Auto scaling client, instead of the Auto scaling client provided by AWS.
func (a *Adapter) WithCustomAutoScalingClient(c autoscalingiface.AutoScalingAPI) *Adapter {
a.autoscaling = c
return a
}

// WithCustomElbv2Client returns an Adapter that will use the provided
// ELBv2 client, instead of the ELBv2 client provided by AWS.
func (a *Adapter) WithCustomElbv2Client(c elbv2iface.ELBV2API) *Adapter {
a.elbv2 = c
return a
}

// WithCustomCloudFormationClient returns an Adapter that will use the provided
// CloudFormation client, instead of the CloudFormation client provided by AWS.
func (a *Adapter) WithCustomCloudFormationClient(c cloudformationiface.CloudFormationAPI) *Adapter {
a.cloudformation = c
return a
}

// ClusterID returns the ClusterID tag that all resources from the same Kubernetes cluster share.
// It's taken from the current ec2 instance.
func (a *Adapter) ClusterID() string {
Expand Down
244 changes: 123 additions & 121 deletions aws/adapter_test.go

Large diffs are not rendered by default.

0 comments on commit e80384e

Please sign in to comment.