Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: coreos/go-systemd
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v22.0.0
Choose a base ref
...
head repository: coreos/go-systemd
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v22.1.0
Choose a head ref
  • 12 commits
  • 7 files changed
  • 6 contributors

Commits on Jan 6, 2020

  1. Configuration menu
    Copy the full SHA
    d53122b View commit details
    Browse the repository at this point in the history

Commits on Jan 8, 2020

  1. Configuration menu
    Copy the full SHA
    ac22ec9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2b534a3 View commit details
    Browse the repository at this point in the history

Commits on Jan 9, 2020

  1. Merge pull request #329 from brunogui0812/master

    login1: support getting active session and session details
    Luca Bruno authored Jan 9, 2020
    Configuration menu
    Copy the full SHA
    d657f96 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2020

  1. deserialize: Use quote to print possibly-invalid string

    An openshift/machine-config-operator user wrote an invalid unit,
    and printing the contents as a byte array is unnecessary; it's
    almost certain to be a valid string, we just found a syntax error.
    cgwalters committed Mar 10, 2020
    Configuration menu
    Copy the full SHA
    6e15d2f View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2020

  1. Merge pull request #332 from cgwalters/quote-deserialize

    deserialize: Use quote to print possibly-invalid string
    Luca Bruno authored Mar 12, 2020
    Configuration menu
    Copy the full SHA
    0d26d2e View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2020

  1. unit: deserialize keeps all semantic data

    The existing unit.Deserialize() function does not contain all the
    semantic data in a unit file. Specifically it does not fully
    support multiple sections. It does correctly parse the sections,
    but the `[]*UnitOption` data structure does not tell the caller,
    in the case of a unit file with duplicate section names, *which*
    section the UnitOptions are from.
    
    This may matter.
    
    For example, a `/etc/systemd/network/*.network` file can have multiple
    `[Route]` entries. Just returning an array of `Section, Name, Value`
    tuples does not tell the caller which `[Route]` a given `Name, Value`
    pair belongs to.
    
    Ex:
    ```
    [Route]
    Gateway=10.0.100.1
    Destination=10.0.0.1/24
    
    [Route]
    Gateway=10.0.100.2
    Destination=10.0.2.1/24
    ```
    
    This unit file will generate the following from `unit.Deserialize()`
    
    ```
    {Section: "Route", Name: "Gateway", Value: "10.0.100.1"}
    {Section: "Route", Name: "Destination", Value: "10.0.0.1/24"}
    {Section: "Route", Name: "Gateway", Value: "10.0.100.2"}
    {Section: "Route", Name: "Destination", Value: "10.0.2.1/24"}
    ```
    
    With just this information, it is not possbile to know which `Gateway`
    goes to which `Destination`. Order maybe, but what if there were not two
    Gateways? Which `Destination` would go with the `Gateway`?
    
    This patch introduces a new Deserialize function that returns the
    following data structures:
    
    ```
    // UnitEntry is a single line entry in a Unit file.
    type UnitEntry struct {
    	Name  string
    	Value string
    }
    
    // UnitSection is a section in a Unit file. The section name
    // and a list of entries in that section.
    type UnitSection struct {
    	Section string
    	Entries []*UnitEntry
    }
    ```
    
    The new DeserializeSection() signature is:
    
    ```
    func DeserializeSections(f io.Reader) ([]*UnitSection, error)
    ```
    
    And the output from it given the example unit file above is:
    
    ```
    {Section: Route{Name: Gateway, Value: 10.0.100.1}{Name: Destination, Value: 10.0.0.1/24}}
    {Section: Route{Name: Gateway, Value: 10.0.100.2}{Name: Destination, Value: 10.0.2.1/24}}
    ```
    
    The `Name`, `Value` pairs are directly associated with a specific
    section. There is no ambiguity.
    
    There are unit tests added to `unit/deserialize_test.go` that do basic
    tests on `DeserializeSections()`. All exising unit tests in that file
    are untouched and pass.
    
    add license header
    
    unit: serialize sections added
    
    In addition to deserializing into UnitSections, also support
    serializing into them.  Tests added for this, both the appliciable
    serializing tests from UnitOptions, but also a specific test for
    UnitSections (the point of this patch).
    
    unit: fix serialize section test.
    
    I was testing the test by giving it bad data. It passed the failure. Now
    set the data back to the correct expected data.
    
    unit: code review updates, rework lex channel code
    
    Addressed code review comments.
    
    * Do not assume len of sections will always be > 0
    * Removed unneeded check for empty data.
    
    * Reworked the channels. Changed two dependent channels into a single
      channel. This simplifed the channel read handling very much and
      removed the read dependency between the channels.
    
    All tests are passing.
    
    Updates to PR 330
    
    unit: code review comments - tweaks
    
    * Made `DeserializeAll()` into a private function as there's no use case
      for it to be public.
    * Added `DeserializeOptions` to mirror the `DeserializeSections`.
    * Marked `Deserialize` as depreciated.
    * Return actual `error` on unit file misparse.
    
    unit: fix typo in comment.
    glawler committed Mar 13, 2020
    Configuration menu
    Copy the full SHA
    5e1c393 View commit details
    Browse the repository at this point in the history

Commits on Mar 16, 2020

  1. Merge pull request #330 from mergetb/unit-section-fix

    unit: deserialize keeps all semantic data
    Luca Bruno authored Mar 16, 2020
    Configuration menu
    Copy the full SHA
    cb8b647 View commit details
    Browse the repository at this point in the history
  2. unit: do not export private constants

    This renames and un-exports two private constants that are public
    by mistake (but never part of a release).
    Luca BRUNO committed Mar 16, 2020
    Configuration menu
    Copy the full SHA
    f4046b1 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2020

  1. Merge pull request #333 from lucab/ups/unit-unexport

    unit: do not export private constants
    squeed authored May 29, 2020
    Configuration menu
    Copy the full SHA
    b046ffc View commit details
    Browse the repository at this point in the history

Commits on Jun 2, 2020

  1. docs: update docs links in README

    This updates documentation links in README, in order to use the new
    module setup and abandon the now deprecated `godoc.org`.
    Luca BRUNO committed Jun 2, 2020
    Configuration menu
    Copy the full SHA
    f59d7ed View commit details
    Browse the repository at this point in the history
  2. Merge pull request #335 from lucab/ups/readme-godoc

    docs: update docs links in README
    Luca Bruno authored Jun 2, 2020
    Configuration menu
    Copy the full SHA
    b51e752 View commit details
    Browse the repository at this point in the history
Loading