generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor client factory * refactor context package * add explaining comments * refactor deep merging of maps * rename test suite descriptions * refactor version handling for executables
- Loading branch information
1 parent
3654ef3
commit c908696
Showing
15 changed files
with
340 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and component-operator-runtime contributors | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package version | ||
|
||
import ( | ||
"runtime" | ||
) | ||
|
||
var ( | ||
version = "latest" | ||
metadata = "" | ||
gitCommit = "" | ||
gitTreeState = "" | ||
) | ||
|
||
type BuildInfo struct { | ||
Version string `json:"version,omitempty"` | ||
GitCommit string `json:"gitCommit,omitempty"` | ||
GitTreeState string `json:"gitTreeState,omitempty"` | ||
GoVersion string `json:"goVersion,omitempty"` | ||
} | ||
|
||
func GetVersion() string { | ||
if metadata == "" { | ||
return version | ||
} | ||
return version + "+" + metadata | ||
} | ||
|
||
func GetBuildInfo() BuildInfo { | ||
return BuildInfo{ | ||
Version: GetVersion(), | ||
GitCommit: gitCommit, | ||
GitTreeState: gitTreeState, | ||
GoVersion: runtime.Version(), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and component-operator-runtime contributors | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package manifests_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestComponent(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Package tests") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.