Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Release/shadow set v0.15.2 #111

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions api/cloud/servers_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func TestListServerVolumes(t *testing.T) {
}
}

//======= Events ==========
// ======= Events ==========
func TestListEvents(t *testing.T) {
serversIn := testdata.GetServerData()
eventsIn := testdata.GetEventData()
Expand All @@ -138,7 +138,7 @@ func TestListEvents(t *testing.T) {
}
}

//======= Operational Scripts ==========
// ======= Operational Scripts ==========
func TestListOperationalScripts(t *testing.T) {
serversIn := testdata.GetServerData()
scriptsIn := testdata.GetScriptCharData()
Expand Down
10 changes: 5 additions & 5 deletions api/types/cloud_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ type CloudAccount struct {
CloudProviderID string `json:"cloud_provider_id" header:"CLOUD_PROVIDER_ID"`
CloudProviderName string `header:"CLOUD_PROVIDER_NAME"`
SupportsImporting bool `json:"supports_importing" header:"SUPPORTS_IMPORTING" show:"nolist"`
SupportsImportingVPCs bool `json:"supports_importing_vpcs" header:"SUPPORTS_IMPORTING_VPCS" show:"nolist"`
SupportsImportingFloatingIPs bool `json:"supports_importing_floating_ips" header:"SUPPORTS_IMPORTING_FLOATING_IPS" show:"nolist"`
SupportsImportingVolumes bool `json:"supports_importing_volumes" header:"SUPPORTS_IMPORTING_VOLUMES" show:"nolist"`
SupportsImportingPolicies bool `json:"supports_importing_policies" header:"SUPPORTS_IMPORTING_POLICIES" show:"nolist"`
SupportsImportingKubernetesClusters bool `json:"supports_importing_kubernetes_clusters" header:"SUPPORTS_IMPORTING_KUBERNETES_CLUSTERS" show:"nolist"`
SupportsImportingVPCs bool `json:"supports_importing_vpcs" header:"SUPPORTS_IMPORTING_VPCS" show:"nolist"`
SupportsImportingFloatingIPs bool `json:"supports_importing_floating_ips" header:"SUPPORTS_IMPORTING_FLOATING_IPS" show:"nolist"`
SupportsImportingVolumes bool `json:"supports_importing_volumes" header:"SUPPORTS_IMPORTING_VOLUMES" show:"nolist"`
SupportsImportingPolicies bool `json:"supports_importing_policies" header:"SUPPORTS_IMPORTING_POLICIES" show:"nolist"`
SupportsImportingKubernetesClusters bool `json:"supports_importing_kubernetes_clusters" header:"SUPPORTS_IMPORTING_KUBERNETES_CLUSTERS" show:"nolist"`
State string `json:"state" header:"STATE"`
ErrorEventID string `json:"error_event_id" header:"ERROR_EVENT_ID" show:"nolist"`
ResourceType string `json:"resource_type" header:"RESOURCE_TYPE" show:"nolist"`
Expand Down
40 changes: 20 additions & 20 deletions api/types/load_balancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ type LoadBalancer struct {
}

type LoadBalancerPlan struct {
ID string `json:"id" header:"ID"`
Name string `json:"name" header:"NAME"`
CloudProviderID string `json:"cloud_provider_id,omitempty" header:"CLOUD_PROVIDER_ID" show:"noshow"`
CloudProviderName string `header:"CLOUD_PROVIDER_NAME" show:"noshow"`
RealmID string `json:"realm_id" header:"REALM_ID"`
RealmProviderName string `json:"realm_provider_name,omitempty" header:"REALM_PROVIDER_NAME"`
FlavourProviderName string `json:"flavour_provider_name,omitempty" header:"FLAVOUR_PROVIDER_NAME"`
Protocols []string `json:"protocols" header:"PROTOCOLS"`
HealthCheckProtocols []string `json:"health_check_protocols" header:"HEALTH_CHECK_PROTOCOLS"`
RuleFields []string `json:"rule_fields" header:"RULE_FIELDS" show:"nolist"`
HealthCheckIntervalValidValues map[string]interface{} `json:"health_check_interval_valid_values" header:"HEALTH_CHECK_INTERVAL_VALID_VALUES" show:"nolist"`
HealthCheckTimeoutValidValues map[string]interface{} `json:"health_check_timeout_valid_values" header:"HEALTH_CHECK_TIMEOUT_VALID_VALUES" show:"nolist"`
ID string `json:"id" header:"ID"`
Name string `json:"name" header:"NAME"`
CloudProviderID string `json:"cloud_provider_id,omitempty" header:"CLOUD_PROVIDER_ID" show:"noshow"`
CloudProviderName string `header:"CLOUD_PROVIDER_NAME" show:"noshow"`
RealmID string `json:"realm_id" header:"REALM_ID"`
RealmProviderName string `json:"realm_provider_name,omitempty" header:"REALM_PROVIDER_NAME"`
FlavourProviderName string `json:"flavour_provider_name,omitempty" header:"FLAVOUR_PROVIDER_NAME"`
Protocols []string `json:"protocols" header:"PROTOCOLS"`
HealthCheckProtocols []string `json:"health_check_protocols" header:"HEALTH_CHECK_PROTOCOLS"`
RuleFields []string `json:"rule_fields" header:"RULE_FIELDS" show:"nolist"`
HealthCheckIntervalValidValues map[string]interface{} `json:"health_check_interval_valid_values" header:"HEALTH_CHECK_INTERVAL_VALID_VALUES" show:"nolist"`
HealthCheckTimeoutValidValues map[string]interface{} `json:"health_check_timeout_valid_values" header:"HEALTH_CHECK_TIMEOUT_VALID_VALUES" show:"nolist"`
HealthCheckThresholdCountValidValues map[string]interface{} `json:"health_check_threshold_count_valid_values" header:"HEALTH_CHECK_THRESHOLD_COUNT_VALID_VALUES" show:"nolist"`
Deprecated bool `json:"deprecated,omitempty" header:"DEPRECATED" show:"nolist,noshow"`
ResourceType string `json:"resource_type" header:"RESOURCE_TYPE" show:"nolist"`
Deprecated bool `json:"deprecated,omitempty" header:"DEPRECATED" show:"nolist,noshow"`
ResourceType string `json:"resource_type" header:"RESOURCE_TYPE" show:"nolist"`
}

type TargetGroup struct {
Expand All @@ -42,13 +42,13 @@ type TargetGroup struct {
State string `json:"state" header:"STATE"`
RemoteID string `json:"remote_id" header:"REMOTE_ID"`
Protocol string `json:"protocol" header:"PROTOCOL"`
Port int `json:"port" header:"PORT"`
Stickiness bool `json:"stickiness" header:"STICKINESS" show:"nolist"`
Port int `json:"port" header:"PORT"`
Stickiness bool `json:"stickiness" header:"STICKINESS" show:"nolist"`
HealthCheckProtocol string `json:"health_check_protocol" header:"HEALTH_CHECK_PROTOCOL" show:"nolist"`
HealthCheckPort int `json:"health_check_port" header:"HEALTH_CHECK_PORT" show:"nolist"`
HealthCheckInterval int `json:"health_check_interval" header:"HEALTH_CHECK_INTERVAL" show:"nolist"`
HealthCheckTimeout int `json:"health_check_timeout" header:"HEALTH_CHECK_TIMEOUT" show:"nolist"`
HealthCheckThresholdCount int `json:"health_check_threshold_count" header:"HEALTH_CHECK_THRESHOLD_COUNT" show:"nolist"`
HealthCheckPort int `json:"health_check_port" header:"HEALTH_CHECK_PORT" show:"nolist"`
HealthCheckInterval int `json:"health_check_interval" header:"HEALTH_CHECK_INTERVAL" show:"nolist"`
HealthCheckTimeout int `json:"health_check_timeout" header:"HEALTH_CHECK_TIMEOUT" show:"nolist"`
HealthCheckThresholdCount int `json:"health_check_threshold_count" header:"HEALTH_CHECK_THRESHOLD_COUNT" show:"nolist"`
HealthCheckPath string `json:"health_check_path" header:"health_check_path" show:"nolist"`
LoadBalancerID string `json:"load_balancer_id" header:"LOAD_BALANCER_ID"`
ErrorEventID string `json:"error_event_id" header:"ERROR_EVENT_ID" show:"nolist"`
Expand Down
2 changes: 1 addition & 1 deletion api/types/subnets.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type Subnet struct {
State string `json:"state,omitempty" header:"STATE"`
Type string `json:"type,omitempty" header:"STATE"`
VpcID string `json:"vpc_id,omitempty" header:"VPC_ID"`
ServerCreationDisabled bool `json:"server_creation_disabled,omitempty" header:"SERVER_CREATION_DISABLED" show:"nolist,noshow"`
ServerCreationDisabled bool `json:"server_creation_disabled,omitempty" header:"SERVER_CREATION_DISABLED" show:"nolist,noshow"`
ResourceType string `json:"resource_type" header:"RESOURCE_TYPE" show:"nolist"`
Brownfield bool `json:"brownfield,omitempty" header:"BROWNFIELD" show:"nolist,noshow"`
}
2 changes: 1 addition & 1 deletion api/types/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Template struct {
RunList []string `json:"run_list,omitempty" header:"RUN_LIST" show:"nolist"`
ConfigurationAttributes map[string]interface{} `json:"configuration_attributes,omitempty" header:"CONFIGURATION_ATTRIBUTES" show:"nolist"`
ResourceType string `json:"resource_type" header:"RESOURCE_TYPE" show:"nolist"`
CookbookVersions cookbookVersionsMap `json:"cookbook_versions,omitempty" header:"COOKBOOK_VERSIONS" show:"nolist"`
CookbookVersions cookbookVersionsMap `json:"cookbook_versions,omitempty" header:"COOKBOOK_VERSIONS" show:"nolist"`
State string `json:"state" header:"STATE" show:"nolist"`
LabelableFields
}
Expand Down
2 changes: 1 addition & 1 deletion api/types/temporary_archives.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type TemporaryArchiveExport struct {
TaskID string `json:"task_id" header:"TASK_ID"`
}

//tosca_task
// tosca_task
type TemporaryArchiveExportTask struct {
ID string `json:"id" header:"ID"`
Type string `json:"type" header:"TYPE"`
Expand Down
3 changes: 1 addition & 2 deletions api/wizard/wizard_server_plans_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (
log "github.com/sirupsen/logrus"
)

const APIPathWizardServerPlansByAppLocationCloudProvider =
"/wizard/server_plans?app_id=%s&location_id=%s&cloud_provider_id=%s"
const APIPathWizardServerPlansByAppLocationCloudProvider = "/wizard/server_plans?app_id=%s&location_id=%s&cloud_provider_id=%s"

// WizardServerPlanService manages wizard server plan operations
type WizardServerPlanService struct {
Expand Down
20 changes: 16 additions & 4 deletions argo/argo-build-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ spec:
arguments:
parameters:
- name: go-image
value: golang:1.18.5
value: golang:1.19.4
- name: notifiable_commits
value: "{{tasks.dependencies.outputs.parameters.notifiable_commits}}"
- name: repo
Expand All @@ -85,6 +85,18 @@ spec:
value: .
when: "{{workflow.parameters.skip_tests}} == false"

- name: cio-govulncheck
dependencies: [dependencies]
templateRef:
name: workflow-template-vulnerability-template-1.0
template: govulncheck
arguments:
parameters:
- name: go-image
value: golang:1.19.4
- name: source_mountpath
value: /src

- name: dependency-track
dependencies: [dependencies]
templateRef:
Expand Down Expand Up @@ -139,7 +151,7 @@ spec:
when: "('{{workflow.parameters.pull_request}}' =~ '^[0-9]+$')"

- name: cio-releaser
dependencies: [cio-tests]
dependencies: [cio-build]
template: cio-releaser
arguments:
artifacts:
Expand All @@ -159,7 +171,7 @@ spec:
inputs:
parameters:
- name: go-image
value: golang:1.18.5
value: golang:1.19.4
- name: notifiable_commits
- name: source_mountpath
value: /usr/src
Expand Down Expand Up @@ -238,7 +250,7 @@ spec:
inputs:
parameters:
- name: go-image
value: golang:1.18.5
value: golang:1.19.4
artifacts:
- name: src
path: "/src"
Expand Down
18 changes: 9 additions & 9 deletions blueprint/templates/subcommands.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ func SubCommands() []cli.Command {
},
},
{
Name: "create-template-script",
Usage: "Creates a new script characterisation for a template and appends it to the list of script " +
Name: "create-template-script",
Usage: "Creates a new script characterisation for a template and appends it to the list of script " +
"characterisations of the same type.",
Action: cmd.TemplateScriptCreate,
Flags: []cli.Flag{
Expand All @@ -191,12 +191,12 @@ func SubCommands() []cli.Command {
Usage: "Identifier for the script that is parameterised by the script characterisation",
},
cli.StringFlag{
Name: "parameter-values",
Name: "parameter-values",
Usage: "A map that assigns a value to each script parameter, as a json formatted parameter; " +
"i.e: '{\"param1\":\"val1\",\"param2\":\"val2\"}'",
},
cli.StringFlag{
Name: "parameter-values-from-file",
Name: "parameter-values-from-file",
Usage: "A map that assigns a value to each script parameter, from file or STDIN, as a json formatted " +
"parameter. \n\t" +
"From file: --parameter-values-from-file params.json \n\t" +
Expand All @@ -218,12 +218,12 @@ func SubCommands() []cli.Command {
Usage: "Identifier for the template-script that is parameterised by the script characterisation",
},
cli.StringFlag{
Name: "parameter-values",
Name: "parameter-values",
Usage: "A map that assigns a value to each script parameter, as a json formatted parameter; " +
"i.e: '{\"param1\":\"val1\",\"param2\":\"val2\"}'",
},
cli.StringFlag{
Name: "parameter-values-from-file",
Name: "parameter-values-from-file",
Usage: "A map that assigns a value to each script parameter, from file or STDIN, as a json formatted " +
"parameter. \n\t" +
"From file: --parameter-values-from-file params.json \n\t" +
Expand All @@ -232,8 +232,8 @@ func SubCommands() []cli.Command {
},
},
{
Name: "reorder-template-scripts",
Usage: "Reorders the scripts of the template and type specified according to the provided order, changing " +
Name: "reorder-template-scripts",
Usage: "Reorders the scripts of the template and type specified according to the provided order, changing " +
"their execution order as corresponds.",
Action: cmd.TemplateScriptReorder,
Flags: []cli.Flag{
Expand All @@ -246,7 +246,7 @@ func SubCommands() []cli.Command {
Usage: "Must be \"operational\", \"boot\", or \"shutdown\"",
},
cli.StringFlag{
Name: "script-ids",
Name: "script-ids",
Usage: "A list of comma separated scripts ids that must contain all the ids of scripts of the given " +
"template and type in the desired execution order",
},
Expand Down
1 change: 1 addition & 0 deletions brownfield/linux_firewall.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) 2017-2021 Ingram Micro Inc.

//go:build linux || darwin
// +build linux darwin

package brownfield
Expand Down
1 change: 1 addition & 0 deletions brownfield/linux_settings.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) 2017-2021 Ingram Micro Inc.

//go:build linux || darwin
// +build linux darwin

package brownfield
Expand Down
1 change: 1 addition & 0 deletions brownfield/windows_firewall.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) 2017-2021 Ingram Micro Inc.

//go:build windows
// +build windows

package brownfield
Expand Down
5 changes: 3 additions & 2 deletions brownfield/windows_settings.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) 2017-2021 Ingram Micro Inc.

//go:build windows
// +build windows

package brownfield
Expand Down Expand Up @@ -92,11 +93,11 @@ func sendUsernamePassword(cs *utils.HTTPConcertoservice, username, password stri
return nil
}

func createScriptTemplate(settings *Settings) (string){
func createScriptTemplate(settings *Settings) string {
return strings.Join([]string{
`powershell -command "Set-Service -Name sshd -StartupType Automatic"`,
`powershell -command "Start-Service sshd"`,
`powershell -command "Set-Content -path C:\ProgramData\ssh\administrators_authorized_keys '`+settings.SSHPublicKeys[0]+`'"`,
`powershell -command "Set-Content -path C:\ProgramData\ssh\administrators_authorized_keys '` + settings.SSHPublicKeys[0] + `'"`,
`powershell -command "icacls C:\ProgramData\ssh\administrators_authorized_keys /inheritance:d"`,
`powershell -command "icacls C:\ProgramData\ssh\administrators_authorized_keys /remove 'NT AUTHORITY\Authenticated Users'"`,
`powershell -command "Restart-Service sshd"`,
Expand Down
2 changes: 1 addition & 1 deletion cmd/template_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ func processCookbookVersionItem(
}

// convertFlagParamsToCookbookVersions returns the json representation for the given friendly input format f cookbook
//versions assignation
// versions assignation
// i.e: "wordpress:0.1.0,nano=2.0.1,1password~>1.3.0"
func convertFlagParamsToCookbookVersions(c *cli.Context, cbvsIn string) (map[string]interface{}, error) {
result := map[string]interface{}{}
Expand Down
1 change: 1 addition & 0 deletions firewall/discovery/linux.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) 2017-2021 Ingram Micro Inc.

//go:build linux || darwin
// +build linux darwin

package discovery
Expand Down
1 change: 1 addition & 0 deletions firewall/discovery/windows.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) 2017-2021 Ingram Micro Inc.

//go:build windows
// +build windows

package discovery
Expand Down
1 change: 1 addition & 0 deletions firewall/iptables.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) 2017-2021 Ingram Micro Inc.

//go:build linux
// +build linux

package firewall
Expand Down
1 change: 1 addition & 0 deletions firewall/mac.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) 2017-2021 Ingram Micro Inc.

//go:build darwin
// +build darwin

package firewall
Expand Down
1 change: 1 addition & 0 deletions firewall/solaris.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) 2017-2021 Ingram Micro Inc.

//go:build solaris
// +build solaris

package firewall
Expand Down
1 change: 1 addition & 0 deletions firewall/windows.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) 2017-2021 Ingram Micro Inc.

//go:build windows
// +build windows

package firewall
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
module github.com/ingrammicro/cio

go 1.17
go 1.19

require (
github.com/allan-simon/go-singleinstance v0.0.0-20210120080615-d0997106ab37
github.com/mitchellh/go-homedir v1.1.0
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.1
github.com/urfave/cli v1.22.5
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.1
github.com/urfave/cli v1.22.10
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/stretchr/objx v0.3.0 // indirect
golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f // indirect
github.com/stretchr/objx v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
Loading