Skip to content

Commit

Permalink
Fix go formatting 'make fmt'
Browse files Browse the repository at this point in the history
  • Loading branch information
efiacor committed Dec 12, 2024
1 parent c017ed2 commit a58b78b
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 21 deletions.
1 change: 0 additions & 1 deletion api/porch/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ type NameMeta struct {
Namespace string `json:"namespace,omitempty"`
}


// PackageRevisionResources
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
3 changes: 1 addition & 2 deletions api/porch/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ type PackageRevisionResourcesStatus struct {
RenderStatus RenderStatus `json:"renderStatus,omitempty"`
}


// Package
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -559,4 +558,4 @@ type PackageStatus struct {
// LatestRevision identifies the package revision that is the latest
// published package revision belonging to this package
LatestRevision string `json:"latestRevision,omitempty"`
}
}
3 changes: 1 addition & 2 deletions api/porch/v1alpha1/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ func LifecycleIsPublished(lifecycle PackageRevisionLifecycle) bool {
return lifecycle == PackageRevisionLifecyclePublished || lifecycle == PackageRevisionLifecycleDeletionProposed
}


// Check ReadinessGates checks if the package has met all readiness gates
func PackageRevisionIsReady(readinessGates []ReadinessGate, conditions []Condition) bool {
// Index our conditions
Expand All @@ -38,4 +37,4 @@ func PackageRevisionIsReady(readinessGates []ReadinessGate, conditions []Conditi
}

return true
}
}
6 changes: 3 additions & 3 deletions api/porchconfig/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const (
type RepositoryContent string

const (
RepositoryContentPackage RepositoryContent = "Package"
RepositoryContentPackage RepositoryContent = "Package"
)

// RepositorySpec defines the desired state of Repository
Expand All @@ -60,12 +60,12 @@ type RepositorySpec struct {
Deployment bool `json:"deployment,omitempty"`
// Type of the repository (i.e. git, OCI)
Type RepositoryType `json:"type,omitempty"`
// The Content field is deprecated, please do not specify it in new manifests.
// The Content field is deprecated, please do not specify it in new manifests.
// For partial backward compatibility it is still recognized, but its only valid value is "Package", and if not specified its default value is also "Package".
// +kubebuilder:validation:XValidation:message="The 'content' field is deprecated, its only valid value is 'Package'",rule="self == '' || self == 'Package'"
// +kubebuilder:default="Package"
Content *RepositoryContent `json:"content,omitempty"`

// Git repository details. Required if `type` is `git`. Ignored if `type` is not `git`.
Git *GitRepository `json:"git,omitempty"`
// OCI repository details. Required if `type` is `oci`. Ignored if `type` is not `oci`.
Expand Down
4 changes: 2 additions & 2 deletions pkg/cache/fake/credentialresolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package fake

import (
"context"
"github.com/nephio-project/porch/pkg/repository"
"github.com/go-git/go-git/v5/plumbing/transport"
"github.com/nephio-project/porch/pkg/repository"
)

type credential struct {
Expand All @@ -36,7 +36,7 @@ func (c *credential) ToAuthMethod() transport.AuthMethod {
panic("unimplemented")
}

type CredentialResolver struct{
type CredentialResolver struct {
cabundle string
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/commands/rpkg/approve/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ func TestCmd(t *testing.T) {
Spec: porchapi.PackageRevisionSpec{
Lifecycle: porchapi.PackageRevisionLifecycleProposed,
RepositoryName: repoName,
ReadinessGates: []porchapi.ReadinessGate {
ReadinessGates: []porchapi.ReadinessGate{
{
ConditionType: "nephio.org.Specializer.specialize",
},
},
},
Status: porchapi.PackageRevisionStatus{
Conditions: []porchapi.Condition {
Conditions: []porchapi.Condition{
{
Type: "nephio.org.Specializer.specialize",
Type: "nephio.org.Specializer.specialize",
Status: "False",
},
},
Expand Down

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

2 changes: 1 addition & 1 deletion pkg/registry/porch/packagerevisions_approval.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (a *packageRevisionsApproval) Get(ctx context.Context, name string, options
// Update finds a resource in the storage and updates it. Some implementations
// may allow updates creates the object - they should set the created boolean
// to true.
func (a *packageRevisionsApproval) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc,
func (a *packageRevisionsApproval) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc,
updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) {
allowCreate := false // do not allow create on update
return a.common.updatePackageRevision(ctx, name, objInfo, createValidation, updateValidation, allowCreate)
Expand Down
6 changes: 3 additions & 3 deletions pkg/registry/porch/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ const (
WorkloadIdentityAuthType = "kpt.dev/workload-identity-auth"

// Annotation used to specify the gsa for a ksa.
WIGCPSAAnnotation = "iam.gke.io/gcp-service-account"
WIGCPSAAnnotation = "iam.gke.io/gcp-service-account"

//Secret.Data key required for the caBundle
CaBundleDataName = "ca.crt"
CaBundleDataName = "ca.crt"
)

func NewCredentialResolver(coreClient client.Reader, resolverChain []Resolver) repository.CredentialResolver {
Expand Down
4 changes: 2 additions & 2 deletions pkg/registry/porch/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func TestCaBundleCredentialResolver(t *testing.T) {
},
},
expectedCredential: nil,
expectedErrString: "error resolving credential: CaBundle secret.Data key must be set as ca.crt",
expectedErrString: "error resolving credential: CaBundle secret.Data key must be set as ca.crt",
},
}

Expand Down Expand Up @@ -177,7 +177,7 @@ func TestCaBundleCredentialResolver(t *testing.T) {
if cred != nil {
assert.Equal(t, cred.ToString(), "blah")
assert.Equal(t, cred.Valid(), true)
assert.Panics(t, func() {cred.ToAuthMethod()})
assert.Panics(t, func() { cred.ToAuthMethod() })
}
})
}
Expand Down

0 comments on commit a58b78b

Please sign in to comment.