Skip to content

Commit

Permalink
Update chaos mesh to v2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
hypnoce committed May 25, 2022
1 parent 2d73f03 commit 85c839d
Show file tree
Hide file tree
Showing 6 changed files with 2,568 additions and 1,470 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ And Store.getKey can be used rather than directly referencing static Cache funct
* Fix #3947: Point CamelK Extension model to latest released version v1.8.2
* Update Tekton Pipeline Model to v0.35.0
* Fix #4031: Update Kubernetes Model to v1.24.0

* Update chaos-mesh extension to v2.1.3. Add PodHttpChaos, GCPChaos, BlockChaos and PhysicalMachineChaos.

#### New Features
* Fix #3407: Added Itemable.withItem to directly associate a resource with the DSL. It can be used as an alternative to Loadable.load when you already have the item. There is also client.resourceList(...).getResources() - that will provide the resource list as Resources. This allows you to implement composite operations easily with lambda: client.resourceList(...).getResources().forEach(r -> r.delete());
Expand Down
44 changes: 29 additions & 15 deletions extensions/chaosmesh/generator/cmd/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,22 @@ func main() {
// the CRD List types for which the model should be generated
// no other types need to be defined as they are auto discovered
crdLists := map[reflect.Type]schemagen.CrdScope{
reflect.TypeOf(chaosmesh.IoChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.KernelChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.NetworkChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.PodChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.PodIoChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.PodNetworkChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.StressChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.TimeChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.JVMChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.HTTPChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.DNSChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.AwsChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.IOChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.KernelChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.NetworkChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.PodChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.PodIOChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.PodHttpChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.PodNetworkChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.StressChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.TimeChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.JVMChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.HTTPChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.DNSChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.AWSChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.GCPChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.BlockChaosList{}): schemagen.Namespaced,
reflect.TypeOf(chaosmesh.PhysicalMachineChaosList{}): schemagen.Namespaced,
}

// constraints and patterns for fields
Expand All @@ -65,17 +69,27 @@ func main() {
// - replace <key> with <value> aka "package prefix"
// - replace '/' with '.' for a valid java package name
// e.g. knative.dev/eventing/pkg/apis/messaging/v1beta1/ChannelTemplateSpec is mapped to "io.fabric8.knative.internal.eventing.pkg.apis.messaging.v1beta1.ChannelTemplateSpec"
mappingSchema := map[string]string{
}
mappingSchema := map[string]string{}

// overwriting some times
manualTypeMap := map[reflect.Type]string{
reflect.TypeOf(v1.Time{}): "java.lang.String",
reflect.TypeOf(runtime.RawExtension{}): "Map<String, Object>",
reflect.TypeOf([]byte{}): "java.lang.String",
reflect.TypeOf([]string{}): "java.util.List<java.lang.String>",
}

json := schemagen.GenerateSchema("http://fabric8.io/csi/ChaosMeshSchema#", crdLists, providedPackages, manualTypeMap, packageMapping, mappingSchema, providedTypes, constraints, "io.fabric8")
json := schemagen.GenerateSchema(
"http://fabric8.io/csi/ChaosMeshSchema#",
crdLists,
providedPackages,
manualTypeMap,
packageMapping,
mappingSchema,
providedTypes,
constraints,
"io.fabric8",
)

fmt.Println(json)
}
83 changes: 56 additions & 27 deletions extensions/chaosmesh/generator/go.mod
Original file line number Diff line number Diff line change
@@ -1,35 +1,64 @@
module github.com/fabric8io/kubernetes-client/extensions/chaosmesh/generator

require (
github.com/chaos-mesh/chaos-mesh/api/v1alpha1 v0.0.0-20210728073817-92f5e71c799f
github.com/chaos-mesh/chaos-mesh/api/v1alpha1 v0.0.0-20220226050744-799408773657
github.com/fabric8io/kubernetes-client/generator v0.0.0
k8s.io/apimachinery v0.17.2
k8s.io/apimachinery v0.23.1
)

replace (
github.com/fabric8io/kubernetes-client/generator v0.0.0 => ./../../../generator
github.com/ugorji/go v1.1.5-pre => github.com/ugorji/go v1.1.7 // indirect https://github.com/swaggo/gin-swagger/issues/128
k8s.io/api => k8s.io/api v0.17.0
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.17.0
k8s.io/apimachinery => k8s.io/apimachinery v0.17.0
k8s.io/apiserver => k8s.io/apiserver v0.17.0
k8s.io/cli-runtime => k8s.io/cli-runtime v0.17.0
k8s.io/client-go => k8s.io/client-go v0.17.0
k8s.io/cloud-provider => k8s.io/cloud-provider v0.17.0
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.17.0
k8s.io/code-generator => k8s.io/code-generator v0.17.0
k8s.io/component-base => k8s.io/component-base v0.17.0
k8s.io/cri-api => k8s.io/cri-api v0.17.0
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.17.0
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.17.0
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.17.0
k8s.io/kube-proxy => k8s.io/kube-proxy v0.17.0
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.17.0
k8s.io/kubectl => k8s.io/kubectl v0.17.0
k8s.io/kubelet => k8s.io/kubelet v0.17.0
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.17.0
k8s.io/metrics => k8s.io/metrics v0.17.0
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.17.0
require (
github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.5 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.28.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8 // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/api v0.23.1 // indirect
k8s.io/apiextensions-apiserver v0.23.0 // indirect
k8s.io/client-go v0.23.1 // indirect
k8s.io/component-base v0.23.0 // indirect
k8s.io/klog/v2 v2.30.0 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect
sigs.k8s.io/controller-runtime v0.11.0 // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

go 1.13
replace github.com/fabric8io/kubernetes-client/generator v0.0.0 => ./../../../generator

go 1.17
Loading

0 comments on commit 85c839d

Please sign in to comment.