Skip to content

Commit

Permalink
Merge pull request #6 from OctopusDeploy/master
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
Maxim Peshkov authored Nov 13, 2020
2 parents c138ff4 + 668c9d9 commit 0e98dbd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions integration/project_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func AssertEqualProjects(t *testing.T, expected *octopusdeploy.Project, actual *
assert.Equal(t, expected.AutoCreateRelease, actual.AutoCreateRelease)
assert.Equal(t, expected.AutoDeployReleaseOverrides, actual.AutoDeployReleaseOverrides)
assert.Equal(t, expected.ClonedFromProjectID, actual.ClonedFromProjectID)
assert.Equal(t, expected.ConnectivityPolicy, actual.ConnectivityPolicy)
assert.Equal(t, expected.DefaultGuidedFailureMode, actual.DefaultGuidedFailureMode)
assert.Equal(t, expected.DefaultToSkipIfAlreadyInstalled, actual.DefaultToSkipIfAlreadyInstalled)
assert.Equal(t, expected.DeploymentChangesTemplate, actual.DeploymentChangesTemplate)
Expand All @@ -38,7 +39,6 @@ func AssertEqualProjects(t *testing.T, expected *octopusdeploy.Project, actual *
assert.Equal(t, expected.IsVersionControlled, actual.IsVersionControlled)
assert.Equal(t, expected.LifecycleID, actual.LifecycleID)
assert.Equal(t, expected.Name, actual.Name)
assert.Equal(t, expected.ProjectConnectivityPolicy, actual.ProjectConnectivityPolicy)
assert.Equal(t, expected.ProjectGroupID, actual.ProjectGroupID)
assert.Equal(t, expected.ReleaseCreationStrategy, actual.ReleaseCreationStrategy)
assert.Equal(t, expected.ReleaseNotesTemplate, actual.ReleaseNotesTemplate)
Expand Down Expand Up @@ -206,14 +206,14 @@ func TestProjectUpdate(t *testing.T) {
newSkipMachineBehavior := octopusdeploy.SkipMachineBehaviorNone

project.Name = newProjectName
project.ConnectivityPolicy.SkipMachineBehavior = newSkipMachineBehavior
project.Description = newDescription
project.ProjectConnectivityPolicy.SkipMachineBehavior = newSkipMachineBehavior

updatedProject, err := client.Projects.Update(project)
require.NoError(t, err)
require.Equal(t, newProjectName, updatedProject.Name, "project name was not updated")
require.Equal(t, newDescription, updatedProject.Description, "project description was not updated")
require.Equal(t, newSkipMachineBehavior, project.ProjectConnectivityPolicy.SkipMachineBehavior, "project connectivity policy name was not updated")
require.Equal(t, newSkipMachineBehavior, project.ConnectivityPolicy.SkipMachineBehavior, "project connectivity policy name was not updated")
}

func TestProjectGetByName(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions octopusdeploy/kubernetes_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ func (k *KubernetesEndpoint) UnmarshalJSON(data []byte) error {
k.Authentication = fields.Authentication
k.ClusterCertificate = fields.ClusterCertificate
k.ClusterURL = u
k.CommunicationStyle = fields.CommunicationStyle
k.Container = fields.Container
k.DefaultWorkerPoolID = fields.DefaultWorkerPoolID
k.Namespace = fields.Namespace
Expand Down
14 changes: 7 additions & 7 deletions octopusdeploy/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,21 +156,21 @@ func (m *machine) UnmarshalJSON(b []byte) error {

switch communicationStyle {
case "AzureCloudService":
var ServiceFabricEndpoint ServiceFabricEndpoint
var ServiceFabricEndpoint *ServiceFabricEndpoint
err := json.Unmarshal(*endpoint, &ServiceFabricEndpoint)
if err != nil {
return err
}
m.Endpoint = ServiceFabricEndpoint
case "AzureServiceFabricCluster":
var ServiceFabricEndpoint ServiceFabricEndpoint
var ServiceFabricEndpoint *ServiceFabricEndpoint
err := json.Unmarshal(*endpoint, &ServiceFabricEndpoint)
if err != nil {
return err
}
m.Endpoint = ServiceFabricEndpoint
case "AzureWebApp":
var azureWebAppEndpoint AzureWebAppEndpoint
var azureWebAppEndpoint *AzureWebAppEndpoint
err := json.Unmarshal(*endpoint, &azureWebAppEndpoint)
if err != nil {
return err
Expand All @@ -184,14 +184,14 @@ func (m *machine) UnmarshalJSON(b []byte) error {
}
m.Endpoint = kubernetesEndpoint
case "None":
var cloudRegionEndpoint CloudRegionEndpoint
var cloudRegionEndpoint *CloudRegionEndpoint
err := json.Unmarshal(*endpoint, &cloudRegionEndpoint)
if err != nil {
return err
}
m.Endpoint = cloudRegionEndpoint
case "OfflineDrop":
var offlineDropEndpoint OfflineDropEndpoint
var offlineDropEndpoint *OfflineDropEndpoint
err := json.Unmarshal(*endpoint, &offlineDropEndpoint)
if err != nil {
return err
Expand All @@ -205,14 +205,14 @@ func (m *machine) UnmarshalJSON(b []byte) error {
}
m.Endpoint = sshEndpoint
case "TentacleActive":
var pollingTentacleEndpoint PollingTentacleEndpoint
var pollingTentacleEndpoint *PollingTentacleEndpoint
err := json.Unmarshal(*endpoint, &pollingTentacleEndpoint)
if err != nil {
return err
}
m.Endpoint = pollingTentacleEndpoint
case "TentaclePassive":
var listeningTentacleEndpoint ListeningTentacleEndpoint
var listeningTentacleEndpoint *ListeningTentacleEndpoint
err := json.Unmarshal(*endpoint, &listeningTentacleEndpoint)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion octopusdeploy/ssh_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ type SSHEndpoint struct {
DotNetCorePlatform string
Fingerprint string
Host string
ProxyID string `json:"ProxyId,omitempty"`
Port int
ProxyID string `json:"ProxyId,omitempty"`
URI *url.URL `json:"Uri"`

resource
Expand Down

0 comments on commit 0e98dbd

Please sign in to comment.