Compare commits

...

3 Commits

Author SHA1 Message Date
rahkumar56 a71177d4b4 fix: [CI-13178]: Upgrade go version with minor version to 1.22.4 (#120) 2024-07-10 16:06:42 +05:30
rahkumar56 5582e3ed7c feat: [CI-13178]: GO version upgrade from 1.22.0 to 1.22.4. (#119) 2024-07-03 12:30:41 +05:30
Hemanth Mantri 4c0f781999 [CI-13182]: Use snapshot-mode instead of snapshotMode (#118)
The kaniko flag `snapshotMode` is deprecated in favor of `snapshot-mode`. The default value of `snapshot-mode` is `full`. As a result, the `optimize` flag set in Harness CI's `BuildAndPushToDocker` steps doesn't behave as expected because the `full` mode triggers a full filesystem scan which is slow. The `optimize` flag in Harness translates to `snapshot-mode=redo` which means only filesystem deltas are compared which is much faster. 

This change fixes the flag name being sent to Kaniko executor. I verified that the executor present in the current version already supports this flag as shown below:

```
hemanthkumarmantri@Hemanth Kumar harness-core % docker run -it --entrypoint /kaniko/executor plugins/kaniko:1.8.10 --help | grep snapshot-mode
      --snapshot-mode string                      Change the file attributes inspected during snapshotting (default "full")
      --snapshotMode string                       This flag is deprecated. Please use '--snapshot-mode'.
```
2024-07-01 14:06:19 -07:00
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ platform:
steps:
- name: build
image: golang:1.22
image: golang:1.22.4
commands:
- go test ./...
- sh scripts/build.sh
@@ -178,7 +178,7 @@ pool:
steps:
- name: build
image: golang:1.22
image: golang:1.22.4
commands:
- go test ./...
- sh scripts/build.sh
+1 -1
View File
@@ -47,4 +47,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)
go 1.22.0
go 1.22.4
+1 -1
View File
@@ -222,7 +222,7 @@ func (p Plugin) Exec() error {
}
if p.Build.SnapshotMode != "" {
cmdArgs = append(cmdArgs, fmt.Sprintf("--snapshotMode=%s", p.Build.SnapshotMode))
cmdArgs = append(cmdArgs, fmt.Sprintf("--snapshot-mode=%s", p.Build.SnapshotMode))
}
if p.Build.EnableCache {