<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Brett Tofel</title>
    <description>The latest articles on DEV Community by Brett Tofel (@bentito).</description>
    <link>https://dev.to/bentito</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F216099%2F0c934761-e87c-4f84-a6cf-55d54ea1b2ee.png</url>
      <title>DEV Community: Brett Tofel</title>
      <link>https://dev.to/bentito</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bentito"/>
    <language>en</language>
    <item>
      <title>Why can't Apple do a patch?</title>
      <dc:creator>Brett Tofel</dc:creator>
      <pubDate>Sun, 28 Mar 2021 15:30:08 +0000</pubDate>
      <link>https://dev.to/bentito/why-can-t-apple-do-a-patch-10b5</link>
      <guid>https://dev.to/bentito/why-can-t-apple-do-a-patch-10b5</guid>
      <description>&lt;p&gt;The cover image for this post shows updates being recommended for four (4) of the applications on my Mac. They represent 3+ Gb of download from Apple's App Store. So I guess I just wanted to wonder out loud...&lt;/p&gt;

&lt;p&gt;At this size, these certainly don't seem to be binary patch files, and if not, why not?&lt;/p&gt;

&lt;p&gt;BinaryMisfit on this &lt;a href="https://apple.stackexchange.com/questions/44368/do-apple-software-updates-really-take-up-as-much-space-as-it-shows-in-the-size-c"&gt;StackExchange&lt;/a&gt; thread from 2 years ago states the following:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;AppStore updates at the moment is always a complete full version of the new application being downloaded, the copy you have replaced, and the balance trashed.&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This seems really wasteful for the millions of MacOS App Store users' bandwidth and for Apple's bandwidth.&lt;/p&gt;

&lt;p&gt;Comments, or insight, appreciated. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to AND NOT something in a CRD</title>
      <dc:creator>Brett Tofel</dc:creator>
      <pubDate>Tue, 19 Nov 2019 14:21:40 +0000</pubDate>
      <link>https://dev.to/bentito/how-to-and-not-something-in-a-crd-4f15</link>
      <guid>https://dev.to/bentito/how-to-and-not-something-in-a-crd-4f15</guid>
      <description>&lt;p&gt;This advice is valid for sure if you're working with a Kubernetes CRD with version like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It might be valid for other versions too.&lt;/p&gt;

&lt;p&gt;If you want to create a structural CRD, and you want to require something not be there when some other value is set one way or another, here's an example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;                            &lt;span class="na"&gt;prometheus&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                              &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;object&lt;/span&gt;
                              &lt;span class="na"&gt;oneOf&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                              &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;enabled&lt;/span&gt;
                                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;uri&lt;/span&gt;
                                &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                  &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                    &lt;span class="na"&gt;enum&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
                              &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                  &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                    &lt;span class="na"&gt;enum&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="no"&gt;false&lt;/span&gt;
                                &lt;span class="na"&gt;allOf&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;not&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                    &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;uri&lt;/span&gt;
                              &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Whether or not to enable the Presto-Prometheus connector.&lt;/span&gt;
                                  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;boolean&lt;/span&gt;
                                &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;URI for Prometheus.&lt;/span&gt;
                                  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;string&lt;/span&gt;
                                  &lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;uri&lt;/span&gt;
                                &lt;span class="na"&gt;chunkSizeDuration&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Default size of each Prometheus query chunk.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;So that means:&lt;/p&gt;

&lt;p&gt;We require &lt;code&gt;oneOf&lt;/code&gt; the subschemas to be fulfilled. Either &lt;code&gt;enabled&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt; in which case we require &lt;code&gt;uri&lt;/code&gt; be defined. Or, &lt;code&gt;enabled&lt;/code&gt; is &lt;code&gt;false&lt;/code&gt; in which case, &lt;code&gt;uri&lt;/code&gt; is not required. The extra &lt;code&gt;allOf&lt;/code&gt; in there, in this case, is simply a way to allow for the &lt;code&gt;not&lt;/code&gt; in that 2nd subschema. And just highlight what is meant by subschemas. &lt;code&gt;oneOf&lt;/code&gt; starts a list of them. So the first is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;                              &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;enabled&lt;/span&gt;
                                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;uri&lt;/span&gt;
                                &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                  &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                    &lt;span class="na"&gt;enum&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;and the second is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;                              &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                  &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                    &lt;span class="na"&gt;enum&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="no"&gt;false&lt;/span&gt;
                                &lt;span class="na"&gt;allOf&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;not&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                    &lt;span class="na"&gt;required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                                      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;uri&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And to be structural you must list all the properties again, and you can include any items you're not setting requirements on. Which is the rest of the yaml above.&lt;/p&gt;

&lt;p&gt;Happy computing.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>crd</category>
      <category>openapi</category>
      <category>validate</category>
    </item>
  </channel>
</rss>
