Skip to content

Commit 53c5ef9

Browse files
authored
Merge pull request #392 from l-technicore/oke-oss-release-v1.22.0
OKE sync with open source
2 parents ede5100 + 0b5190a commit 53c5ef9

File tree

101 files changed

+14037
-48
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+14037
-48
lines changed

docs/load-balancer-annotations.md

+34-30
Large diffs are not rendered by default.

go.sum

+3
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
9898
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
9999
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
100100
github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115/go.mod h1:zVt7zX3K/aDCk9Tj+VM7YymsX66ERvzCJzw8rFCX2JU=
101+
github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA=
101102
github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
102103
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
103104
github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
@@ -635,6 +636,7 @@ github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.m
635636
github.com/opencontainers/selinux v1.5.1/go.mod h1:yTcKuYAh6R95iDpefGLQaPaRwJFwyzAJufJyiTt7s0g=
636637
github.com/opencontainers/selinux v1.5.2/go.mod h1:yTcKuYAh6R95iDpefGLQaPaRwJFwyzAJufJyiTt7s0g=
637638
github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo=
639+
github.com/opencontainers/selinux v1.8.2 h1:c4ca10UMgRcvZ6h0K4HtS15UaVSBEaE+iln2LVpAuGc=
638640
github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8=
639641
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
640642
github.com/oracle/oci-go-sdk/v31 v31.0.0 h1:LEstCAlSNcuuPIRUMLuX3UF+V3ID2B1LN4k9Dvbd5tM=
@@ -1322,6 +1324,7 @@ k8s.io/legacy-cloud-providers v0.19.12/go.mod h1:8ZhENHyKoTmK3ZfgXYWRc36HlFdIKKq
13221324
k8s.io/legacy-cloud-providers v0.22.5/go.mod h1:a+nO87Q1eJjGpBcfmv1llCMufHF6sRpKSoXFMp1tj+s=
13231325
k8s.io/metrics v0.19.12/go.mod h1:l7v54/zYNUiDNjgCbEG3kF0r85DdLxbQNtYLuhgyO8s=
13241326
k8s.io/metrics v0.22.5/go.mod h1:dCqOkoZQWLSfBhUtPFMiDrzJaPtXJlVePVuJbEx0hW8=
1327+
k8s.io/mount-utils v0.22.5 h1:Tj1mcA/azQaWlIXGL9g5+505ig/+r4AYfPMtwaaNSis=
13251328
k8s.io/mount-utils v0.22.5/go.mod h1:dHl6c2P60T5LHUnZxVslyly9EDCMzvhtISO5aY+Z4sk=
13261329
k8s.io/pod-security-admission v0.22.5/go.mod h1:2a1JSU7b+CHFoSGIr8FwZBBeAJFau41srx08/qEy+NI=
13271330
k8s.io/sample-apiserver v0.19.12/go.mod h1:+bwpXMUrAFSGjLjpxfqNkrNn4mQrJH0czEavWrVcEJc=

hack/run_e2e_test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ check-env "CLUSTER_KUBECONFIG" $CLUSTER_KUBECONFIG
2525
check-env "CLOUD_CONFIG" $CLOUD_CONFIG
2626
check-env "ADLOCATION" $ADLOCATION
2727
check-env "NSG_OCIDS" $NSG_OCIDS
28-
check-env "VOLUME_HANDLE" $VOLUME_HANDLE
28+
check-env "FSS_VOLUME_HANDLE" $FSS_VOLUME_HANDLE
2929

3030
function set_image_pull_repo_and_delete_namespace_flag () {
3131
if [ -z "$IMAGE_PULL_REPO" ]; then

pkg/cloudprovider/providers/oci/load_balancer.go

+6
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ const (
6767
lbConnectionIdleTimeoutTCP = 300
6868
lbConnectionIdleTimeoutHTTP = 60
6969
flexible = "flexible"
70+
lbLifecycleStateActive = "ACTIVE"
7071
lbMaximumNetworkSecurityGroupIds = 5
7172
excludeBackendFromLBLabel = "node.kubernetes.io/exclude-from-external-load-balancers"
7273
)
@@ -492,6 +493,11 @@ func (cp *CloudProvider) EnsureLoadBalancer(ctx context.Context, clusterName str
492493
return lbStatus, err
493494
}
494495

496+
if lb.LifecycleState == nil || *lb.LifecycleState != lbLifecycleStateActive {
497+
logger.With("lifecycleState", lb.LifecycleState).Infof("LB is not in %s state, will retry EnsureLoadBalancer", lbLifecycleStateActive)
498+
return nil, errors.Errorf("rejecting request to update LB which is not in %s state", lbLifecycleStateActive)
499+
}
500+
495501
// Existing load balancers cannot change subnets. This ensures that the spec matches
496502
// what the actual load balancer has listed as the subnet ids. If the load balancer
497503
// was just created then these values would be equal; however, if the load balancer

pkg/cloudprovider/providers/oci/load_balancer_spec.go

+20-2
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,23 @@ const (
178178
// specifying the security list management mode ("All", "Frontend", "None") that configures how security lists are managed by the CCM
179179
ServiceAnnotationNetworkLoadBalancerSecurityListManagementMode = "oci-network-load-balancer.oraclecloud.com/security-list-management-mode"
180180

181+
// ServiceAnnotationNetworkLoadBalancerDefinedTags is a service annotation for specifying
182+
// defined tags on the nlb
183+
// DEPRECATED
184+
ServiceAnnotationNetworkLoadBalancerDefinedTags = "oci-network-load-balancer.oraclecloud.com/defined-tags"
185+
186+
// ServiceAnnotationNetworkLoadBalancerFreeformTags is a service annotation for specifying
187+
// freeform tags on the nlb
188+
// DEPRECATED
189+
ServiceAnnotationNetworkLoadBalancerFreeformTags = "oci-network-load-balancer.oraclecloud.com/freeform-tags"
190+
181191
// ServiceAnnotationNetworkLoadBalancerInitialDefinedTagsOverride is a service annotation for specifying
182192
// defined tags on the nlb
183-
ServiceAnnotationNetworkLoadBalancerInitialDefinedTagsOverride = "oci-network-load-balancer.oraclecloud.com/defined-tags"
193+
ServiceAnnotationNetworkLoadBalancerInitialDefinedTagsOverride = "oci-network-load-balancer.oraclecloud.com/initial-defined-tags-override"
184194

185195
// ServiceAnnotationNetworkLoadBalancerInitialFreeformTagsOverride is a service annotation for specifying
186196
// freeform tags on the nlb
187-
ServiceAnnotationNetworkLoadBalancerInitialFreeformTagsOverride = "oci-network-load-balancer.oraclecloud.com/freeform-tags"
197+
ServiceAnnotationNetworkLoadBalancerInitialFreeformTagsOverride = "oci-network-load-balancer.oraclecloud.com/initial-freeform-tags-override"
188198

189199
// ServiceAnnotationNetworkLoadBalancerNodeFilter is a service annotation to select specific nodes as your backend in the NLB
190200
// based on label selector.
@@ -1041,6 +1051,14 @@ func getLoadBalancerTags(svc *v1.Service, initialTags *config.InitialTags) (*con
10411051
{
10421052
freeformTagsAnnotation, freeformTagsAnnotationExists = svc.Annotations[ServiceAnnotationNetworkLoadBalancerInitialFreeformTagsOverride]
10431053
definedTagsAnnotation, definedTagsAnnotationExists = svc.Annotations[ServiceAnnotationNetworkLoadBalancerInitialDefinedTagsOverride]
1054+
1055+
if !freeformTagsAnnotationExists {
1056+
freeformTagsAnnotation, freeformTagsAnnotationExists = svc.Annotations[ServiceAnnotationNetworkLoadBalancerFreeformTags]
1057+
}
1058+
1059+
if !definedTagsAnnotationExists {
1060+
definedTagsAnnotation, definedTagsAnnotationExists = svc.Annotations[ServiceAnnotationNetworkLoadBalancerDefinedTags]
1061+
}
10441062
}
10451063
default:
10461064
{

pkg/cloudprovider/providers/oci/load_balancer_spec_test.go

+80-12
Original file line numberDiff line numberDiff line change
@@ -3489,6 +3489,74 @@ func Test_getLoadBalancerTags(t *testing.T) {
34893489
},
34903490
err: nil,
34913491
},
3492+
"reverse compatibility tags test for nlb 1": {
3493+
service: &v1.Service{
3494+
ObjectMeta: metav1.ObjectMeta{
3495+
Annotations: map[string]string{
3496+
ServiceAnnotationLoadBalancerType: "nlb",
3497+
ServiceAnnotationNetworkLoadBalancerFreeformTags: `{"cluster":"resource1", "unique":"tag1"}`,
3498+
ServiceAnnotationNetworkLoadBalancerDefinedTags: `{"namespace":{"key":"value1", "owner":"team1"}}`,
3499+
ServiceAnnotationNetworkLoadBalancerInitialFreeformTagsOverride: `{"cluster":"resource", "unique":"tag"}`,
3500+
ServiceAnnotationNetworkLoadBalancerInitialDefinedTagsOverride: `{"namespace":{"key":"value", "owner":"team"}}`,
3501+
},
3502+
},
3503+
},
3504+
desiredLBTags: &providercfg.TagConfig{
3505+
FreeformTags: map[string]string{"cluster": "resource", "unique": "tag"},
3506+
DefinedTags: map[string]map[string]interface{}{"namespace": {"owner": "team", "key": "value"}},
3507+
},
3508+
err: nil,
3509+
},
3510+
"reverse compatibility tags test for nlb 2": {
3511+
service: &v1.Service{
3512+
ObjectMeta: metav1.ObjectMeta{
3513+
Annotations: map[string]string{
3514+
ServiceAnnotationLoadBalancerType: "nlb",
3515+
ServiceAnnotationNetworkLoadBalancerFreeformTags: `{"cluster":"resource1", "unique":"tag1"}`,
3516+
ServiceAnnotationNetworkLoadBalancerDefinedTags: `{"namespace":{"key":"value1", "owner":"team1"}}`,
3517+
},
3518+
},
3519+
},
3520+
desiredLBTags: &providercfg.TagConfig{
3521+
FreeformTags: map[string]string{"cluster": "resource1", "unique": "tag1"},
3522+
DefinedTags: map[string]map[string]interface{}{"namespace": {"owner": "team1", "key": "value1"}},
3523+
},
3524+
err: nil,
3525+
},
3526+
"reverse compatibility tags test for nlb 3": {
3527+
service: &v1.Service{
3528+
ObjectMeta: metav1.ObjectMeta{
3529+
Annotations: map[string]string{
3530+
ServiceAnnotationLoadBalancerType: "nlb",
3531+
ServiceAnnotationNetworkLoadBalancerFreeformTags: `{"cluster":"resource1", "unique":"tag1"}`,
3532+
ServiceAnnotationNetworkLoadBalancerDefinedTags: `{"namespace":{"key":"value1", "owner":"team1"}}`,
3533+
ServiceAnnotationNetworkLoadBalancerInitialDefinedTagsOverride: `{"namespace":{"key":"value", "owner":"team"}}`,
3534+
},
3535+
},
3536+
},
3537+
desiredLBTags: &providercfg.TagConfig{
3538+
FreeformTags: map[string]string{"cluster": "resource1", "unique": "tag1"},
3539+
DefinedTags: map[string]map[string]interface{}{"namespace": {"owner": "team", "key": "value"}},
3540+
},
3541+
err: nil,
3542+
},
3543+
"reverse compatibility tags test for nlb 4": {
3544+
service: &v1.Service{
3545+
ObjectMeta: metav1.ObjectMeta{
3546+
Annotations: map[string]string{
3547+
ServiceAnnotationLoadBalancerType: "nlb",
3548+
ServiceAnnotationNetworkLoadBalancerFreeformTags: `{"cluster":"resource1", "unique":"tag1"}`,
3549+
ServiceAnnotationNetworkLoadBalancerDefinedTags: `{"namespace":{"key":"value1", "owner":"team1"}}`,
3550+
ServiceAnnotationNetworkLoadBalancerInitialFreeformTagsOverride: `{"cluster":"resource", "unique":"tag"}`,
3551+
},
3552+
},
3553+
},
3554+
desiredLBTags: &providercfg.TagConfig{
3555+
FreeformTags: map[string]string{"cluster": "resource", "unique": "tag"},
3556+
DefinedTags: map[string]map[string]interface{}{"namespace": {"owner": "team1", "key": "value1"}},
3557+
},
3558+
err: nil,
3559+
},
34923560
}
34933561

34943562
for name, tc := range testCases {
@@ -3599,7 +3667,7 @@ func Test_getHealthChecker(t *testing.T) {
35993667
},
36003668
},
36013669
expected: nil,
3602-
err: fmt.Errorf("invalid value for health check interval, should be between %v and %v", LBHealthCheckIntervalMin, LBHealthCheckIntervalMax),
3670+
err: fmt.Errorf("invalid value for health check interval, should be between %v and %v", LBHealthCheckIntervalMin, LBHealthCheckIntervalMax),
36033671
},
36043672
"lb wrong interval value - greater than max": {
36053673
service: &v1.Service{
@@ -3610,31 +3678,31 @@ func Test_getHealthChecker(t *testing.T) {
36103678
},
36113679
},
36123680
expected: nil,
3613-
err: fmt.Errorf("invalid value for health check interval, should be between %v and %v", LBHealthCheckIntervalMin, LBHealthCheckIntervalMax),
3681+
err: fmt.Errorf("invalid value for health check interval, should be between %v and %v", LBHealthCheckIntervalMin, LBHealthCheckIntervalMax),
36143682
},
36153683
"nlb wrong interval value - lesser than min": {
36163684
service: &v1.Service{
36173685
ObjectMeta: metav1.ObjectMeta{
36183686
Annotations: map[string]string{
3619-
ServiceAnnotationLoadBalancerType: "nlb",
3687+
ServiceAnnotationLoadBalancerType: "nlb",
36203688
ServiceAnnotationNetworkLoadBalancerHealthCheckInterval: "3000",
36213689
},
36223690
},
36233691
},
36243692
expected: nil,
3625-
err: fmt.Errorf("invalid value for health check interval, should be between %v and %v", NLBHealthCheckIntervalMin, NLBHealthCheckIntervalMax),
3693+
err: fmt.Errorf("invalid value for health check interval, should be between %v and %v", NLBHealthCheckIntervalMin, NLBHealthCheckIntervalMax),
36263694
},
36273695
"nlb wrong interval value - greater than max": {
36283696
service: &v1.Service{
36293697
ObjectMeta: metav1.ObjectMeta{
36303698
Annotations: map[string]string{
3631-
ServiceAnnotationLoadBalancerType: "nlb",
3699+
ServiceAnnotationLoadBalancerType: "nlb",
36323700
ServiceAnnotationNetworkLoadBalancerHealthCheckInterval: "3000000",
36333701
},
36343702
},
36353703
},
36363704
expected: nil,
3637-
err: fmt.Errorf("invalid value for health check interval, should be between %v and %v", NLBHealthCheckIntervalMin, NLBHealthCheckIntervalMax),
3705+
err: fmt.Errorf("invalid value for health check interval, should be between %v and %v", NLBHealthCheckIntervalMin, NLBHealthCheckIntervalMax),
36383706
},
36393707
}
36403708

@@ -3825,10 +3893,10 @@ func Test_getSecurityListManagementMode(t *testing.T) {
38253893
}
38263894
}
38273895

3828-
func Test_validateService(t *testing.T){
3896+
func Test_validateService(t *testing.T) {
38293897
testCases := map[string]struct {
3830-
service *v1.Service
3831-
err error
3898+
service *v1.Service
3899+
err error
38323900
}{
38333901
"defaults": {
38343902
service: &v1.Service{
@@ -3848,7 +3916,7 @@ func Test_validateService(t *testing.T){
38483916
},
38493917
ObjectMeta: metav1.ObjectMeta{
38503918
Annotations: map[string]string{
3851-
ServiceAnnotationLoadBalancerType: "nlb",
3919+
ServiceAnnotationLoadBalancerType: "nlb",
38523920
ServiceAnnotationNetworkLoadBalancerSecurityListManagementMode: "Neither",
38533921
},
38543922
},
@@ -3885,7 +3953,7 @@ func Test_validateService(t *testing.T){
38853953
},
38863954
ObjectMeta: metav1.ObjectMeta{
38873955
Annotations: map[string]string{
3888-
ServiceAnnotationLoadBalancerType: "nlb",
3956+
ServiceAnnotationLoadBalancerType: "nlb",
38893957
ServiceAnnotationNetworkLoadBalancerSecurityListManagementMode: "All",
38903958
},
38913959
},
@@ -3905,7 +3973,7 @@ func Test_validateService(t *testing.T){
39053973
},
39063974
ObjectMeta: metav1.ObjectMeta{
39073975
Annotations: map[string]string{
3908-
ServiceAnnotationLoadBalancerType: "nlb",
3976+
ServiceAnnotationLoadBalancerType: "nlb",
39093977
ServiceAnnotationNetworkLoadBalancerSecurityListManagementMode: "None",
39103978
},
39113979
},

pkg/csi/driver/bv_node.go

+50-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212
"google.golang.org/grpc/codes"
1313
"google.golang.org/grpc/status"
1414
kubeAPI "k8s.io/api/core/v1"
15+
"k8s.io/kubernetes/pkg/volume"
16+
"k8s.io/kubernetes/pkg/volume/util/hostutil"
1517

1618
"github.com/oracle/oci-cloud-controller-manager/pkg/csi-util"
1719
"github.com/oracle/oci-cloud-controller-manager/pkg/oci/client"
@@ -436,7 +438,7 @@ func getDevicePathAndAttachmentType(logger *zap.SugaredLogger, path []string) (s
436438
// NodeGetCapabilities returns the supported capabilities of the node server
437439
func (d BlockVolumeNodeDriver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error) {
438440
var nscaps []*csi.NodeServiceCapability
439-
nodeCaps := []csi.NodeServiceCapability_RPC_Type{csi.NodeServiceCapability_RPC_STAGE_UNSTAGE_VOLUME, csi.NodeServiceCapability_RPC_EXPAND_VOLUME}
441+
nodeCaps := []csi.NodeServiceCapability_RPC_Type{csi.NodeServiceCapability_RPC_STAGE_UNSTAGE_VOLUME, csi.NodeServiceCapability_RPC_GET_VOLUME_STATS, csi.NodeServiceCapability_RPC_EXPAND_VOLUME}
440442
for _, nodeCap := range nodeCaps {
441443
c := &csi.NodeServiceCapability{
442444
Type: &csi.NodeServiceCapability_Rpc{
@@ -478,7 +480,53 @@ func (d BlockVolumeNodeDriver) NodeGetInfo(ctx context.Context, req *csi.NodeGet
478480

479481
// NodeGetVolumeStats return the stats of the volume
480482
func (d BlockVolumeNodeDriver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) {
481-
return nil, status.Error(codes.Unimplemented, "NodeGetVolumeStats is not supported yet")
483+
logger := d.logger.With("volumeID", req.VolumeId, "volumePath", req.VolumePath)
484+
485+
volumeID := req.GetVolumeId()
486+
if len(volumeID) == 0 {
487+
logger.Errorf("Volume ID not provided")
488+
return nil, status.Error(codes.InvalidArgument, "Volume ID not provided")
489+
}
490+
volumePath := req.GetVolumePath()
491+
if len(volumePath) == 0 {
492+
logger.Errorf("Volume path not provided")
493+
return nil, status.Error(codes.InvalidArgument, "volume path must be provided")
494+
}
495+
496+
hostUtil := hostutil.NewHostUtil()
497+
exists, err := hostUtil.PathExists(volumePath)
498+
if err != nil {
499+
logger.With(zap.Error(err)).Errorf("Failed to find if path exists %s", volumePath)
500+
return nil, status.Error(codes.Internal, err.Error())
501+
}
502+
if !exists {
503+
logger.Infof("Path does not exist %s", volumePath)
504+
return nil, status.Errorf(codes.NotFound, "path %s does not exist", volumePath)
505+
}
506+
507+
metricsProvider := volume.NewMetricsStatFS(volumePath)
508+
metrics, err := metricsProvider.GetMetrics()
509+
if err != nil {
510+
logger.With(zap.Error(err)).Errorf("failed to get block volume info on path %s: %v", volumePath, err)
511+
return nil, status.Error(codes.Internal, err.Error())
512+
}
513+
514+
return &csi.NodeGetVolumeStatsResponse{
515+
Usage: []*csi.VolumeUsage{
516+
{
517+
Unit: csi.VolumeUsage_BYTES,
518+
Available: metrics.Available.AsDec().UnscaledBig().Int64(),
519+
Total: metrics.Capacity.AsDec().UnscaledBig().Int64(),
520+
Used: metrics.Used.AsDec().UnscaledBig().Int64(),
521+
},
522+
{
523+
Unit: csi.VolumeUsage_INODES,
524+
Available: metrics.InodesFree.AsDec().UnscaledBig().Int64(),
525+
Total: metrics.Inodes.AsDec().UnscaledBig().Int64(),
526+
Used: metrics.InodesUsed.AsDec().UnscaledBig().Int64(),
527+
},
528+
},
529+
}, nil
482530
}
483531

484532
//NodeExpandVolume returns the expand of the volume

pkg/oci/client/load_balancer.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,14 @@ func (c *loadbalancerClientStruct) AwaitWorkRequest(ctx context.Context, id stri
388388
var wr *loadbalancer.WorkRequest
389389
contextWithTimeout, cancel := context.WithTimeout(ctx, defaultSynchronousAPIContextTimeout)
390390
defer cancel()
391+
requestId, _ := generateRandUUID()
391392
err := wait.PollUntil(workRequestPollInterval, func() (done bool, err error) {
392393
twr, err := c.GetWorkRequest(contextWithTimeout, id)
393394
if err != nil {
394395
if IsRetryable(err) {
395396
return false, nil
396397
}
397-
return true, errors.WithStack(err)
398+
return true, errors.Wrapf(errors.WithStack(err), "failed to get workrequest. opc-request-id: %s", requestId)
398399
}
399400
switch twr.LifecycleState {
400401
case loadbalancer.WorkRequestLifecycleStateSucceeded:

pkg/oci/client/utils.go

+14
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
package client
1616

1717
import (
18+
"crypto/rand"
19+
"fmt"
1820
"net/http"
1921
"strings"
2022

@@ -101,3 +103,15 @@ func NewRateLimiter(logger *zap.SugaredLogger, config *providercfg.RateLimiterCo
101103

102104
return rateLimiter
103105
}
106+
107+
// source: oci-go-sdk common/http.go
108+
func generateRandUUID() (string, error) {
109+
b := make([]byte, 16)
110+
_, err := rand.Read(b)
111+
if err != nil {
112+
return "", err
113+
}
114+
uuid := fmt.Sprintf("%x%x%x%x%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:])
115+
116+
return uuid, nil
117+
}

vendor/github.com/bits-and-blooms/bitset/.gitignore

+26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)