Skip to content

Migrate to OCI SDK #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 19, 2018
Merged

Migrate to OCI SDK #148

merged 4 commits into from
Mar 19, 2018

Conversation

prydie
Copy link
Contributor

@prydie prydie commented Mar 16, 2018

Migrates the project to use the official OCI Go SDK.

CHANGELOG

Create load balancers using a single OCI API request sugnificantly reducing fresh load balancer creation time [#148]

Test status

Ran 9 of 9 Specs in 423.755 seconds
SUCCESS! -- 9 Passed | 0 Failed | 0 Pending | 0 Skipped PASS

Ginkgo ran 1 suite in 8m31.054686532s
Test Suite Passed

Closes: #136

@owainlewis owainlewis requested a review from simonlord March 19, 2018 11:43
@prydie prydie changed the title [WIP] Migrate to OCI SDK Migrate to OCI SDK Mar 19, 2018
@@ -25,16 +25,16 @@ import (
"github.com/golang/glog"

utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/informers"
wait "k8s.io/apimachinery/pkg/util/wait"
Copy link
Member

Choose a reason for hiding this comment

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

the package is already called wait so the first part is redundant.

// GetInstance gets information about the specified instance.
GetInstance(ctx context.Context, id string) (*core.Instance, error)
// GetInstanceByDisplayName gets information about the named instance.
GetInstanceByDisplayName(ctx context.Context, displayName string) (*core.Instance, error)
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason to ever use this over GetInstanceByNodeName?

func IsInstanceInTerminalState(instance *core.Instance) bool {
return instance.LifecycleState == core.InstanceLifecycleStateTerminated ||
instance.LifecycleState == core.InstanceLifecycleStateTerminating ||
instance.LifecycleState == "UNKNOWN"
Copy link
Member

Choose a reason for hiding this comment

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

The client removed this enum I think so i don't think we need it anymore.

}

func (c *client) CreateCertificate(ctx context.Context, lbID, certificate, key string) (string, error) {
// TODO(apryde): We currently don't have a mechanism for supplying
Copy link
Member

Choose a reason for hiding this comment

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

Is there a ticket tracking this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wr = twr
return true, nil
case loadbalancer.WorkRequestLifecycleStateFailed:
return false, fmt.Errorf("WorkRequest %q failed: %s", id, twr.Message)
Copy link
Member

Choose a reason for hiding this comment

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

errors.WithStack?

if err != nil {
return nil, err
return []api.NodeAddress{}, errors.Wrap(err, "GetInstanceByNodeName")
Copy link
Member

Choose a reason for hiding this comment

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

any reason you aren't returning nil anymore?

}
}
certs[s.SSLConfig.Name] = loadbalancer.CertificateDetails{
CertificateName: common.String(s.SSLConfig.Name),
Copy link
Member

Choose a reason for hiding this comment

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

nit: you don't need to use these common methods. Just use &

@prydie prydie merged commit f33da88 into master Mar 19, 2018
@prydie prydie deleted the ap/oci-sdk branch March 19, 2018 15:44
@prydie prydie added this to the 0.3.0 milestone Mar 20, 2018
l-technicore pushed a commit to l-technicore/oci-cloud-controller-manager that referenced this pull request Jun 14, 2022
…m task/OKE-14472 to internal

* commit '70a07d7273ef81d60464bd8bb18922e39b65a091':
  removed TCP health check for SSL enabled traffic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants