json6902.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. Copyright 2018 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package patch
  14. import "sigs.k8s.io/kustomize/pkg/gvk"
  15. // Json6902 represents a json patch for an object
  16. // with format documented https://tools.ietf.org/html/rfc6902.
  17. type Json6902 struct {
  18. // Target refers to a Kubernetes object that the json patch will be
  19. // applied to. It must refer to a Kubernetes resource under the
  20. // purview of this kustomization. Target should use the
  21. // raw name of the object (the name specified in its YAML,
  22. // before addition of a namePrefix and a nameSuffix).
  23. Target *Target `json:"target" yaml:"target"`
  24. // relative file path for a json patch file inside a kustomization
  25. Path string `json:"path,omitempty" yaml:"path,omitempty"`
  26. }
  27. // Target represents the kubernetes object that the patch is applied to
  28. type Target struct {
  29. gvk.Gvk `json:",inline,omitempty" yaml:",inline,omitempty"`
  30. Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
  31. Name string `json:"name" yaml:"name"`
  32. }