Skip to content

Commit

Permalink
added missing implementations for fakes
Browse files Browse the repository at this point in the history
Signed-off-by: WYGIN <[email protected]>
  • Loading branch information
WYGIN committed Oct 9, 2023
1 parent 4ec9360 commit c117ad1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@
tools/bcdhive_generator/.build

.DS_Store

.gitpod.yml
11 changes: 11 additions & 0 deletions fakes/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

func NewImage(name, topLayerSha string, identifier imgutil.Identifier) *Image {
return &Image{
buildConfigEnv: map[string]string{},
labels: nil,
env: map[string]string{},
topLayerSha: topLayerSha,
Expand All @@ -38,6 +39,7 @@ func NewImage(name, topLayerSha string, identifier imgutil.Identifier) *Image {
}

type Image struct {
buildConfigEnv map[string]string
deleted bool
layers []string
history []v1.History
Expand Down Expand Up @@ -136,6 +138,11 @@ func (i *Image) SetEnv(k string, v string) error {
return nil
}

func (i *Image) SetBuildConfigEnv(k string, v string) error {
i.buildConfigEnv[k] = v
return nil
}

func (i *Image) SetHistory(history []v1.History) error {
i.history = history
return nil
Expand Down Expand Up @@ -185,6 +192,10 @@ func (i *Image) Env(k string) (string, error) {
return i.env[k], nil
}

func (i *Image) BuildConfigEnv(k string) (string, error) {
return i.buildConfigEnv[k], nil
}

func (i *Image) TopLayer() (string, error) {
return i.topLayerSha, nil
}
Expand Down

0 comments on commit c117ad1

Please sign in to comment.