Skip to content

Commit

Permalink
use lib-go version of the markdown interface
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k authored and vrutkovs committed Apr 15, 2024
1 parent 3cf886a commit b159936
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 118 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
package autoregenerate_after_expiry

import "github.com/openshift/origin/pkg/cmd/update-tls-artifacts/generate-owners/tlsmetadatainterfaces"
import (
"github.com/openshift/library-go/pkg/markdown"
"github.com/openshift/origin/pkg/cmd/update-tls-artifacts/generate-owners/tlsmetadatainterfaces"
)

const annotationName string = "certificates.openshift.io/auto-regenerate-after-offline-expiry"

type AutoRegenerateAfterOfflineExpiryRequirement struct{}

func NewAutoRegenerateAfterOfflineExpiryRequirement() tlsmetadatainterfaces.Requirement {

md := tlsmetadatainterfaces.NewMarkdown("")
md := markdown.NewMarkdown("")
md.Text("Acknowledging that a cert/key pair or CA bundle can auto-regenerate after it expires offline means")
md.Text("that if the cluster is shut down until the certificate expires, when the machines are restarted")
md.Text("the cluster will automatically create new cert/key pairs or update CA bundles as required without human")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package descriptions

import (
"github.com/openshift/api/annotations"
"github.com/openshift/library-go/pkg/markdown"
"github.com/openshift/origin/pkg/cmd/update-tls-artifacts/generate-owners/tlsmetadatainterfaces"
)

type DescriptionRequirements struct{}

func NewDescriptionRequirement() tlsmetadatainterfaces.Requirement {

md := tlsmetadatainterfaces.NewMarkdown("")
md := markdown.NewMarkdown("")
md.Text("TLS artifacts must have user-facing descriptions on their in-cluster resources.")
md.Text("These descriptions must be in the style of API documentation and must include")
md.OrderedListStart()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ownership
import (
"encoding/json"
"fmt"
"github.com/openshift/library-go/pkg/markdown"

"github.com/openshift/origin/pkg/cmd/update-tls-artifacts/generate-owners/tlsmetadatainterfaces"

Expand Down Expand Up @@ -93,7 +94,7 @@ func generateOwnershipMarkdown(pkiInfo *certgraphapi.PKIRegistryInfo) ([]byte, e
caBundlesByOwner[owner] = append(caBundlesByOwner[owner], curr)
}

md := tlsmetadatainterfaces.NewMarkdown("Certificate Ownership")
md := markdown.NewMarkdown("Certificate Ownership")

if len(certsWithoutOwners) > 0 || len(caBundlesWithoutOwners) > 0 {
md.Title(2, fmt.Sprintf("Missing Owners (%d)", len(certsWithoutOwners)+len(caBundlesWithoutOwners)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"github.com/openshift/library-go/pkg/certs/cert-inspection/certgraphapi"
"github.com/openshift/library-go/pkg/markdown"
"k8s.io/apimachinery/pkg/util/sets"
)

Expand Down Expand Up @@ -91,7 +92,7 @@ func (o annotationRequirement) generateInspectionMarkdown(pkiInfo *certgraphapi.
compliantCABundlesByOwner[owner] = append(compliantCABundlesByOwner[owner], curr)
}

md := NewMarkdown(o.title)
md := markdown.NewMarkdown(o.title)
md.Title(2, "How to meet the requirement")
md.ExactText(o.explanationMD)

Expand Down

This file was deleted.

0 comments on commit b159936

Please sign in to comment.