Skip to content

Commit

Permalink
cleanup; generate schemas
Browse files Browse the repository at this point in the history
Signed-off-by: Archit Sharma <[email protected]>
  • Loading branch information
arcolife committed Nov 3, 2023
1 parent a0e1c8c commit 12110f2
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 319 deletions.
39 changes: 0 additions & 39 deletions config/crds/troubleshoot.sh_analyzers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1497,49 +1497,10 @@ spec:
type: object
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
namespace:
type: string
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
strict:
type: BoolString
required:
- namespace
- outcomes
type: object
weaveReport:
properties:
Expand Down
39 changes: 0 additions & 39 deletions config/crds/troubleshoot.sh_preflights.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1497,49 +1497,10 @@ spec:
type: object
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
namespace:
type: string
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
strict:
type: BoolString
required:
- namespace
- outcomes
type: object
weaveReport:
properties:
Expand Down
39 changes: 0 additions & 39 deletions config/crds/troubleshoot.sh_supportbundles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1528,49 +1528,10 @@ spec:
type: object
checkName:
type: string
collectorName:
type: string
exclude:
type: BoolString
namespace:
type: string
outcomes:
items:
properties:
fail:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
pass:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
warn:
properties:
message:
type: string
uri:
type: string
when:
type: string
type: object
type: object
type: array
strict:
type: BoolString
required:
- namespace
- outcomes
type: object
weaveReport:
properties:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ require (
go.opentelemetry.io/otel v1.19.0
go.opentelemetry.io/otel/sdk v1.19.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
golang.org/x/mod v0.12.0
golang.org/x/sync v0.4.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.28.2
Expand Down Expand Up @@ -105,7 +106,6 @@ require (
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
Expand Down
6 changes: 0 additions & 6 deletions pkg/analyze/velero.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func (a *AnalyzeVelero) veleroStatus(analyzer *troubleshootv1beta2.VeleroAnalyze
// check if veleroVersion is less than 1.10.x
compareResult := semver.Compare(veleroVersion, "1.10.0")
if compareResult < 0 {
fmt.Printf("Version %s is less than %s\n", veleroVersion, "1.10.0")
oldVeleroRepoType = true
}

Expand Down Expand Up @@ -335,11 +334,6 @@ func analyzeResticRepositories(resticRepositories []*restic_types.ResticReposito
resticRepositoriesResult.Message = "No restic repositories configured"
} else {
for _, resticRepository := range resticRepositories {
// phase, _, err := unstructured.NestedString(resticRepository.Object, "status", "phase")
// if err != nil {
// klog.V(2).Infof("Failed to get phase for restic repository %s: %v", resticRepository.GetName(), err)
// }
// if phase != "Ready" {
if resticRepository.Status.Phase != restic_types.ResticRepositoryPhaseReady {
result := &AnalyzeResult{
Title: fmt.Sprintf("Restic Repository %s", resticRepository.GetName()),
Expand Down
5 changes: 1 addition & 4 deletions pkg/apis/troubleshoot/v1beta2/analyzer_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,7 @@ type CephStatusAnalyze struct {
}

type VeleroAnalyze struct {
AnalyzeMeta `json:",inline" yaml:",inline"`
Outcomes []*Outcome `json:"outcomes" yaml:"outcomes"`
CollectorName string `json:"collectorName,omitempty" yaml:"collectorName,omitempty"`
Namespace string `json:"namespace" yaml:"namespace"`
AnalyzeMeta `json:",inline" yaml:",inline"`
}

type LonghornAnalyze struct {
Expand Down
11 changes: 0 additions & 11 deletions pkg/apis/troubleshoot/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 0 additions & 60 deletions schemas/analyzer-troubleshoot-v1beta2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2257,10 +2257,6 @@
},
"velero": {
"type": "object",
"required": [
"namespace",
"outcomes"
],
"properties": {
"annotations": {
"type": "object",
Expand All @@ -2271,65 +2267,9 @@
"checkName": {
"type": "string"
},
"collectorName": {
"type": "string"
},
"exclude": {
"oneOf": [{"type": "string"},{"type": "boolean"}]
},
"namespace": {
"type": "string"
},
"outcomes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fail": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"uri": {
"type": "string"
},
"when": {
"type": "string"
}
}
},
"pass": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"uri": {
"type": "string"
},
"when": {
"type": "string"
}
}
},
"warn": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"uri": {
"type": "string"
},
"when": {
"type": "string"
}
}
}
}
}
},
"strict": {
"oneOf": [{"type": "string"},{"type": "boolean"}]
}
Expand Down
60 changes: 0 additions & 60 deletions schemas/preflight-troubleshoot-v1beta2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2257,10 +2257,6 @@
},
"velero": {
"type": "object",
"required": [
"namespace",
"outcomes"
],
"properties": {
"annotations": {
"type": "object",
Expand All @@ -2271,65 +2267,9 @@
"checkName": {
"type": "string"
},
"collectorName": {
"type": "string"
},
"exclude": {
"oneOf": [{"type": "string"},{"type": "boolean"}]
},
"namespace": {
"type": "string"
},
"outcomes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fail": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"uri": {
"type": "string"
},
"when": {
"type": "string"
}
}
},
"pass": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"uri": {
"type": "string"
},
"when": {
"type": "string"
}
}
},
"warn": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"uri": {
"type": "string"
},
"when": {
"type": "string"
}
}
}
}
}
},
"strict": {
"oneOf": [{"type": "string"},{"type": "boolean"}]
}
Expand Down
Loading

0 comments on commit 12110f2

Please sign in to comment.