Skip to content
Open
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
17 changes: 11 additions & 6 deletions commands/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2879,13 +2879,18 @@ func ssoConfigFromArgs(c *CmdConfig) (*godo.KubernetesClusterSSO, error) {
if err != nil {
return nil, fmt.Errorf("getting %s flag value: %w", doctl.ArgKubernetesRequireSSO, err)
}
if enableSSO != nil || requireSSO != nil {
return &godo.KubernetesClusterSSO{
Enabled: enableSSO,
Required: requireSSO,
}, nil

if enableSSO == nil && requireSSO == nil {
return nil, nil
}
sso := &godo.KubernetesClusterSSO{}
if enableSSO != nil {
sso.Enabled = *enableSSO
}
if requireSSO != nil {
sso.Required = *requireSSO
}
return nil, nil
return sso, nil
}

func boolPtr(val bool) *bool {
Expand Down
6 changes: 3 additions & 3 deletions commands/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@ func TestKubernetesCreate(t *testing.T) {
Enabled: boolPtr(true),
},
SSO: &godo.KubernetesClusterSSO{
Enabled: boolPtr(true),
Required: boolPtr(false),
Enabled: true,
Required: false,
},
}
tm.kubernetes.EXPECT().Create(&r).Return(&testCluster, nil)
Expand Down Expand Up @@ -664,7 +664,7 @@ func TestKubernetesUpdate(t *testing.T) {
Enabled: boolPtr(true),
},
SSO: &godo.KubernetesClusterSSO{
Enabled: boolPtr(true),
Enabled: true,
},
}
tm.kubernetes.EXPECT().Update(testCluster.ID, &r).Return(&testCluster, nil)
Expand Down
20 changes: 14 additions & 6 deletions commands/nfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func nfsSnapshotCreate(c *CmdConfig) error {
}

if wait {
_, err := actionWait(c, action.ID, 5)
_, err := nfsActionWait(c, action.ID, 5)
if err != nil {
return err
}
Expand Down Expand Up @@ -341,7 +341,7 @@ func nfsResize(c *CmdConfig) error {
}

if wait {
_, err := actionWait(c, action.ID, 5)
_, err := nfsActionWait(c, action.ID, 5)
if err != nil {
return err
}
Expand Down Expand Up @@ -375,7 +375,7 @@ func nfsAttach(c *CmdConfig) error {
}

if wait {
_, err := actionWait(c, action.ID, 5)
_, err := nfsActionWait(c, action.ID, 5)
if err != nil {
return err
}
Expand Down Expand Up @@ -408,7 +408,7 @@ func nfsDetach(c *CmdConfig) error {
}

if wait {
_, err := actionWait(c, action.ID, 5)
_, err := nfsActionWait(c, action.ID, 5)
if err != nil {
return err
}
Expand Down Expand Up @@ -443,7 +443,7 @@ func nfsReassign(c *CmdConfig) error {
}

if wait {
_, err := actionWait(c, action.ID, 5)
_, err := nfsActionWait(c, action.ID, 5)
if err != nil {
return err
}
Expand Down Expand Up @@ -475,7 +475,7 @@ func nfsSwitchPerformanceTier(c *CmdConfig) error {
}

if wait {
_, err := actionWait(c, action.ID, 5)
_, err := nfsActionWait(c, action.ID, 5)
if err != nil {
return err
}
Expand All @@ -485,6 +485,14 @@ func nfsSwitchPerformanceTier(c *CmdConfig) error {
return c.Display(item)
}

func nfsActionWait(c *CmdConfig, actionID string, pollTime int) (*do.Action, error) {
id, err := strconv.Atoi(actionID)
if err != nil {
return nil, fmt.Errorf("invalid action ID %q: %w", actionID, err)
}
return actionWait(c, id, pollTime)
}

func displayNfs(c *CmdConfig, shares ...do.Nfs) error {
item := &displayers.Nfs{NfsShares: shares}
return c.Display(item)
Expand Down
14 changes: 7 additions & 7 deletions commands/nfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var (
}
testNfsAction = do.NfsAction{
NfsAction: &godo.NfsAction{
ID: 123456,
ID: "123456",
Status: "in-progress",
Type: "snapshot",
},
Expand Down Expand Up @@ -305,7 +305,7 @@ func TestRunNfsSnapshotCreate(t *testing.T) {
if !tc.expectErr {
tm.nfsActions.EXPECT().Snapshot(tc.shareID, tc.snapName, tc.region).Return(&testNfsAction, nil)
if tc.wait {
tm.actions.EXPECT().Get(testNfsAction.ID).Return(&testAction, nil)
tm.actions.EXPECT().Get(123456).Return(&testAction, nil)
}
}

Expand Down Expand Up @@ -367,7 +367,7 @@ func TestRunNfsResize(t *testing.T) {
size := uint64(2048)
tm.nfsActions.EXPECT().Resize(tc.id, size, tc.region).Return(&testNfsAction, nil)
if tc.wait {
tm.actions.EXPECT().Get(testNfsAction.ID).Return(&testAction, nil)
tm.actions.EXPECT().Get(123456).Return(&testAction, nil)
}
}

Expand Down Expand Up @@ -421,7 +421,7 @@ func TestRunNfsAttach(t *testing.T) {
vpcID := "vpc-1234"
tm.nfsActions.EXPECT().Attach(tc.id, vpcID, tc.region).Return(&testNfsAction, nil)
if tc.wait {
tm.actions.EXPECT().Get(testNfsAction.ID).Return(&testAction, nil)
tm.actions.EXPECT().Get(123456).Return(&testAction, nil)
}
}

Expand Down Expand Up @@ -475,7 +475,7 @@ func TestRunNfsDetach(t *testing.T) {
vpcID := "vpc-1234"
tm.nfsActions.EXPECT().Detach(tc.id, vpcID, tc.region).Return(&testNfsAction, nil)
if tc.wait {
tm.actions.EXPECT().Get(testNfsAction.ID).Return(&testAction, nil)
tm.actions.EXPECT().Get(123456).Return(&testAction, nil)
}
}

Expand Down Expand Up @@ -528,7 +528,7 @@ func TestRunNfsReassign(t *testing.T) {
if !tc.expectErr {
tm.nfsActions.EXPECT().Reassign(tc.id, tc.oldVpcID, tc.newVpcID).Return(&testNfsAction, nil)
if tc.wait {
tm.actions.EXPECT().Get(testNfsAction.ID).Return(&testAction, nil)
tm.actions.EXPECT().Get(123456).Return(&testAction, nil)
}
}

Expand Down Expand Up @@ -578,7 +578,7 @@ func TestRunNfsSwitchPerformanceTier(t *testing.T) {
if !tc.expectErr {
tm.nfsActions.EXPECT().SwitchPerformanceTier(tc.id, tc.performanceTier).Return(&testNfsAction, nil)
if tc.wait {
tm.actions.EXPECT().Get(testNfsAction.ID).Return(&testAction, nil)
tm.actions.EXPECT().Get(123456).Return(&testAction, nil)
}
}

Expand Down
2 changes: 1 addition & 1 deletion do/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (k8s *kubernetesClusterService) Get(clusterID string) (*KubernetesCluster,
}

func (k8s *kubernetesClusterService) GetKubeConfig(clusterID string) ([]byte, error) {
config, _, err := k8s.client.GetKubeConfig(context.TODO(), clusterID)
config, _, err := k8s.client.GetKubeConfig(context.TODO(), clusterID, &godo.KubernetesClusterKubeconfigGetRequest{})
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.25.0
require (
github.com/blang/semver v3.5.1+incompatible
github.com/creack/pty v1.1.21
github.com/digitalocean/godo v1.184.1-0.20260410132851-6a015e2e3b32
github.com/digitalocean/godo v1.188.0
github.com/docker/cli v24.0.5+incompatible
github.com/docker/docker v25.0.6+incompatible
github.com/docker/docker-credential-helpers v0.7.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/digitalocean/godo v1.184.1-0.20260410132851-6a015e2e3b32 h1:bO0M6ODWgllf/LlR0wzlxIxiMMcJuHvlrQdDfhC4ufY=
github.com/digitalocean/godo v1.184.1-0.20260410132851-6a015e2e3b32/go.mod h1:xQsWpVCCbkDrWisHA72hPzPlnC+4W5w/McZY5ij9uvU=
github.com/digitalocean/godo v1.188.0 h1:QDxgjWnJYRf3JStAY9KM0xUqPC1YfXkPQWUMRRzraCk=
github.com/digitalocean/godo v1.188.0/go.mod h1:xQsWpVCCbkDrWisHA72hPzPlnC+4W5w/McZY5ij9uvU=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/cli v24.0.5+incompatible h1:WeBimjvS0eKdH4Ygx+ihVq1Q++xg36M/rMi4aXAvodc=
Expand Down
19 changes: 19 additions & 0 deletions vendor/github.com/digitalocean/godo/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 21 additions & 3 deletions vendor/github.com/digitalocean/godo/apps.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions vendor/github.com/digitalocean/godo/apps_accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading