Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Display invalid files in Status #115

Merged
merged 5 commits into from
May 3, 2019
Merged

Display invalid files in Status #115

merged 5 commits into from
May 3, 2019

Conversation

nexuhan
Copy link
Contributor

@nexuhan nexuhan commented Mar 29, 2019

Displays in status a list of files considered invalid due to parsing errors.

Appears as:

status:
  ignoredFiles:
  - foo/bar/statefulset.yaml

TODO:

  • Increment "objectsIgnored" by 1 for each ignored file (currently not working)
  • Add status message for resources ignored via GVR

@nexuhan nexuhan force-pushed the display-ignored-files branch 4 times, most recently from 20c426f to 39153af Compare April 1, 2019 12:45
@nexuhan nexuhan changed the title Display ignored files Display invalid files Apr 1, 2019
@nexuhan nexuhan requested a review from a team April 1, 2019 12:47
@nexuhan nexuhan marked this pull request as ready for review April 1, 2019 12:47
@nexuhan nexuhan changed the title Display invalid files Display invalid files in Status Apr 1, 2019
Copy link
Contributor

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a test case for this before we merge it IMO.

Could you also add a quick code block showing the output of what -o yaml would look like for the status field with this change?

Finally, I'd like to see ignores from the handleObject function printed in this output too, any chance you can work that into this PR?

pkg/controller/gittrack/gittrack_controller.go Outdated Show resolved Hide resolved
pkg/controller/gittrack/gittrack_controller.go Outdated Show resolved Hide resolved
Copy link
Contributor

@mthssdrbrg mthssdrbrg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look reasonable, needs to have some tests though! :)

@pusher pusher deleted a comment from pusher-ci Apr 3, 2019
@@ -238,7 +238,7 @@ func (r *ReconcileGitTrack) getFiles(gt *farosv1alpha1.GitTrack) (map[string]*gi
return nil, fmt.Errorf("no files for subpath '%s'", gt.Spec.SubPath)
}

r.log.V(1).Info("Loaded files from repository", "file count", string(len(files)))
r.log.V(1).Info("Loaded files from repository", "file count", len(files))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, but the logging message confuses me.

@pusher-ci pusher-ci added size/L and removed size/M labels May 1, 2019
mthssdrbrg
mthssdrbrg previously approved these changes May 2, 2019
Copy link
Contributor

@mthssdrbrg mthssdrbrg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Have we tested this live somewhere? Otherwise that'd be a good exercise to do.

@nexuhan
Copy link
Contributor Author

nexuhan commented May 2, 2019

@mthssdrbrg I had tested only before @JoelSpeed's changes

@nexuhan
Copy link
Contributor Author

nexuhan commented May 3, 2019

/build docker

@nexuhan
Copy link
Contributor Author

nexuhan commented May 3, 2019

LGTM @mthssdrbrg @JoelSpeed WDYT?

  ignoredFiles:
    foo/alerts.yaml: |
      unable to parse 'foo/alerts.yaml': unable to unmarshal JSON: json: cannot unmarshal string into Go value of type map[string]interface {}
    foo/statefulset.yaml: |
      unable to parse 'foo/statefulset.yaml': unable to unmarshal JSON: json: cannot unmarshal string into Go value of type map[string]interface {}
    bar/configmap.yaml: |
      unable to parse 'bar/configmap.yaml': unable to unmarshal JSON: json: cannot unmarshal string into Go value of type map[string]interface {}
  objectsApplied: 83
  objectsDiscovered: 83
  objectsIgnored: 3
  objectsInSync: 83

@pusher pusher deleted a comment from pusher-ci May 3, 2019
@pusher pusher deleted a comment from pusher-ci May 3, 2019
@nexuhan nexuhan requested a review from a team May 3, 2019 13:31
@JoelSpeed
Copy link
Contributor

/retest

1 similar comment
@JoelSpeed
Copy link
Contributor

/retest

Copy link
Contributor

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (though I authored half of it so @mthssdrbrg or @gargath can you also review)

Copy link
Contributor

@wonderhoss wonderhoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nexuhan nexuhan merged commit 7c74701 into master May 3, 2019
@pusher-ci pusher-ci deleted the display-ignored-files branch May 3, 2019 14:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants