Skip to content

Commit

Permalink
Merge pull request #14 from prajyot-workspace/update-ignition
Browse files Browse the repository at this point in the history
fix lint issues
  • Loading branch information
Karthik-K-N authored Feb 29, 2024
2 parents faca105 + 113422f commit 6b7599e
Showing 1 changed file with 49 additions and 2 deletions.
51 changes: 49 additions & 2 deletions pkg/ignition/ignition.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ limitations under the License.

package ignition

// CaReference holds the CaReference specific information.
type CaReference struct {
HTTPHeaders HTTPHeaders `json:"httpHeaders,omitempty"`
Source string `json:"source"`
Verification Verification `json:"verification,omitempty"`
}

// Config holds the Config specific information.
type Config struct {
Ignition Ignition `json:"ignition"`
Networkd Networkd `json:"networkd,omitempty"`
Expand All @@ -30,69 +32,84 @@ type Config struct {
Systemd Systemd `json:"systemd,omitempty"`
}

// ConfigReference holds the ConfigReference specific information.
type ConfigReference struct {
HTTPHeaders HTTPHeaders `json:"httpHeaders,omitempty"`
Source string `json:"source"`
Verification Verification `json:"verification,omitempty"`
}

// Create holds the Create specific information.
type Create struct {
Force bool `json:"force,omitempty"`
Options []CreateOption `json:"options,omitempty"`
}

// CreateOption holds the CreateOption specific information.
type CreateOption string

// Device holds the Device specific information.
type Device string

// Directory holds the Directory specific information.
type Directory struct {
Node
DirectoryEmbedded1
}

// DirectoryEmbedded1 holds the DirectoryEmbedded1 specific information.
type DirectoryEmbedded1 struct {
Mode *int `json:"mode,omitempty"`
}

// Disk holds the Disk specific information.
type Disk struct {
Device string `json:"device"`
Partitions []Partition `json:"partitions,omitempty"`
WipeTable bool `json:"wipeTable,omitempty"`
}

// File holds the File specific information.
type File struct {
Node
FileEmbedded1
}

// FileContents holds the FileContents specific information.
type FileContents struct {
Compression string `json:"compression,omitempty"`
HTTPHeaders HTTPHeaders `json:"httpHeaders,omitempty"`
Source string `json:"source,omitempty"`
Verification Verification `json:"verification,omitempty"`
}

// FileEmbedded1 holds the FileEmbedded1 specific information.
type FileEmbedded1 struct {
Append bool `json:"append,omitempty"`
Contents FileContents `json:"contents,omitempty"`
Mode *int `json:"mode,omitempty"`
}

// Filesystem holds the Filesystem specific information.
type Filesystem struct {
Mount *Mount `json:"mount,omitempty"`
Name string `json:"name,omitempty"`
Path *string `json:"path,omitempty"`
}

// Group holds the Group specific information.
type Group string

// HTTPHeader holds the HTTPHeader specific information.
type HTTPHeader struct {
Name string `json:"name"`
Value string `json:"value"`
}

// HTTPHeaders holds the HTTPHeaders specific information.
type HTTPHeaders []HTTPHeader

// Ignition holds the Ignition specific information.
type Ignition struct {
Config IgnitionConfig `json:"config,omitempty"`
Proxy Proxy `json:"proxy,omitempty"`
Expand All @@ -101,21 +118,25 @@ type Ignition struct {
Version string `json:"version,omitempty"`
}

type IgnitionConfig struct {
// IgnitionConfig holds the IgnitionConfig specific information.
type IgnitionConfig struct { //nolint:revive
Append []ConfigReference `json:"append,omitempty"`
Replace *ConfigReference `json:"replace,omitempty"`
}

// Link holds the Link specific information.
type Link struct {
Node
LinkEmbedded1
}

// LinkEmbedded1 holds the LinkEmbedded1 specific information.
type LinkEmbedded1 struct {
Hard bool `json:"hard,omitempty"`
Target string `json:"target"`
}

// Mount holds the Mount specific information.
type Mount struct {
Create *Create `json:"create,omitempty"`
Device string `json:"device"`
Expand All @@ -126,25 +147,31 @@ type Mount struct {
WipeFilesystem bool `json:"wipeFilesystem,omitempty"`
}

// MountOption holds the MountOption specific information.
type MountOption string

// Networkd holds the Networkd specific information.
type Networkd struct {
Units []Networkdunit `json:"units,omitempty"`
}

// NetworkdDropin holds the NetworkdDropin specific information.
type NetworkdDropin struct {
Contents string `json:"contents,omitempty"`
Name string `json:"name"`
}

// Networkdunit holds the Networkdunit specific information.
type Networkdunit struct {
Contents string `json:"contents,omitempty"`
Dropins []NetworkdDropin `json:"dropins,omitempty"`
Name string `json:"name"`
}

// NoProxyItem holds the NoProxyItem specific information.
type NoProxyItem string

// Node holds the Node specific information.
type Node struct {
Filesystem string `json:"filesystem"`
Group *NodeGroup `json:"group,omitempty"`
Expand All @@ -153,16 +180,19 @@ type Node struct {
User *NodeUser `json:"user,omitempty"`
}

// NodeGroup holds the NodeGroup specific information.
type NodeGroup struct {
ID *int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
}

// NodeUser holds the NodeUser specific information.
type NodeUser struct {
ID *int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
}

// Partition holds the Partition specific information.
type Partition struct {
GUID string `json:"guid,omitempty"`
Label *string `json:"label,omitempty"`
Expand All @@ -176,18 +206,21 @@ type Partition struct {
WipePartitionEntry bool `json:"wipePartitionEntry,omitempty"`
}

// Passwd holds the Passwd specific information.
type Passwd struct {
Groups []PasswdGroup `json:"groups,omitempty"`
Users []PasswdUser `json:"users,omitempty"`
}

// PasswdGroup holds the PasswdGroup specific information.
type PasswdGroup struct {
Gid *int `json:"gid,omitempty"`
Gid *int `json:"gid,omitempty"` //nolint:stylecheck
Name string `json:"name"`
PasswordHash string `json:"passwordHash,omitempty"`
System bool `json:"system,omitempty"`
}

// PasswdUser holds the PasswdUser specific information.
type PasswdUser struct {
Create *Usercreate `json:"create,omitempty"`
Gecos string `json:"gecos,omitempty"`
Expand All @@ -205,12 +238,14 @@ type PasswdUser struct {
UID *int `json:"uid,omitempty"`
}

// Proxy holds the Proxy specific information.
type Proxy struct {
HTTPProxy string `json:"httpProxy,omitempty"`
HTTPSProxy string `json:"httpsProxy,omitempty"`
NoProxy []NoProxyItem `json:"noProxy,omitempty"`
}

// Raid holds the Raid specific information.
type Raid struct {
Devices []Device `json:"devices"`
Level string `json:"level"`
Expand All @@ -219,14 +254,18 @@ type Raid struct {
Spares int `json:"spares,omitempty"`
}

// RaidOption holds the RaidOption specific information.
type RaidOption string

// SSHAuthorizedKey holds the SSHAuthorizedKey specific information.
type SSHAuthorizedKey string

// Security holds the Security specific information.
type Security struct {
TLS TLS `json:"tls,omitempty"`
}

// Storage holds the Storage specific information.
type Storage struct {
Directories []Directory `json:"directories,omitempty"`
Disks []Disk `json:"disks,omitempty"`
Expand All @@ -236,24 +275,29 @@ type Storage struct {
Raid []Raid `json:"raid,omitempty"`
}

// Systemd holds the Systemd specific information.
type Systemd struct {
Units []Unit `json:"units,omitempty"`
}

// SystemdDropin holds the SystemdDropin specific information.
type SystemdDropin struct {
Contents string `json:"contents,omitempty"`
Name string `json:"name"`
}

// TLS holds the TLS specific information.
type TLS struct {
CertificateAuthorities []CaReference `json:"certificateAuthorities,omitempty"`
}

// Timeouts holds the Timeouts specific information.
type Timeouts struct {
HTTPResponseHeaders *int `json:"httpResponseHeaders,omitempty"`
HTTPTotal *int `json:"httpTotal,omitempty"`
}

// Unit holds the Unit specific information.
type Unit struct {
Contents string `json:"contents,omitempty"`
Dropins []SystemdDropin `json:"dropins,omitempty"`
Expand All @@ -263,6 +307,7 @@ type Unit struct {
Name string `json:"name"`
}

// Usercreate holds the Usercreate specific information.
type Usercreate struct {
Gecos string `json:"gecos,omitempty"`
Groups []UsercreateGroup `json:"groups,omitempty"`
Expand All @@ -276,8 +321,10 @@ type Usercreate struct {
UID *int `json:"uid,omitempty"`
}

// UsercreateGroup holds the UsercreateGroup specific information.
type UsercreateGroup string

// Verification holds the Verification specific information.
type Verification struct {
Hash *string `json:"hash,omitempty"`
}

0 comments on commit 6b7599e

Please sign in to comment.