diff --git a/.gitreview b/.gitreview index b7e71959c1..c25961a9d2 100644 --- a/.gitreview +++ b/.gitreview @@ -5,7 +5,7 @@ # # Please visit opencontrail.org additional information. # -# e.g. After changes are complete and commited to a local branch, do +# e.g. After changes are complete and committed to a local branch, do # 'git review' to submit changeset to review.opencontrail.org Code Review # (gerrit) System. # diff --git a/REVIEW.md b/REVIEW.md index 94166321e6..ae3f55832b 100644 --- a/REVIEW.md +++ b/REVIEW.md @@ -1,6 +1,6 @@ # Code review guidelines -This file contains guidelines for commiters and code reviewers. +This file contains guidelines for committers and code reviewers. It is open for updates. ## References diff --git a/doc/rest_api.md b/doc/rest_api.md index cf9be1bce6..42f31c9a90 100644 --- a/doc/rest_api.md +++ b/doc/rest_api.md @@ -389,7 +389,7 @@ RESPONSE: { ## Sync API -Sync API support creating or deleting multiple resoruces in one time. +Sync API support creating or deleting multiple resources in one time. This API tries to update resources if same resource with UUID has already exists. POST diff --git a/doc/validation.md b/doc/validation.md index 2fe68cb0e5..730066f62b 100644 --- a/doc/validation.md +++ b/doc/validation.md @@ -3,7 +3,7 @@ Schema based validation is done in `ContrailService` which is the first one in the inner service chain. Validation function for each resource is generated from [template file](tools/templates/contrail/type_validation.tmpl). -Each generated function may be overwriten or extended in [this file](pkg/models/validation.go). +Each generated function may be overwritten or extended in [this file](pkg/models/validation.go). ### Enums diff --git a/pkg/apiserver/bench_integration_test.go b/pkg/apiserver/bench_integration_test.go index c34cc26af6..de7bde715e 100644 --- a/pkg/apiserver/bench_integration_test.go +++ b/pkg/apiserver/bench_integration_test.go @@ -43,8 +43,8 @@ func BenchmarkVirtualNetworkCreate(b *testing.B) { } for i := 0; i < tt.numberOfExistingVNs; i++ { - vn.UUID = "test_exisiting_vn_uuid_" + strconv.Itoa(i) - vn.Name = "test_exisiting_vn_" + strconv.Itoa(i) + vn.UUID = "test_existing_vn_uuid_" + strconv.Itoa(i) + vn.Name = "test_existing_vn_" + strconv.Itoa(i) if _, err := hc.CreateVirtualNetwork(ctx, &services.CreateVirtualNetworkRequest{VirtualNetwork: vn}); err != nil { b.Fatal("Failed to create VN: ", err) diff --git a/pkg/apiserver/test_data/test_alarm.yml b/pkg/apiserver/test_data/test_alarm.yml index 2add95d992..b2890de7a6 100644 --- a/pkg/apiserver/test_data/test_alarm.yml +++ b/pkg/apiserver/test_data/test_alarm.yml @@ -228,7 +228,7 @@ workflow: <<: *alarm_range_correct_without_uuid uuid: test_valid_alarm - - name: update with emtpy rules + - name: update with empty rules request: path: /alarm/test_valid_alarm method: PUT diff --git a/pkg/apiserver/test_data/test_firewall_policy.yml b/pkg/apiserver/test_data/test_firewall_policy.yml index 052b188881..aaa81822f7 100644 --- a/pkg/apiserver/test_data/test_firewall_policy.yml +++ b/pkg/apiserver/test_data/test_firewall_policy.yml @@ -100,7 +100,7 @@ workflow: - name: creating firewall policy with draft mode state property defined should fail request: - path: /firewall-policys + path: /firewall-policies method: POST expected: [400] data: @@ -110,7 +110,7 @@ workflow: - name: creating global firewall policy with scoped refs should fail request: - path: /firewall-policys + path: /firewall-policies method: POST expected: [400] data: @@ -121,7 +121,7 @@ workflow: - name: create firewall policy request: - path: /firewall-policys + path: /firewall-policies method: POST expected: [200] data: diff --git a/pkg/apiserver/test_data/test_forwarding_class.yml b/pkg/apiserver/test_data/test_forwarding_class.yml index ae62ef4076..03ddf7cca3 100644 --- a/pkg/apiserver/test_data/test_forwarding_class.yml +++ b/pkg/apiserver/test_data/test_forwarding_class.yml @@ -90,7 +90,7 @@ workflow: - name: create forwarding class request: - path: /forwarding-classs + path: /forwarding-class method: POST expected: - 200 @@ -101,7 +101,7 @@ workflow: - name: try to create forwarding class with already used id request: - path: /forwarding-classs + path: /forwarding-class method: POST expected: - 400 @@ -114,7 +114,7 @@ workflow: - name: create second forwarding class request: - path: /forwarding-classs + path: /forwarding-class method: POST expected: - 200 @@ -159,7 +159,7 @@ workflow: - name: create forwarding class demo request: - path: /forwarding-classs + path: /forwarding-class method: POST expected: - 200 diff --git a/pkg/apiserver/test_data/test_network_policy.yml b/pkg/apiserver/test_data/test_network_policy.yml index efe004b50d..db4856f90b 100644 --- a/pkg/apiserver/test_data/test_network_policy.yml +++ b/pkg/apiserver/test_data/test_network_policy.yml @@ -114,7 +114,7 @@ workflow: - name: create network policy with security group entries request: - path: /network-policys + path: /network-policies method: POST expected: - 400 @@ -124,7 +124,7 @@ workflow: - name: create network policy with two the same rules request: - path: /network-policys + path: /network-policies method: POST expected: - 409 @@ -134,7 +134,7 @@ workflow: - name: create network policy with invalid protocol number request: - path: /network-policys + path: /network-policies method: POST expected: - 400 @@ -144,7 +144,7 @@ workflow: - name: create network policy with invalid protocol request: - path: /network-policys + path: /network-policies method: POST expected: - 400 @@ -154,7 +154,7 @@ workflow: - name: create valid network policy and check if rule uuid is filled request: - path: /network-policys + path: /network-policies method: POST expected: - 200 diff --git a/pkg/apiserver/test_data/test_provisioning.yml b/pkg/apiserver/test_data/test_provisioning.yml index c51b4c73eb..a2066aad11 100644 --- a/pkg/apiserver/test_data/test_provisioning.yml +++ b/pkg/apiserver/test_data/test_provisioning.yml @@ -213,7 +213,7 @@ workflow: endpoint_2: tag_ids: - 0x00ff0002 - # TODO uncomment when tag refs definied + # TODO uncomment when tag refs defined # tag_refs: # - uuid: tag_test_provisioning_uuid # to: @@ -221,7 +221,7 @@ workflow: - name: create firewall policy request: - path: /firewall-policys + path: /firewall-policies method: POST expected: [200] data: diff --git a/pkg/apiserver/test_data/test_quota_checking.yml b/pkg/apiserver/test_data/test_quota_checking.yml index 411ceaf667..b6bc5ae983 100644 --- a/pkg/apiserver/test_data/test_quota_checking.yml +++ b/pkg/apiserver/test_data/test_quota_checking.yml @@ -395,7 +395,7 @@ workflow: virtual-network: *spocknet_blue2 expect: null - - name: Re-verify virtal_network blue2 is not created + - name: Re-verify virtual_network blue2 is not created request: path: /virtual-network/uuid_vn_blue_spock2 method: GET @@ -805,7 +805,7 @@ workflow: - name: Create network_policy blue 1 request: - path: /network-policys + path: /network-policies method: POST expected: - 200 @@ -829,7 +829,7 @@ workflow: - name: Create network_policy blue 2 request: - path: /network-policys + path: /network-policies method: POST expected: - 400 @@ -861,7 +861,7 @@ workflow: - name: Create network_policy blue 2 (again) request: - path: /network-policys + path: /network-policies method: POST expected: - 200 diff --git a/pkg/apiserver/test_data/test_ref_relax.yml b/pkg/apiserver/test_data/test_ref_relax.yml index 286e1c1e2d..1b9c8674c0 100644 --- a/pkg/apiserver/test_data/test_ref_relax.yml +++ b/pkg/apiserver/test_data/test_ref_relax.yml @@ -55,7 +55,7 @@ workflow: project: *admin_project - name: create network policy request: - path: /network-policys + path: /network-policies method: POST expected: - 200 diff --git a/pkg/apiserver/test_data/test_ref_relax_invalid_input.yml b/pkg/apiserver/test_data/test_ref_relax_invalid_input.yml index 8d1ab563cf..4665d9c9b1 100644 --- a/pkg/apiserver/test_data/test_ref_relax_invalid_input.yml +++ b/pkg/apiserver/test_data/test_ref_relax_invalid_input.yml @@ -45,7 +45,7 @@ workflow: project: *admin_project - name: create network policy request: - path: /network-policys + path: /network-policies method: POST expected: - 200 diff --git a/pkg/apiserver/test_data/test_security_group.yml b/pkg/apiserver/test_data/test_security_group.yml index 31df70296c..6d280f5a0d 100644 --- a/pkg/apiserver/test_data/test_security_group.yml +++ b/pkg/apiserver/test_data/test_security_group.yml @@ -157,7 +157,7 @@ workflow: data: security-group: *security_group_with_no_local expect: null -- name: try to create security group with non mathing ethertype +- name: try to create security group with non matching ethertype request: path: /security-groups method: POST diff --git a/pkg/apiserver/test_data/test_tag.yml b/pkg/apiserver/test_data/test_tag.yml index 148142a491..da8b3181ce 100644 --- a/pkg/apiserver/test_data/test_tag.yml +++ b/pkg/apiserver/test_data/test_tag.yml @@ -3,7 +3,7 @@ cleanup: - path: /tag-type/tag_type_uuid - path: /tag/tag_minimal_correct_uuid - path: /tag/tag_full_correct_uuid -- path: /tag/tag_wihout_tagtype_uuid +- path: /tag/tag_without_tagtype_uuid test_data: # SetUp data diff --git a/pkg/apiserver/test_data/test_virtual_machine_interface.yml b/pkg/apiserver/test_data/test_virtual_machine_interface.yml index 0ba28189fe..fbb0220e84 100644 --- a/pkg/apiserver/test_data/test_virtual_machine_interface.yml +++ b/pkg/apiserver/test_data/test_virtual_machine_interface.yml @@ -138,7 +138,7 @@ workflow: expect: virtual-network: *vn_vmi_blue -- name: create virtual router in the blue virutal network +- name: create virtual router in the blue virtual network request: path: /virtual-routers method: POST @@ -282,7 +282,7 @@ workflow: virtual-machine-interface: virtual_machine_refs: - to: ["default-domain", "admin_vmi_project", "non-existing-vm"] - uuid: uuid-non-exisitng-vm-uuid + uuid: uuid-non-existing-vm-uuid expect: message: $contains: "VirtualMachineRefs create failed" @@ -412,7 +412,7 @@ workflow: virtual_machine_refs: $null # Tests of Delete operation -- name: create virtual machine interface with vrouter linked by bidings and with asssigned virtual machine +- name: create virtual machine interface with vrouter linked by bidings and with assigned virtual machine request: path: /virtual-machine-interfaces method: POST @@ -431,7 +431,7 @@ workflow: - to: ["default-domain", "admin_vmi_project", "default-vm"] uuid: default-vm-uuid -- name: try to delete VMI with assined VRouter and VM +- name: try to delete VMI with assigned VRouter and VM request: path: /virtual-machine-interface/171b8975-9784-4cc7-aa79-6e5efb672221 method: DELETE diff --git a/pkg/apiserver/test_data/test_virtual_network.yml b/pkg/apiserver/test_data/test_virtual_network.yml index e9885c03ec..149903a3a4 100644 --- a/pkg/apiserver/test_data/test_virtual_network.yml +++ b/pkg/apiserver/test_data/test_virtual_network.yml @@ -50,7 +50,7 @@ test_data: simple_action: pass admin_project_with_network_policy1: &admin_project_with_network_policy1 <<: *admin_project - network_policys: + network_policies: - <<: *network_policy1 network_policy2: &network_policy2 fq_name: ["default", "5038dd12-9bf1-11e9-95a1-df91d98ff557", "policy2"] @@ -196,7 +196,7 @@ workflow: project: *demo_project - name: create network policy 1 request: - path: /network-policys + path: /network-policies method: POST expected: - 200 @@ -215,7 +215,7 @@ workflow: - name: create network policy 2 client: bob request: - path: /network-policys + path: /network-policies method: POST expected: - 200 @@ -590,32 +590,32 @@ workflow: - name: list network policy request: # TODO: parent_id is temporary fix as tests in gen_db_test.go are not cleaning database. - path: /network-policys?parent_id=47dd9220-9bf1-11e9-b422-538349e2da80 + path: /network-policies?parent_id=47dd9220-9bf1-11e9-b422-538349e2da80 method: GET expected: - 200 expect: - network-policys: + network-policies: - *network_policy1 - name: list network policy by user bob client: bob request: - path: /network-policys + path: /network-policies method: GET expected: - 200 expect: - network-policys: + network-policies: - *network_policy2 - name: count network policies request: # TODO: parent_id is temporary fix as tests in gen_db_test.go are not cleaning database. - path: "/network-policys?parent_id=47dd9220-9bf1-11e9-b422-538349e2da80&count=true" + path: "/network-policies?parent_id=47dd9220-9bf1-11e9-b422-538349e2da80&count=true" method: GET expected: - 200 expect: - network-policys: + network-policies: count: 1 - name: update vn_blue with user-defined subnet diff --git a/pkg/cache/cache_test.go b/pkg/cache/cache_test.go index d87f5771ab..9a68091f58 100644 --- a/pkg/cache/cache_test.go +++ b/pkg/cache/cache_test.go @@ -140,7 +140,7 @@ type dependencyTestAssertion func( cache *DB, ) -type dependecyTestScenario struct { +type dependencyTestScenario struct { name string event *services.Event assertion dependencyTestAssertion @@ -173,7 +173,7 @@ func TestDependencyResolution(t *testing.T) { } // All the steps must be run in proper order - tests := []dependecyTestScenario{ + tests := []dependencyTestScenario{ { name: "Create vn_blue", event: &services.Event{ @@ -340,7 +340,7 @@ func TestReadInterfaceAndMaxHistory(t *testing.T) { } // All the steps must be run in proper order - tests := []dependecyTestScenario{ + tests := []dependencyTestScenario{ { name: "Create vn_blue", event: &services.Event{ diff --git a/pkg/collector/analytics/collector.go b/pkg/collector/analytics/collector.go index 4e59e14fe9..e6fbb444d5 100644 --- a/pkg/collector/analytics/collector.go +++ b/pkg/collector/analytics/collector.go @@ -21,7 +21,7 @@ const ( defaultTimeout = 30 * time.Second ) -// Config represents parameters of Сollector in the config file +// Config represents parameters of Collector in the config file type Config struct { Enabled bool URL string diff --git a/pkg/compilation/watch/watcher.go b/pkg/compilation/watch/watcher.go index b0dbafcf40..b45a7f06c1 100644 --- a/pkg/compilation/watch/watcher.go +++ b/pkg/compilation/watch/watcher.go @@ -26,7 +26,7 @@ type JobRequest struct { // JobQueue : All jobs get queued here var JobQueue chan JobRequest -// WatcherInit intializes the Watcher +// WatcherInit initializes the Watcher func WatcherInit(numJobs int) { // Initialize the Job-Q with configured number of Jobs permitted JobQueue = make(chan JobRequest, numJobs) diff --git a/pkg/db/db_metadata_test.go b/pkg/db/db_metadata_test.go index eb1a36e336..07a7485373 100644 --- a/pkg/db/db_metadata_test.go +++ b/pkg/db/db_metadata_test.go @@ -36,7 +36,7 @@ func TestService_ListMetadata(t *testing.T) { wantErr bool }{ { - name: "Get multiple metadatas using UUID and FQName", + name: "Get multiple metadata using UUID and FQName", args: []*models.Metadata{ { UUID: "uuid-b", @@ -60,7 +60,7 @@ func TestService_ListMetadata(t *testing.T) { }, }, { - name: "Get multiple metadatas using UUIDs", + name: "Get multiple metadata using UUIDs", args: []*models.Metadata{ { UUID: "uuid-b", @@ -83,7 +83,7 @@ func TestService_ListMetadata(t *testing.T) { }, }, { - name: "Get multiple metadatas using FQNames", + name: "Get multiple metadata using FQNames", args: []*models.Metadata{ { FQName: []string{"default", "uuid-b"}, diff --git a/pkg/models/firewall_refs.go b/pkg/models/firewall_refs.go index 6fc9b0fedb..f6ddefef9e 100644 --- a/pkg/models/firewall_refs.go +++ b/pkg/models/firewall_refs.go @@ -26,7 +26,7 @@ func checkAssociatedRefsInSameScope(obj models.Object, fqName []string, refs []m // isScopedFirewallResource checks whether firewall resource is global or scoped. // Using length of firewall resource one might distinguish a global firewall // resource (fqName length equal to two) to a scoped one (length longer than two). -// Without this assumtion, checking if references are in the same scope has to be re-worked. +// Without this assumption, checking if references are in the same scope has to be re-worked. func isScopedFirewallResource(fqName []string) bool { return len(fqName) != 2 } diff --git a/pkg/models/policy_rule_type.go b/pkg/models/policy_rule_type.go index 984ff7fc70..4991adcf4e 100644 --- a/pkg/models/policy_rule_type.go +++ b/pkg/models/policy_rule_type.go @@ -47,9 +47,9 @@ func (m PolicyRuleType) EqualRule(other PolicyRuleType) bool { return reflect.DeepEqual(m, other) } -var avaiableProtocols = []string{AnyProtocol, ICMPProtocol, TCPProtocol, UDPProtocol, ICMP6Protocol} +var availableProtocols = []string{AnyProtocol, ICMPProtocol, TCPProtocol, UDPProtocol, ICMP6Protocol} -var isAvailableProtocol = format.BoolMap(avaiableProtocols) +var isAvailableProtocol = format.BoolMap(availableProtocols) // ValidateProtocol checks if protocol is valid rule protocol. func (m *PolicyRuleType) ValidateProtocol() error { diff --git a/pkg/models/virtual_network.go b/pkg/models/virtual_network.go index 4c68a2594b..0f2808af3a 100644 --- a/pkg/models/virtual_network.go +++ b/pkg/models/virtual_network.go @@ -23,7 +23,7 @@ const ( //MakeNeutronCompatible makes this resource data neutron compatible. func (m *VirtualNetwork) MakeNeutronCompatible() { - // neutorn <-> vnc sharing + // neutron <-> vnc sharing if m.Perms2.GlobalAccess == models.PermsRWX { m.IsShared = true } diff --git a/pkg/neutron/logic/netutils_test.go b/pkg/neutron/logic/netutils_test.go index 6db64aef27..35feb2018f 100644 --- a/pkg/neutron/logic/netutils_test.go +++ b/pkg/neutron/logic/netutils_test.go @@ -9,12 +9,12 @@ import ( func TestGetIPPrefixAndPrefixLen(t *testing.T) { tests := []struct { - name string - input string - outputIPPrefix string - outputIPNetworPrefix string - outputIPPrefixLen int64 - expectError bool + name string + input string + outputIPPrefix string + outputIPNetworkPrefix string + outputIPPrefixLen int64 + expectError bool }{ {"good ipv4 1", "137.105.215.54/23", "137.105.215.54", "137.105.214.0", 23, false}, {"good ipv4 2", "3.37.8.253/13", "3.37.8.253", "3.32.0.0", 13, false}, @@ -38,7 +38,7 @@ func TestGetIPPrefixAndPrefixLen(t *testing.T) { } assert.EqualValues(t, tt.outputIPPrefix, ipPrefix, "Error wrong IP address") - assert.EqualValues(t, tt.outputIPNetworPrefix, ipNetwork, "Error wrong IP Network address") + assert.EqualValues(t, tt.outputIPNetworkPrefix, ipNetwork, "Error wrong IP Network address") assert.EqualValues(t, tt.outputIPPrefixLen, ipPrefixLen, "Error wrong IP Prefix length") }) } @@ -46,13 +46,13 @@ func TestGetIPPrefixAndPrefixLen(t *testing.T) { func TestDecodeIP(t *testing.T) { tests := []struct { - name string - input string - outputIPPrefix string - outputIPNetworPrefix string - outputIPPrefixLen int64 - outputVersion int8 - expectError bool + name string + input string + outputIPPrefix string + outputIPNetworkPrefix string + outputIPPrefixLen int64 + outputVersion int8 + expectError bool }{ {"good ipv4 mask", "137.105.215.54/23", "137.105.215.54", "137.105.214.0", 23, ipV4, false}, {"good ipv4 nomask", "3.37.8.253", "3.37.8.253", "0.0.0.0", 0, ipV4, false}, @@ -73,7 +73,7 @@ func TestDecodeIP(t *testing.T) { } assert.EqualValues(t, tt.outputIPPrefix, ip.IP, "Error wrong IP address") - assert.EqualValues(t, tt.outputIPNetworPrefix, ip.netIP, "Error wrong IP Network address") + assert.EqualValues(t, tt.outputIPNetworkPrefix, ip.netIP, "Error wrong IP Network address") assert.EqualValues(t, tt.outputIPPrefixLen, ip.prefixLen, "Error wrong IP Prefix length") assert.EqualValues(t, tt.outputVersion, ip.ver, "Error wrong IP version") }) diff --git a/pkg/neutron/logic/network.go b/pkg/neutron/logic/network.go index ba756dbb47..3f13f38c78 100644 --- a/pkg/neutron/logic/network.go +++ b/pkg/neutron/logic/network.go @@ -36,19 +36,19 @@ func (n *Network) UnmarshalJSON(data []byte) error { type alias Network obj := struct { *alias - Policys interface{} `json:"policys"` + Policies interface{} `json:"policies"` }{alias: (*alias)(n)} if err := json.Unmarshal(data, &obj); err != nil { return err } - if policys, ok := obj.Policys.([]interface{}); ok { - for _, policy := range policys { + if policies, ok := obj.Policies.([]interface{}); ok { + for _, policy := range policies { if p, ok := policy.([]string); ok { - n.Policys = append(n.Policys, p) + n.Policies = append(n.Policies, p) } else { - n.Policys = [][]string{} + n.Policies = [][]string{} break } } @@ -58,9 +58,9 @@ func (n *Network) UnmarshalJSON(data []byte) error { // ApplyMap applies map onto network. func (n *Network) ApplyMap(m map[string]interface{}) error { - _, ok := m[NetworkFieldPolicys].(string) + _, ok := m[NetworkFieldPolicies].(string) if ok { - delete(m, NetworkFieldPolicys) + delete(m, NetworkFieldPolicies) } type alias Network return format.ApplyMap(m, (*alias)(n)) @@ -449,7 +449,7 @@ func (n *Network) setVncRefs( vncNet *models.VirtualNetwork, vncFm *types.FieldMask, ) error { - if asfmodels.FieldMaskContains(&rp.FieldMask, buildDataResourcePath(NetworkFieldPolicys)) { + if asfmodels.FieldMaskContains(&rp.FieldMask, buildDataResourcePath(NetworkFieldPolicies)) { n.createNetworkPolicyRef(vncNet, vncFm) } if asfmodels.FieldMaskContains(&rp.FieldMask, buildDataResourcePath(NetworkFieldRouteTable)) && @@ -532,7 +532,7 @@ func (n *Network) createNetworkPolicyRef( vncNet *models.VirtualNetwork, vncFm *types.FieldMask, ) { vncNet.NetworkPolicyRefs = []*models.VirtualNetworkNetworkPolicyRef{} - for i, policy := range n.Policys { + for i, policy := range n.Policies { vncNet.AddNetworkPolicyRef(&models.VirtualNetworkNetworkPolicyRef{ To: policy, Attr: &models.VirtualNetworkPolicyType{ diff --git a/pkg/neutron/logic/network_response.go b/pkg/neutron/logic/network_response.go index b73e95cfcb..fc37724af0 100644 --- a/pkg/neutron/logic/network_response.go +++ b/pkg/neutron/logic/network_response.go @@ -57,14 +57,14 @@ func makeNetworkResponse(rp RequestParameters, vn *models.VirtualNetwork, oper s func (r *NetworkResponse) setResponseRefs(vn *models.VirtualNetwork, oper string) { if oper == OperationRead || oper == OperationReadAll { - r.setPolicys(vn) + r.setPolicies(vn) } r.setRouteTables(vn) } -func (r *NetworkResponse) setPolicys(vn *models.VirtualNetwork) { +func (r *NetworkResponse) setPolicies(vn *models.VirtualNetwork) { for _, np := range vn.GetNetworkPolicyRefs() { - r.Policys = append(r.Policys, np.GetTo()) + r.Policies = append(r.Policies, np.GetTo()) } } diff --git a/pkg/neutron/logic/port.go b/pkg/neutron/logic/port.go index fd9c406c7d..255fc9a8f4 100644 --- a/pkg/neutron/logic/port.go +++ b/pkg/neutron/logic/port.go @@ -115,7 +115,7 @@ func (port *Port) Delete(ctx context.Context, rp RequestParameters, id string) ( }) } - vmID := port.getAsssociatedVirtualMachineID(vmi) + vmID := port.getAssociatedVirtualMachineID(vmi) if err = removeVirtualMachineIfNoPortsLeft(ctx, rp, vmID); err != nil { return nil, err @@ -474,7 +474,7 @@ func shouldChangeDevice(deviceOwner string, fm *types.FieldMask) bool { // updateMacAddress modify mac address only for baremetal deployments or when port is not attached to any VM // Here nil is returned - same as original config node // However this silently discards mac address update request if not allowed -func (port *Port) getAsssociatedVirtualMachineID(vmi *models.VirtualMachineInterface) string { +func (port *Port) getAssociatedVirtualMachineID(vmi *models.VirtualMachineInterface) string { if vmi.GetParentType() == models.KindVirtualMachine { return vmi.GetParentUUID() } diff --git a/pkg/neutron/logic/uuid_test.go b/pkg/neutron/logic/uuid_test.go index d0e87ed6e1..fd897f3552 100644 --- a/pkg/neutron/logic/uuid_test.go +++ b/pkg/neutron/logic/uuid_test.go @@ -16,7 +16,7 @@ func TestVncUUIDToNeutronID(t *testing.T) { for _, test := range tests { result := VncUUIDToNeutronID(test.input) if result != test.output { - t.Errorf("Tranlating contrail uuid (%s) to neutron was incorrect, got: %s, want: %s.", + t.Errorf("Translation contrail uuid (%s) to neutron was incorrect, got: %s, want: %s.", test.input, result, test.output) } } diff --git a/pkg/neutron/tests/test_network.yml b/pkg/neutron/tests/test_network.yml index 14ce064ed9..385572e71a 100644 --- a/pkg/neutron/tests/test_network.yml +++ b/pkg/neutron/tests/test_network.yml @@ -68,7 +68,7 @@ workflow: name: test-vn1 tenant_id: 886c725d04614dd6ac2730c74d4e46fb admin_state_up: true - policys: '' + policies: '' vpc:route_table: '' shared: false port_security_enabled: true @@ -393,7 +393,7 @@ workflow: - name: Create network policy request: - path: /network-policys + path: /network-policies method: POST expected: [200] data: @@ -442,7 +442,7 @@ workflow: - end_port: -1 start_port: -1 -- name: Network update with policys field +- name: Network update with policies field request: path: /neutron/network method: POST @@ -451,7 +451,7 @@ workflow: data: fields: [] resource: - policys: + policies: - - default - neutron_network_admin_project - test-net-policy @@ -482,7 +482,7 @@ workflow: - default - neutron_network_admin_project - test-vn1 - policys: + policies: - - default - neutron_network_admin_project - test-net-policy @@ -494,7 +494,7 @@ workflow: project_id: 886c725d04614dd6ac2730c74d4e46fb description: '' -- name: Network read after update on policys +- name: Network read after update on policies request: path: /neutron/network method: POST @@ -530,7 +530,7 @@ workflow: - default - neutron_network_admin_project - test-vn1 - policys: + policies: - - default - neutron_network_admin_project - test-net-policy @@ -542,7 +542,7 @@ workflow: project_id: 886c725d04614dd6ac2730c74d4e46fb description: '' -- name: Network update with empty policys field +- name: Network update with empty policies field request: path: /neutron/network method: POST @@ -551,7 +551,7 @@ workflow: data: fields: [] resource: - policys: [] + policies: [] id: d9ff46fc-e193-4d40-80ba-0d55c8aed9f2 context: user_id: 06be3763c8224dd5a343e3d95d87c1d2 diff --git a/pkg/neutron/tests/test_network_floating_ip.yml b/pkg/neutron/tests/test_network_floating_ip.yml index 68552f1088..8654ce3444 100644 --- a/pkg/neutron/tests/test_network_floating_ip.yml +++ b/pkg/neutron/tests/test_network_floating_ip.yml @@ -140,7 +140,7 @@ workflow: description: '' tenant_id: 3a36aca64838453dabb05c07e0f75ea2 admin_state_up: true - policys: '' + policies: '' vpc:route_table: '' shared: false port_security_enabled: true diff --git a/pkg/neutron/tests/test_network_referred_by_port.yml b/pkg/neutron/tests/test_network_referred_by_port.yml index dccdfa7beb..90e94e48c1 100644 --- a/pkg/neutron/tests/test_network_referred_by_port.yml +++ b/pkg/neutron/tests/test_network_referred_by_port.yml @@ -10,7 +10,7 @@ clients: name: admin test_data: admin_project: &admin_project - fq_name: ["default", "neutron_network_reffered_admin_project"] + fq_name: ["default", "neutron_network_referred_admin_project"] uuid: 316dc378-4649-11e9-b210-d663bd873d93 parent_type: domain parent_uuid: beefbeef-beef-beef-beef-beefbeef0002 @@ -35,13 +35,13 @@ cleanup: - kind: virtual-network fq_name: - default - - neutron_network_reffered_admin_project + - neutron_network_referred_admin_project - test-vn1 - kind: project fq_name: - default - - neutron_network_reffered_admin_project + - neutron_network_referred_admin_project workflow: - name: Create project admin @@ -69,7 +69,7 @@ workflow: name: test-vn1 tenant_id: 316dc378464911e9b210d663bd873d93 admin_state_up: true - policys: '' + policies: '' vpc:route_table: '' shared: false port_security_enabled: true @@ -87,7 +87,7 @@ workflow: subnet_ipam: [] fq_name: - default - - neutron_network_reffered_admin_project + - neutron_network_referred_admin_project - test-vn1 name: test-vn1 admin_state_up: true @@ -177,7 +177,7 @@ workflow: device_owner: '' fq_name: - default - - neutron_network_reffered_admin_project + - neutron_network_referred_admin_project - 1890381e-9bed-11e9-8d75-f799f60a28a8 fixed_ips: - subnet_id: $uuid diff --git a/pkg/neutron/tests/test_port.yml b/pkg/neutron/tests/test_port.yml index aad18568cb..7deba20bee 100644 --- a/pkg/neutron/tests/test_port.yml +++ b/pkg/neutron/tests/test_port.yml @@ -803,7 +803,7 @@ workflow: method: GET expected: [404] -- name: Neutron port update AllowedAddresPairs and FixedIP +- name: Neutron port update AllowedAddressPairs and FixedIP request: path: /neutron/port method: POST diff --git a/pkg/neutron/tests/test_router.yml b/pkg/neutron/tests/test_router.yml index fa3c96b94b..2d0e9211cc 100644 --- a/pkg/neutron/tests/test_router.yml +++ b/pkg/neutron/tests/test_router.yml @@ -271,7 +271,7 @@ workflow: description: '' tenant_id: *tenant_id admin_state_up: true - policys: '' + policies: '' vpc:route_table: '' shared: false port_security_enabled: true diff --git a/pkg/services/prop_collection_update_test.go b/pkg/services/prop_collection_update_test.go index 6cf11e3d4e..634be5cb29 100644 --- a/pkg/services/prop_collection_update_test.go +++ b/pkg/services/prop_collection_update_test.go @@ -82,7 +82,7 @@ func Test_fieldByTag(t *testing.T) { { name: "field name typo", t: reflect.TypeOf(models.VirtualNetwork{}), - key: "json", value: "annotatio", + key: "json", value: "annotation", wantOk: false, }, { diff --git a/pkg/types/firewall_rule_test.go b/pkg/types/firewall_rule_test.go index fe98fb9264..1152a9dcd8 100644 --- a/pkg/types/firewall_rule_test.go +++ b/pkg/types/firewall_rule_test.go @@ -346,7 +346,7 @@ func TestCreateFirewallRule(t *testing.T) { errorCode: codes.InvalidArgument, }, { - name: "Try to create with tag references definied", + name: "Try to create with tag references defined", testFirewallRule: models.FirewallRule{ Service: &models.FirewallServiceType{ Protocol: models.TCPProtocol, @@ -402,7 +402,7 @@ func TestCreateFirewallRule(t *testing.T) { IsInternalRequest: true, }, { - name: "Try to create with address group references definied", + name: "Try to create with address group references defined", testFirewallRule: models.FirewallRule{ Service: &models.FirewallServiceType{ Protocol: models.TCPProtocol, diff --git a/pkg/types/forwarding_class_test.go b/pkg/types/forwarding_class_test.go index d42b2b2120..8e06923af1 100644 --- a/pkg/types/forwarding_class_test.go +++ b/pkg/types/forwarding_class_test.go @@ -49,7 +49,7 @@ func TestCreateForwardingClass(t *testing.T) { errorCode: codes.OK, }, { - name: "Fail creating ForwardingClass on alredy used ForwardingClassID param", + name: "Fail creating ForwardingClass on already used ForwardingClassID param", testForwardingClass: &models.ForwardingClass{ UUID: "forwarding-class-1", ForwardingClassID: 1, @@ -116,7 +116,7 @@ func TestUpdateForwardingClass(t *testing.T) { name string request services.UpdateForwardingClassRequest // params to be updated *mockedListForwardingClassResponse - *mockedGetForwardingClassResponse // retruns existing obj in DB + *mockedGetForwardingClassResponse // returns existing obj in DB errorCode codes.Code }{ { @@ -147,7 +147,7 @@ func TestUpdateForwardingClass(t *testing.T) { errorCode: codes.OK, }, { - name: "Fail updating ForwardingClass on alredy used ForwardingClassID param", + name: "Fail updating ForwardingClass on already used ForwardingClassID param", request: services.UpdateForwardingClassRequest{ ForwardingClass: &models.ForwardingClass{ UUID: "forwarding-class-1", diff --git a/pkg/types/global_system_config_test.go b/pkg/types/global_system_config_test.go index dfb34958de..5c06079a6e 100644 --- a/pkg/types/global_system_config_test.go +++ b/pkg/types/global_system_config_test.go @@ -17,22 +17,22 @@ import ( func TestGlobalSystemConfigUdc(t *testing.T) { var mockCtrl *gomock.Controller - var inTransationDoerMock *typesmock.MockInTransactionDoer + var inTransactionDoerMock *typesmock.MockInTransactionDoer var dataServiceMock *servicesmock.MockService var logicService ContrailTypeLogicService testSetup := func(t *testing.T) { mockCtrl = gomock.NewController(t) - inTransationDoerMock = typesmock.NewMockInTransactionDoer(mockCtrl) + inTransactionDoerMock = typesmock.NewMockInTransactionDoer(mockCtrl) dataServiceMock = servicesmock.NewMockService(mockCtrl) logicService = ContrailTypeLogicService{ BaseService: services.BaseService{}, ReadService: dataServiceMock, - InTransactionDoer: inTransationDoerMock, + InTransactionDoer: inTransactionDoerMock, } logicService.SetNext(dataServiceMock) - inTransationDoerMock.EXPECT().DoInTransaction(gomock.Not(gomock.Nil()), gomock.Not(gomock.Nil())).DoAndReturn( + inTransactionDoerMock.EXPECT().DoInTransaction(gomock.Not(gomock.Nil()), gomock.Not(gomock.Nil())).DoAndReturn( func(ctx context.Context, do func(context.Context) error) error { return do(ctx) }, @@ -91,22 +91,22 @@ func TestGlobalSystemConfigUdc(t *testing.T) { func TestGlobalSystemConfigBgpaasPorts(t *testing.T) { var mockCtrl *gomock.Controller - var inTransationDoerMock *typesmock.MockInTransactionDoer + var inTransactionDoerMock *typesmock.MockInTransactionDoer var dataServiceMock *servicesmock.MockService var logicService ContrailTypeLogicService testSetup := func(t *testing.T) { mockCtrl = gomock.NewController(t) - inTransationDoerMock = typesmock.NewMockInTransactionDoer(mockCtrl) + inTransactionDoerMock = typesmock.NewMockInTransactionDoer(mockCtrl) dataServiceMock = servicesmock.NewMockService(mockCtrl) logicService = ContrailTypeLogicService{ BaseService: services.BaseService{}, ReadService: dataServiceMock, - InTransactionDoer: inTransationDoerMock, + InTransactionDoer: inTransactionDoerMock, } logicService.SetNext(dataServiceMock) - inTransationDoerMock.EXPECT().DoInTransaction(gomock.Not(gomock.Nil()), gomock.Not(gomock.Nil())).DoAndReturn( + inTransactionDoerMock.EXPECT().DoInTransaction(gomock.Not(gomock.Nil()), gomock.Not(gomock.Nil())).DoAndReturn( func(ctx context.Context, do func(context.Context) error) error { return do(ctx) }, @@ -271,22 +271,22 @@ func TestGlobalSystemConfigBgpaasPorts(t *testing.T) { func TestGlobalSystemConfigAsn(t *testing.T) { var mockCtrl *gomock.Controller - var inTransationDoerMock *typesmock.MockInTransactionDoer + var inTransactionDoerMock *typesmock.MockInTransactionDoer var dataServiceMock *servicesmock.MockService var logicService ContrailTypeLogicService testSetup := func(t *testing.T) { mockCtrl = gomock.NewController(t) - inTransationDoerMock = typesmock.NewMockInTransactionDoer(mockCtrl) + inTransactionDoerMock = typesmock.NewMockInTransactionDoer(mockCtrl) dataServiceMock = servicesmock.NewMockService(mockCtrl) logicService = ContrailTypeLogicService{ BaseService: services.BaseService{}, ReadService: dataServiceMock, - InTransactionDoer: inTransationDoerMock, + InTransactionDoer: inTransactionDoerMock, } logicService.SetNext(dataServiceMock) - inTransationDoerMock.EXPECT().DoInTransaction(gomock.Not(gomock.Nil()), gomock.Not(gomock.Nil())).DoAndReturn( + inTransactionDoerMock.EXPECT().DoInTransaction(gomock.Not(gomock.Nil()), gomock.Not(gomock.Nil())).DoAndReturn( func(ctx context.Context, do func(context.Context) error) error { return do(ctx) }, diff --git a/pkg/types/logical_interface_test.go b/pkg/types/logical_interface_test.go index 9c0d1d9542..2506b05dfc 100644 --- a/pkg/types/logical_interface_test.go +++ b/pkg/types/logical_interface_test.go @@ -40,7 +40,7 @@ func logicalInterfaceReadServiceMocks( ) { readService, ok := s.ReadService.(*servicesmock.MockReadService) assert.True(t, ok) - // Use empty physical router structure instead nil parent physical rounter + // Use empty physical router structure instead nil parent physical router if parentRouter == nil { parentRouter = new(models.PhysicalRouter) } diff --git a/pkg/types/physical_interface_test.go b/pkg/types/physical_interface_test.go index 150a7cc500..71ee8b83ab 100644 --- a/pkg/types/physical_interface_test.go +++ b/pkg/types/physical_interface_test.go @@ -40,7 +40,7 @@ func physicalInterfaceReadServiceMocks( ) { readService, ok := s.ReadService.(*servicesmock.MockReadService) assert.True(t, ok) - // Use empty physical router structure instead nil parent physical rounter + // Use empty physical router structure instead nil parent physical router if parentRouter == nil { parentRouter = new(models.PhysicalRouter) } diff --git a/schemas/contrail/core/fabric-schema.yml b/schemas/contrail/core/fabric-schema.yml index 3c7ed9ddb8..b828db8c16 100644 --- a/schemas/contrail/core/fabric-schema.yml +++ b/schemas/contrail/core/fabric-schema.yml @@ -13,7 +13,7 @@ prefix: / references: node_profile: $ref: types.json#/definitions/SerialNumListType - description: node profiles assignd to the fabric. The serial number list on the + description: node profiles assigned to the fabric. The serial number list on the link is used to auto assign node-profile during ZTP so that port channelization could be bootstrapped based on the hardware spec in the node profile. operations: CRUD diff --git a/schemas/contrail/core/firewall-policy-schema.yml b/schemas/contrail/core/firewall-policy-schema.yml index 7225d24773..baf771fb49 100644 --- a/schemas/contrail/core/firewall-policy-schema.yml +++ b/schemas/contrail/core/firewall-policy-schema.yml @@ -12,7 +12,7 @@ parents: rules operations: CRUD presence: optional -plural: firewall_policys +plural: firewall_policies prefix: / references: firewall_rule: diff --git a/schemas/contrail/core/global-system-config-schema.yml b/schemas/contrail/core/global-system-config-schema.yml index ed223b7113..bb9f118a22 100644 --- a/schemas/contrail/core/global-system-config-schema.yml +++ b/schemas/contrail/core/global-system-config-schema.yml @@ -119,7 +119,7 @@ schema: supported_fabric_annotations: $ref: types.json#/definitions/KeyValuePairs description: 'List of supported annotations that can be used to annotate a Contrail - Fabric. These annoations are used as directives, or hints to assign resources + Fabric. These annotations are used as directives, or hints to assign resources defined in namespaces to the network devices. For example, `igp-protocol: ospf` attribute could be used by the underlay provisioning playbook to choose which IGP protocol to use for the IP fabric.' diff --git a/schemas/contrail/core/loadbalancer-pool-schema.yml b/schemas/contrail/core/loadbalancer-pool-schema.yml index e3fb3d0891..2cea766363 100644 --- a/schemas/contrail/core/loadbalancer-pool-schema.yml +++ b/schemas/contrail/core/loadbalancer-pool-schema.yml @@ -22,7 +22,7 @@ references: presence: optional service_appliance_set: description: '' - operations: RReference to service-appliance-set where this loadbalancer-pool is + operations: Reference to service-appliance-set where this loadbalancer-pool is hosted. Applicable to LBaaS V1. presence: system-only service_instance: diff --git a/schemas/contrail/core/multicast-group-address-schema.yml b/schemas/contrail/core/multicast-group-address-schema.yml index a45faea3de..4c8e2662b1 100644 --- a/schemas/contrail/core/multicast-group-address-schema.yml +++ b/schemas/contrail/core/multicast-group-address-schema.yml @@ -3,7 +3,7 @@ extends: - base id: multicast_group_address parents: {} -plural: multicast_group_addresss +plural: multicast_group_address prefix: / references: {} schema: diff --git a/schemas/contrail/core/multicast-policy-schema.yml b/schemas/contrail/core/multicast-policy-schema.yml index cb43d16287..ce86d2c2e3 100644 --- a/schemas/contrail/core/multicast-policy-schema.yml +++ b/schemas/contrail/core/multicast-policy-schema.yml @@ -8,7 +8,7 @@ parents: maintained by system. operations: CRUD presence: optional -plural: multicast_policys +plural: multicast_policies prefix: / references: {} schema: diff --git a/schemas/contrail/core/network-policy-schema.yml b/schemas/contrail/core/network-policy-schema.yml index cb65e7b601..101e143822 100644 --- a/schemas/contrail/core/network-policy-schema.yml +++ b/schemas/contrail/core/network-policy-schema.yml @@ -9,7 +9,7 @@ parents: Network policies that are attached to virtual networks. operations: CRUD presence: optional -plural: network_policys +plural: network_policies prefix: / references: {} schema: diff --git a/schemas/contrail/core/node-schema.yml b/schemas/contrail/core/node-schema.yml index a5a14f0f23..d7f89762fd 100644 --- a/schemas/contrail/core/node-schema.yml +++ b/schemas/contrail/core/node-schema.yml @@ -27,7 +27,7 @@ schema: operations: CRUD presence: optional disk_partition: - description: Comma seperated disk partition to use. + description: Comma separated disk partition to use. operations: CRUD presence: optional type: string diff --git a/schemas/contrail/core/peering-policy-schema.yml b/schemas/contrail/core/peering-policy-schema.yml index 952726049f..26843b9a48 100644 --- a/schemas/contrail/core/peering-policy-schema.yml +++ b/schemas/contrail/core/peering-policy-schema.yml @@ -3,7 +3,7 @@ extends: - base id: peering_policy parents: {} -plural: peering_policys +plural: peering_policies prefix: / references: {} schema: diff --git a/schemas/contrail/core/role-config-schema.yml b/schemas/contrail/core/role-config-schema.yml index 36650261e2..0706f4bb32 100644 --- a/schemas/contrail/core/role-config-schema.yml +++ b/schemas/contrail/core/role-config-schema.yml @@ -14,7 +14,7 @@ references: job_template: description: This reference associates the role config to a job-template that contains a playbook that generates device specific role config - and deploys it to the device. The role-config.config attribtue value must be + and deploys it to the device. The role-config.config attribute value must be in JSON format and conform to the input_schema defined in the job-template. operations: CRUD presence: optional diff --git a/schemas/contrail/core/routing-policy-schema.yml b/schemas/contrail/core/routing-policy-schema.yml index d022fcda59..ebcc56b184 100644 --- a/schemas/contrail/core/routing-policy-schema.yml +++ b/schemas/contrail/core/routing-policy-schema.yml @@ -8,7 +8,7 @@ parents: maintained by system. operations: CRUD presence: optional -plural: routing_policys +plural: routing_policies prefix: / references: routing_instance: diff --git a/schemas/contrail/core/structured-syslog-message-schema.yml b/schemas/contrail/core/structured-syslog-message-schema.yml index 3992d6371b..fdd2749872 100644 --- a/schemas/contrail/core/structured-syslog-message-schema.yml +++ b/schemas/contrail/core/structured-syslog-message-schema.yml @@ -15,7 +15,7 @@ schema: properties: structured_syslog_message_forward: $ref: types.json#/definitions/StructuredSyslogMessageForwardType - description: fowarding action to be taken on the message + description: forwarding action to be taken on the message operations: CRUD presence: required structured_syslog_message_integer_fields: diff --git a/schemas/contrail/core/tag-schema.yml b/schemas/contrail/core/tag-schema.yml index 40fc47824d..a8cca96d1c 100644 --- a/schemas/contrail/core/tag-schema.yml +++ b/schemas/contrail/core/tag-schema.yml @@ -23,7 +23,7 @@ schema: tag_id: $ref: types.json#/definitions/U32BitHexInt description: 'Internal Tag ID encapsulating tag type and value in hexadecimal - fomat: 0xTTTTVVVV (T: type, V: value)' + format: 0xTTTTVVVV (T: type, V: value)' operations: R presence: optional tag_predefined: diff --git a/schemas/contrail/core/types.yml b/schemas/contrail/core/types.yml index 0462fbb6b4..185afc0518 100644 --- a/schemas/contrail/core/types.yml +++ b/schemas/contrail/core/types.yml @@ -539,7 +539,7 @@ definitions: It holds ipv6 gateway address for ipv6 subnet from which the client has IP address. The value is used as nexthop when advertising routes to the client via bgp. Note that the ipv6-gateway-address can be a regular ipv6 - address or a ipv4-mapped-ipv6 adddress. + address or a ipv4-mapped-ipv6 address. presence: optional local_autonomous_system: description: BgpRouter specific Autonomous System number if different from @@ -550,7 +550,7 @@ definitions: type: integer port: description: TCP port number on which BGP protocol connections are accepted. - default is based on standareds. + default is based on standards. presence: optional type: integer router_type: @@ -1969,7 +1969,7 @@ definitions: job_completion_weightage: description: Job percentage completion when this playbook is completed. This attribute value should 100 if there is only one playbook defined in the - job template. The job-completion-weigtages for all playbooks in the same + job template. The job-completion-weightages for all playbooks in the same job-template should add up to 100 exact. type: integer multi_device_playbook: diff --git a/schemas/neutron/req_network.yaml b/schemas/neutron/req_network.yaml index ae2e2d4c4a..8d511257cb 100644 --- a/schemas/neutron/req_network.yaml +++ b/schemas/neutron/req_network.yaml @@ -38,7 +38,7 @@ schema: admin_state_up: presence: optional type: boolean - policys: + policies: presence: optional type: array items: diff --git a/schemas/neutron/resp_network.yaml b/schemas/neutron/resp_network.yaml index f9f51a2b32..5946b01d35 100644 --- a/schemas/neutron/resp_network.yaml +++ b/schemas/neutron/resp_network.yaml @@ -31,7 +31,7 @@ schema: type: string port_security_enabled: type: boolean - policys: + policies: presence: optional type: array items: diff --git a/tools/init_data.yaml b/tools/init_data.yaml index fedb1678f0..f39a496431 100644 --- a/tools/init_data.yaml +++ b/tools/init_data.yaml @@ -908,7 +908,7 @@ resources: status: $id: /properties/output/properties/status default: "" - description: Status of the plabybook run + description: Status of the playbook run examples: - SUCCESS title: The Status Schema