Skip to content

Commit a7fe458

Browse files
committed
initialize resource for watch error (#358) + lint errors
fix watch + lint errors
1 parent 4b1831c commit a7fe458

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+237
-674
lines changed

apis/config/config_helpers.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@ func BuildConfig(meta metav1.ObjectMeta, spec ConfigSpec) *Config {
140140
}
141141
}
142142

143+
func BuildEmptyConfig() *Config {
144+
return &Config{
145+
TypeMeta: metav1.TypeMeta{
146+
APIVersion: SchemeGroupVersion.Identifier(),
147+
Kind: ConfigKind,
148+
},
149+
}
150+
}
151+
143152
func (r *Config) HashDeviationGenerationChanged(deviation Deviation) bool {
144153
if r.Status.DeviationGeneration == nil {
145154
// if there was no old deviation, but now we have a deviation wwe return true

apis/config/configblame_helpers.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,12 @@ func BuildConfigBlame(meta metav1.ObjectMeta, spec ConfigBlameSpec, status Confi
3030
Status: status,
3131
}
3232
}
33+
34+
func BuildEmptyConfigBlame() *ConfigBlame {
35+
return &ConfigBlame{
36+
TypeMeta: metav1.TypeMeta{
37+
APIVersion: SchemeGroupVersion.Identifier(),
38+
Kind: ConfigBlameKind,
39+
},
40+
}
41+
}

apis/config/configset_helpers.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package config
1818

1919
import (
2020
"github.com/sdcio/config-server/apis/condition"
21+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2122
)
2223

2324
// GetCondition returns the condition based on the condition kind
@@ -30,3 +31,12 @@ func (r *ConfigSet) GetCondition(t condition.ConditionType) condition.Condition
3031
func (r *ConfigSet) SetConditions(c ...condition.Condition) {
3132
r.Status.SetConditions(c...)
3233
}
34+
35+
func BuildEmptyConfigSet() *ConfigSet {
36+
return &ConfigSet{
37+
TypeMeta: metav1.TypeMeta{
38+
APIVersion: SchemeGroupVersion.Identifier(),
39+
Kind: ConfigSetKind,
40+
},
41+
}
42+
}

apis/config/deviation_helper.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,13 @@ func BuildDeviation(meta metav1.ObjectMeta, spec *DeviationSpec, status *Deviati
9393
Spec: *spec,
9494
Status: *status,
9595
}
96+
}
97+
98+
func BuildEmptyDeviation() *Deviation {
99+
return &Deviation{
100+
TypeMeta: metav1.TypeMeta{
101+
APIVersion: SchemeGroupVersion.Identifier(),
102+
Kind: DeviationKind,
103+
},
104+
}
96105
}

apis/config/running_config_helpers.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,12 @@ func BuildRunningConfig(meta metav1.ObjectMeta, spec RunningConfigSpec, status R
3030
Status: status,
3131
}
3232
}
33+
34+
func BuildEmptyRunningConfig() *RunningConfig {
35+
return &RunningConfig{
36+
TypeMeta: metav1.TypeMeta{
37+
APIVersion: SchemeGroupVersion.Identifier(),
38+
Kind: RunningConfigKind,
39+
},
40+
}
41+
}

apis/config/unmanaged_config_resource.go

Lines changed: 0 additions & 301 deletions
This file was deleted.

0 commit comments

Comments
 (0)