Skip to content

Commit

Permalink
remove more stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Laubi committed Feb 3, 2025
1 parent 6d6cb71 commit 4a8cbad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
4 changes: 0 additions & 4 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ type Config struct {
// Skip flag indicates if the deployment of this configuration should be skipped. It is resolved during project loading.
Skip bool

// SkipForConversion is only used for converting v1-configs to v2-configs.
// It is required as the object itself does only store the resolved 'skip' value, not the actual parameter.
SkipForConversion parameter.Parameter

// OriginObjectId is the DT object ID of the object when it was downloaded from an environment
OriginObjectId string
}
Expand Down
18 changes: 6 additions & 12 deletions pkg/persistence/config/writer/config_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
"github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/testutils"
"github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/config"
"github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/config/coordinate"
envParam "github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/config/parameter/environment"
refParam "github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/config/parameter/reference"
"github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/config/template"
"github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/persistence/config/internal/persistence"
Expand Down Expand Up @@ -751,7 +750,6 @@ func TestWriteConfigs(t *testing.T) {
Parameters: map[string]parameter.Parameter{
config.NameParameter: &value.ValueParameter{Value: "name"},
},
SkipForConversion: envParam.New("ENV_VAR_SKIP"),
},
},
expectedConfigs: map[string]persistence.TopLevelDefinition{
Expand All @@ -763,10 +761,7 @@ func TestWriteConfigs(t *testing.T) {
Name: "name",
Parameters: nil,
Template: "a.json",
Skip: map[any]any{
"type": "environment",
"name": "ENV_VAR_SKIP",
},
Skip: false,
},
Type: persistence.TypeDefinition{
Type: config.ClassicApiType{
Expand Down Expand Up @@ -799,7 +794,6 @@ func TestWriteConfigs(t *testing.T) {
config.NameParameter: &value.ValueParameter{Value: "name"},
config.ScopeParameter: value.New("tenant"),
},
SkipForConversion: value.New("true"),
},
},
expectedConfigs: map[string]persistence.TopLevelDefinition{
Expand All @@ -811,7 +805,7 @@ func TestWriteConfigs(t *testing.T) {
Name: "name",
Parameters: nil,
Template: "somethingTooLongaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
Skip: "true",
Skip: false,
},
Type: persistence.TypeDefinition{
Type: config.SettingsType{
Expand Down Expand Up @@ -1403,16 +1397,16 @@ func TestWriteConfigs(t *testing.T) {
}

// check all api-folders config file
for apiType, definition := range tc.expectedConfigs {
for apiType, expectedDefinition := range tc.expectedConfigs {

content, err := afero.ReadFile(fs, "test/project/"+apiType+"/config.yaml")
assert.NoError(t, err, "reading config file should not produce an error")

var s persistence.TopLevelDefinition
err = yaml.Unmarshal(content, &s)
var actual persistence.TopLevelDefinition
err = yaml.Unmarshal(content, &actual)
assert.NoError(t, err, "unmarshalling config file should not produce an error")

assert.Equal(t, s, definition)
assert.Equal(t, expectedDefinition, actual)
}

// check that templates have been created
Expand Down

0 comments on commit 4a8cbad

Please sign in to comment.