Skip to content

Commit

Permalink
Use expected formatting in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
iabudiab committed Apr 2, 2021
1 parent 0362430 commit 99d2318
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates/model/AnyKubernetesAPIResource.swift.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public struct AnyKubernetesAPIResource: KubernetesAPIResource {
switch gvk {
{% for gvk in allGVK %}
case .{{ gvk|GVK.case }}:
decoded = try {{ gvk|GVK.type }}.init(from: decoder){% endfor %}
decoded = try {{ gvk|GVK.type }}(from: decoder){% endfor %}
default:
let context = DecodingError.Context(
codingPath: [CodingKeys.apiVersion, CodingKeys.kind],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public extension GroupVersionKind {
///
/// - Parameter resource: An instance of a `KubernetesAPIResource`
init?<R: KubernetesAPIResource>(of resource: R) {
if let gvk = GroupVersionKind.init(rawValue: "\(resource.apiVersion)/\(resource.kind)") {
if let gvk = GroupVersionKind(rawValue: "\(resource.apiVersion)/\(resource.kind)") {
self = gvk
} else {
return nil
Expand Down
2 changes: 1 addition & 1 deletion templates/model/Resource.swift.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ extension {{ type.group }}.{{ type.version }}.{{ type.kind }}: Sequence {
public typealias Element = {{ type.group }}.{{ type.version }}.{{ type.listItemKind }}

public func makeIterator() -> AnyIterator<{{ type.group }}.{{ type.version }}.{{ type.listItemKind }}> {
AnyIterator(self.items.makeIterator())
AnyIterator(items.makeIterator())
}
}
{% endif %}

0 comments on commit 99d2318

Please sign in to comment.