Skip to content

Commit

Permalink
reorganize
Browse files Browse the repository at this point in the history
  • Loading branch information
AlisonB319 committed Apr 17, 2024
1 parent 1571297 commit 3bd2a81
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions pkg/agent/datamodel/sig_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,31 @@ func processComponents(components Components) {
}
}

func getCachedVersionsFromManifestJSON(manifestFilePath string) Manifest {
data, err := os.ReadFile(manifestFilePath)
if err != nil {
panic(err)
}
data = bytes.ReplaceAll(data, []byte("#EOF"), []byte(""))
var manifest Manifest
if err = json.Unmarshal(data, &manifest); err != nil {
panic(err)
}
return manifest
}

func getCachedVersionsFromComponentsJSON(componentsFilePath string) Components {
data, err := os.ReadFile(componentsFilePath)
if err != nil {
panic(err)
}
var components Components
if err = json.Unmarshal(data, &components); err != nil {
panic(err)
}
return components
}

type Manifest struct {
Containerd struct {
Edge string `json:"edge"`
Expand Down Expand Up @@ -114,19 +139,6 @@ type ProcessedManifest struct {
Installed map[string]string
}

func getCachedVersionsFromManifestJSON(manifestFilePath string) Manifest {
data, err := os.ReadFile(manifestFilePath)
if err != nil {
panic(err)
}
data = bytes.ReplaceAll(data, []byte("#EOF"), []byte(""))
var manifest Manifest
if err = json.Unmarshal(data, &manifest); err != nil {
panic(err)
}
return manifest
}

type Components struct {
ContainerImages []struct {
DownloadURL string `json:"downloadURL"`
Expand All @@ -149,18 +161,6 @@ type ContainerImage struct {
PrefetchOptimizations PrefetchOptimizations
}

func getCachedVersionsFromComponentsJSON(componentsFilePath string) Components {
data, err := os.ReadFile(componentsFilePath)
if err != nil {
panic(err)
}
var components Components
if err = json.Unmarshal(data, &components); err != nil {
panic(err)
}
return components
}

// SIGAzureEnvironmentSpecConfig is the overall configuration differences in different cloud environments.
/* TODO(tonyxu) merge this with AzureEnvironmentSpecConfig from aks-engine(pkg/api/azenvtypes.go) once
it's moved into AKS RP. */
Expand Down

0 comments on commit 3bd2a81

Please sign in to comment.