Skip to content

Commit

Permalink
fix: clean-up per comments
Browse files Browse the repository at this point in the history
  • Loading branch information
meganwolf0 committed Jun 7, 2024
1 parent 244d2c9 commit b078281
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/pkg/common/oscal/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ func ComponentDefinitionToRequirementMap(componentDefinition *oscalTypes_1_1_2.C
if component.ControlImplementations != nil {
for _, controlImplementation := range *component.ControlImplementations {
for _, requirement := range controlImplementation.ImplementedRequirements {
// TODO: should this be controlID (i.e., possibly combining multiple instances of the same control?)
requirementMap[requirement.UUID] = Requirement{
ImplementedRequirement: &requirement,
Component: &component,
Expand Down
5 changes: 2 additions & 3 deletions src/pkg/common/requirement-store/requirement-store.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ func (r *RequirementStore) ResolveLulaValidations(validationStore *validationsto
if requirement.ImplementedRequirement.Links != nil {
for _, link := range *requirement.ImplementedRequirement.Links {
if common.IsLulaLink(link) {
id := common.TrimIdPrefix(link.Href)
_, err := validationStore.GetLulaValidation(id)
_, err := validationStore.GetLulaValidation(link.Href)
if err != nil {
message.Debugf("Error adding validation from link %s: %v", link.Href, err)
// Create new LulaValidation and add to validationStore
lulaValidation = types.CreateFailingLulaValidation("lula-validation-error")
lulaValidation.Result.Observations = map[string]string{
fmt.Sprintf("Error getting Lula validation %s", link.Href): err.Error(),
}
validationStore.AddLulaValidation(lulaValidation, id)
validationStore.AddLulaValidation(lulaValidation, link.Href)
}
}
}
Expand Down
14 changes: 0 additions & 14 deletions src/pkg/domains/kubernetes/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,6 @@ func CreateFromManifest(ctx context.Context, client klient.Client, resourceBytes
}
}

// decoder := yaml.NewYAMLOrJSONDecoder(bytes.NewReader(resourceBytes), 4096)
// for {
// rawObj := &unstructured.Unstructured{}
// if err := decoder.Decode(rawObj); err != nil {
// if err == io.EOF {
// break
// }
// return nil, err
// }
// resource, err := createResource(ctx, client, rawObj)
// if err == nil {
// resources = append(resources, resource.Object)
// }
// }
return resources, nil
}

Expand Down

0 comments on commit b078281

Please sign in to comment.